annotate src/lib/iso8601-date.h @ 22656:1789bf2a1e01

director: Make sure HOST-RESET-USERS isn't used with max_moving_users=0 The reset command would just hang in that case. doveadm would never have sent this, so this is just an extra sanity check.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 05 Nov 2017 23:51:56 +0200
parents 21d67121985a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14586
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
1 #ifndef ISO8601_DATE_H
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
2 #define ISO8601_DATE_H
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
3
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
4 /* Parses ISO8601 (RFC3339) date-time string. timezone_offset is filled with the
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
5 timezone's difference to UTC in minutes. Returned time_t timestamp is
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
6 compensated for time zone. */
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
7 bool iso8601_date_parse(const unsigned char *data, size_t size,
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
8 time_t *timestamp_r, int *timezone_offset_r);
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
9 /* Equal to iso8601_date_parse, but writes uncompensated timestamp to tm_r. */
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
10 bool iso8601_date_parse_tm(const unsigned char *data, size_t size,
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
11 struct tm *tm_r, int *timezone_offset_r);
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
12
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
13 /* Create ISO8601 date-time string from given time struct in specified
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
14 timezone. A zone offset of zero will not to 'Z', but '+00:00'. If
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
15 zone_offset == INT_MAX, the time zone will be 'Z'. */
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
16 const char *iso8601_date_create_tm(struct tm *tm, int zone_offset);
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
17
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
18 /* Create ISO8601 date-time string from given time in local timezone. */
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
19 const char *iso8601_date_create(time_t timestamp);
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
20
21d67121985a Adds ISO8601/RFC3339 date format parsing and construction support.
Stephan Bosch <stephan@rename-it.nl>
parents:
diff changeset
21 #endif