X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/f7416f95b570d8df280de899771db0f9f5f1b34e..39a9d9d85d0f2289d8c1257251311b7cf959c700:/sbr/datetime.c diff --git a/sbr/datetime.c b/sbr/datetime.c index 4fb7bac0..03a58abd 100644 --- a/sbr/datetime.c +++ b/sbr/datetime.c @@ -75,7 +75,7 @@ parse_datetime (const char *datetime, const char *zone, int dst, if (items_matched == 7) { /* The 'Z' must be capital according to RFC 5545 Sec. 3.3.5. */ if (utc_indicator != 'Z') { - advise (NULL, "%s has invalid timezone indicator of 0x%x", + inform("%s has invalid timezone indicator of 0x%x", datetime, utc_indicator); return NOTOK; } @@ -143,9 +143,9 @@ parse_datetime (const char *datetime, const char *zone, int dst, } return OK; - } else { - return NOTOK; } + + return NOTOK; } tzdesc_t @@ -177,7 +177,7 @@ load_timezones (const contentline *clines) { params->start_dt = tws.tw_clock; } } else { - advise (NULL, "failed to parse start time %s for %s", + inform("failed to parse start time %s for %s", params->dtstart, in_standard ? "standard" : "daylight"); return NULL; @@ -217,7 +217,7 @@ load_timezones (const contentline *clines) { ! strcasecmp ("VTIMEZONE", node->value)) { in_vtimezone = 1; - timezone = mh_xcalloc (1, sizeof (struct tzdesc)); + NEW0(timezone); if (timezones) { tzdesc_t t; @@ -321,9 +321,8 @@ rrule_clock (const char *rrule, const char *starttime, const char *zone, fail: if (clock == 0) { - admonish (NULL, - "Unsupported RRULE format: %s, assume local timezone", - rrule); + inform("Unsupported RRULE format: %s, assume local timezone, continuing...", + rrule); } return clock; @@ -359,10 +358,9 @@ format_datetime (tzdesc_t timezones, const contentline *node) { Form #2: DATE WITH UTC TIME */ if (parse_datetime (node->value, NULL, 0, &tws[0]) == OK) { return strdup (dasctime (&tws[0], 0)); - } else { - advise (NULL, "unable to parse datetime %s", node->value); - return NULL; } + inform("unable to parse datetime %s", node->value); + return NULL; } /* @@ -383,7 +381,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { if (tz) { free(dt_timezone); } else { - advise (NULL, "did not find VTIMEZONE section for %s", dt_timezone); + inform("did not find VTIMEZONE section for %s", dt_timezone); free(dt_timezone); return NULL; } @@ -425,7 +423,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { } if (transition[0] < transition[1]) { - advise (NULL, "format_datetime() requires that daylight " + inform("format_datetime() requires that daylight " "saving time transition precede standard time " "transition"); return NULL; @@ -435,7 +433,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { 0, &tws[0]) == OK) { dt[0] = tws[0].tw_clock; } else { - advise (NULL, "unable to parse datetime %s", node->value); + inform("unable to parse datetime %s", node->value); return NULL; } @@ -448,7 +446,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { &tws[1]) == OK) { dt[1] = tws[1].tw_clock; } else { - advise (NULL, "unable to parse datetime %s", + inform("unable to parse datetime %s", node->value); return NULL; } @@ -460,7 +458,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { if (dst) { if (tz->daylight_params.start_dt > 0 && dt[dst] < tz->daylight_params.start_dt) { - advise (NULL, "date-time of %s is before VTIMEZONE start " + inform("date-time of %s is before VTIMEZONE start " "of %s", node->value, tz->daylight_params.dtstart); return NULL; @@ -468,7 +466,7 @@ format_datetime (tzdesc_t timezones, const contentline *node) { } else { if (tz->standard_params.start_dt > 0 && dt[dst] < tz->standard_params.start_dt) { - advise (NULL, "date-time of %s is before VTIMEZONE start " + inform("date-time of %s is before VTIMEZONE start " "of %s", node->value, tz->standard_params.dtstart); return NULL; @@ -476,12 +474,12 @@ format_datetime (tzdesc_t timezones, const contentline *node) { } } else { if (! tp_std) { - advise (NULL, "unsupported date-time format: %s", + inform("unsupported date-time format: %s", tz->standard_params.dtstart); return NULL; } if (! tp_dt) { - advise (NULL, "unsupported date-time format: %s", node->value); + inform("unsupported date-time format: %s", node->value); return NULL; } }