mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-08-16 01:22:18 +03:00
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.
25 lines
946 B
C
25 lines
946 B
C
/* Parse a string into an internal time stamp.
|
|
|
|
Copyright (C) 1995, 1997-1998, 2003-2004, 2007, 2009-2016 Free Software
|
|
Foundation, Inc.
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#include <stdbool.h>
|
|
#include <time.h>
|
|
|
|
extern bool parse_datetime_debug;
|
|
|
|
bool parse_datetime (struct timespec *, char const *, struct timespec const *);
|