lib/parse-datetime.h


Log

Author Commit Date CI Message
Paul Eggert 4e6e16b3 2017-01-20T17:11:55 parse-datetime: handle timezones reentrantly This API change was prompted by a report by Pádraig Brady in: https://bug.debian.org/851934#10 To help fix the bug, make parse_datetime2 more reentrant. * NEWS: Document this incompatible change. * lib/parse-datetime.h, lib/parse-datetime.y (parse_datetime2): Add two arguments, the timezone and the timezone name. All callers changed. If TZ="..." is specified, use it for calculating defaults. * lib/parse-datetime.y: Don't include xalloc.h or use xmalloc, as this code should be usable in a library. (mktime_ok, get_effective_timezone): Accept timezone arg too. All callers changed. (get_tz): Remove. (get_effective_timezone): Check for failures. * modules/parse-datetime: Add time_r, time_rz. Remove xalloc.
Paul Eggert e89646ad 2017-01-09T11:55:22 maint: time stamp -> timestamp Use the spelling "timestamp", as that is what POSIX uses.
Paul Eggert a3fd683d 2017-01-01T02:59:23 version-etc: new year * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
Assaf Gordon 5d36768c 2016-08-14T21:29:50 parse-datetime: improve debug implementation Follow-up to commit 12ad79069 ("add optional debug printing"). Improve parse-datetime's debug implementation: remove macros, replace global debug flag variable with a function parameter, use nstrftime for formatting. See: https://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00021.html * lib/parse-datetime.h: (parse_datetime_debug): Remove global extern declaration. (parse_datetime2): New function, accepts 'flags' parameter, supporting debug flag. Existing interface 'parse_datetime' left unmodified. * lib/parse-datetime.c: (parse_datetime_debug): Remove global variable. (struct parser_control): add 'parse_datetime_debug' member variable. (parse_datetime): Call new function 'parse_datetime2' without debug. (parse_datetime2): Adapted from previous 'parse_datetime', initialize pc.parse_datetime_debug variable as needed. (to_year): Accept new flags parameter, instead of using global variable. (debug_print_current_time,debug_print_relative_time,debug_mktime_not_ok): use struct 'debug' variable instead of global variable. (DEBUG,DEBUG_PRINT_CURRENT_TIME,DEBUG_PRINT_RELATIVE_TIME, DEBUG_MKTIME_NOT_OK,PROGRESS,PROGRESS0): Remove macros. Call correspnding functions directly instead of using macros. * modules/parse-datetime: Add gnulib's strftime module.
Assaf Gordon 12ad7906 2016-08-06T20:08:32 parse-datetime: add optional debug printing Print parsing information, warnings, and errors to stderr. * lib/parse-datetime.h (parse_datetimte_debug): New global variable. * lib/parse-datetime.y: (DEBUG_*): Macros calling debug functions if debugging is enabled. (PROGRESS*): Same as DEBUG, for progress reporting. (dbg_printf): Print message to stderr, with 'date' prefix. (struct parser_control): Add 'debug_*_seen' variables. (str_days): Converts day ordinal/number to string (e.g. 'last wed'). (debug_print_current_time, debug_print_relateive_time): Prints the current/relative date/time value of parser_control. (YACC parser syntax): Print parsed parts with DEBUG_* macros. (to_year): Warn about 2-digit year parsing. (yylex): Warn about unrecognized words. (get_effective_timezone): Returns current timezone in minutes. (debug_strf{time,date,datetime}): Convert 'struct tm' to string as clearly and unambigiously as possible. (debug_mktime_not_ok): Print detailed information about failed date/time values. (parse_datetime): Add DEBUG messages for failures, warnings. Add PROGRESS messages for status messages. * modules/parse-datetime: Add 'timegm', 'gettext-h' dependencies.
Paul Eggert 71090a2a 2016-01-01T00:56:19 version-etc: new year * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
Paul Eggert b9bfe784 2015-01-01T01:38:23 version-etc: new year * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
Eric Blake 1276a2c5 2014-01-01T00:04:40 maint: update copyright I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
Eric Blake 9fc81090 2013-01-01T00:50:58 maint: update all copyright year number ranges Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
Jim Meyering 1602f0af 2012-01-01T10:04:58 maint: update all copyright year number ranges Run "make update-copyright".
Jim Meyering d60f3b0c 2011-01-01T20:17:23 maint: update almost all copyright ranges to include 2011 Run the new "make update-copyright" rule.
Eric Blake 2bb63bfb 2010-10-05T11:40:11 parse-datetime: better name than get_date * NEWS: Reword the deprecation notice. * modules/get_date: Rename to modules/parse-datetime. * modules/get_date-tests: Rename to modules/parse-datetime-tests. * m4/get_date.m4: Rename to m4/parse-datetime.m4. * lib/get_date.y: Rename to lib/parse-datetime.y. * tests/test-get_date.c: Rename to tests/test-parse-datetime.c. * doc/get_date.texi: Rename to doc/parse-datetime.texi. * doc/getdate.texi: Provide fallback wrapper. * lib/getdate.h: Move guts, and wrap... * lib/parse-datetime.h: ...new file. * lib/parse-datetime.y (get_date): Rename... (parse_datetime): ...to this. * m4/parse-datetime.m4 (gl_GET_DATE): Rename... (gl_PARSE_DATETIME): ...to this. * doc/posix-functions/getdate.texi (get_date): Provide fallback documentation. * modules/getdate (Files): Provide fallback docs and header. (Notice, Depends-on): Update references. * tests/test-parse-datetime.c: Likewise. * DEPENDENCIES: Likewise. * MODULES.html.sh (Date and time <time.h>): Likewise. * doc/parse-datetime.texi (Date input formats) (Authors of parse_datetime): Likewise. * modules/parse-datetime (Files, configure.ac, Makefile.am) (Include): Likewise. * modules/parse-datetime-tests (Files, Makefile.am): Likewise. * gnulib-tool: Likewise. * m4/bison.m4 (gl_BISON): Likewise. Suggested by Bruno Haible. Signed-off-by: Eric Blake <eblake@redhat.com>