diff options
author | Assaf Gordon <assafgordon@gmail.com> | 2016-08-14 21:29:50 -0400 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2016-08-19 21:43:13 +0100 |
commit | 5d36768ce2b907af7861d9eb87ae0fc89330def1 (patch) | |
tree | 347e490790738218981be695645be50b93aca12b /modules/safe-alloc-tests | |
parent | 6e2966216e4e0605508c5f5abd27c8dc44ff6b73 (diff) | |
download | gnulib-5d36768ce2b907af7861d9eb87ae0fc89330def1.tar.gz |
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.
Diffstat (limited to 'modules/safe-alloc-tests')
0 files changed, 0 insertions, 0 deletions