summaryrefslogtreecommitdiff
path: root/lib/parse-datetime.h
Commit message (Collapse)AuthorAgeFilesLines
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* parse-datetime: Use 'restrict'.Bruno Haible2020-02-231-2/+4
| | | | | | * lib/parse-datetime.h (parse_datetime, parse_datetime2): Use 'restrict'. * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Require AC_C_RESTRICT.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* parse-datetime: handle timezones reentrantlyPaul Eggert2017-01-201-1/+1
| | | | | | | | | | | | | | | | | | 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.
* maint: time stamp -> timestampPaul Eggert2017-01-091-1/+1
| | | | Use the spelling "timestamp", as that is what POSIX uses.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * 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'.
* parse-datetime: improve debug implementationAssaf Gordon2016-08-191-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* parse-datetime: add optional debug printingAssaf Gordon2016-08-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * 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'.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* parse-datetime: better name than get_dateEric Blake2010-10-051-0/+22
* 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>