summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2016-08-14 21:29:50 -0400
committerPádraig Brady <P@draigBrady.com>2016-08-19 21:43:13 +0100
commit5d36768ce2b907af7861d9eb87ae0fc89330def1 (patch)
tree347e490790738218981be695645be50b93aca12b /modules
parent6e2966216e4e0605508c5f5abd27c8dc44ff6b73 (diff)
downloadgnulib-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')
-rw-r--r--modules/parse-datetime1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/parse-datetime b/modules/parse-datetime
index 72b41dd7ad..dc25bec934 100644
--- a/modules/parse-datetime
+++ b/modules/parse-datetime
@@ -17,6 +17,7 @@ gettext-h
intprops
mktime
setenv
+strftime
unsetenv
time
timegm