X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/95b3a95e742da57976a1cd8f723cc0819cbba53c..037aeaf61ace944c3e763346f2f2b877624e6e67:/sbr/datetime.c diff --git a/sbr/datetime.c b/sbr/datetime.c index a7906a52..333f2dda 100644 --- a/sbr/datetime.c +++ b/sbr/datetime.c @@ -6,8 +6,11 @@ */ #include "h/mh.h" +#include "dtime.h" +#include "error.h" #include "h/icalendar.h" -#include +#include "datetime.h" +#include "h/fmt_scan.h" #include "h/tws.h" #include "h/utils.h" #include "unquote.h" @@ -59,7 +62,8 @@ struct tzdesc { */ static int parse_datetime (const char *datetime, const char *zone, bool dst, - struct tws *tws) { + struct tws *tws) +{ char utc_indicator; bool form_1; int items_matched; @@ -153,7 +157,8 @@ parse_datetime (const char *datetime, const char *zone, bool dst, } tzdesc_t -load_timezones (const contentline *clines) { +load_timezones (const contentline *clines) +{ tzdesc_t timezones = NULL, timezone = NULL; bool in_vtimezone, in_standard, in_daylight; tzparams *params = NULL; @@ -240,7 +245,8 @@ load_timezones (const contentline *clines) { } void -free_timezones (tzdesc_t timezone) { +free_timezones (tzdesc_t timezone) +{ tzdesc_t next; for ( ; timezone; timezone = next) { @@ -268,9 +274,10 @@ free_timezones (tzdesc_t timezone) { * Given a recurrence rule and year, calculate its time in seconds * from 01 January UTC of the year. */ -time_t +static time_t rrule_clock (const char *rrule, const char *starttime, const char *zone, - unsigned int year) { + unsigned int year) +{ time_t clock = 0; if (nmh_strcasestr (rrule, "FREQ=YEARLY;INTERVAL=1") || @@ -333,7 +340,8 @@ fail: } char * -format_datetime (tzdesc_t timezones, const contentline *node) { +format_datetime (tzdesc_t timezones, const contentline *node) +{ param_list *p; char *dt_timezone = NULL; int dst = 0;