lib/getdate.y


Log

Author Commit Date CI Message
Jim Meyering edde4560 2001-04-08T19:58:59 that's necessary when the offset spans a DST transition.
Jim Meyering 2880c2d2 2000-06-15T07:57:58 (get_date): Apply relative times after time zone indicator, not before.
Jim Meyering 22e6c88a 2000-02-22T20:16:07 Handle two-digit years with leading zeros correctly. (textint): New typedef. (parser_control): Member year changed from int to textint. All uses changed. (YYSTYPE): Removed; replaced by %union with int and textint members. (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>. (tSNUMBER, tUNUMBER): Now of type <textintval>. (date, number, to_year): Use width of number in digits, not its value, to determine whether it's a 2-digit year, or a 2-digit time. (yylex): Store number of digits of numeric tokens. Reported by John Kendall. (parser_control): Changed from struct parser_control to typedef (for consistency). All uses changed. (tID): Removed; not used. (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
Jim Meyering 79df4125 2000-01-12T06:46:46 Update copyright notice.
Jim Meyering 88397e70 2000-01-06T18:25:03 Sync tm_diff with the GNU C Library. (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN. All uses changed. (tm_diff): Renamed from difftm. All uses changed. Replace body with that taken from GNU C Library 2.1.3pre1. (get_date): Prefer tm_gmtoff to tm_diff if available.
Jim Meyering fd2b0d95 1999-12-22T20:49:19 rewrite expression (equivalently) at request of Paul Eggert
Jim Meyering b4eaa5bb 1999-12-22T11:14:05 (get_date): Fix typo in time_t overflow test. From Michael Stone.
Jim Meyering e38e9590 1999-10-31T15:49:05 update a comment from alpha.gnu.org:/home/gd/gnu/lib/getdate.y
Jim Meyering e5534304 1999-10-04T05:59:37 (__attribute__): Define to empty if GCC claims to be before 2.8; this is needed for OPENStep 4.2 cc. Also, define to empty if strict ANSI.
Jim Meyering 8a62daba 1999-08-29T14:55:24 (relative_time_table): Change `type' of `THIS' from tMINUTE_UNIT to tUNUMBER. From Urs Thuermann.
Jim Meyering 38b658cb 1999-08-29T12:55:35 (get_date): Rename latter local `tm' to probe_tm.
Jim Meyering 00869359 1999-08-29T12:28:56 (get_date): Rename outermost local `probe' to `quarter'.
Jim Meyering c6cb26ec 1999-08-29T07:29:51 Add copyright notice. (number): Handle `Nov 11 1996' example; see Risks Digest 20.55 http://catless.ncl.ac.uk/Risks/20.55.html#subj18 (1999-08-27) (<stdio.h>): Include only if testing. (ISUPPER): Remove. (ISLOWER, PC): New macros. (<string.h>): Include if HAVE_STRING_H, not USG. (bcopy): Remove. (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume bison. (EPOCH_YEAR): Renamed from EPOCH. (table): Renamed from TABLE. (meridian): Now an anonymous enum. (struct parser_control): New type. (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros. (yyInput, ..., yyRelYear): Migrated into struct parser_control. (%pure_parser): Added, so that the parser is pure. (%union): Removed; the type is now just plain int. All %type directives removed. (tLOCAL_ZONE): New %token. (month_day_table): Renamed from MonthDayTable. (gmtime, localtime, mktime, time): Declare only if not defined. (meridian_table): New table. (dst_table): New table. (units_table): renamed from UnitsTable. (relative_time_table): Renamed from OtherTable. (time_zone_table): Renamed from TimezoneTable. Modernized data. (military_table): Renamed from MilitaryTable. (to_hour): Renamed from ToHour. (to_year): Renamed from ToYear. (lookup_zone): New function. (LookupWord): Renamed from lookup_word. Use lookup_zone for time zones. (yylex): Now reentrant. All callers changed. (get_date): Add support for local time zone abbreviations. Make it reentrant.
Jim Meyering 70686f64 1999-08-07T09:50:34 (OtherTable[]): Use tDAY_UNIT for `tomorrow,' `yesterday,' `today,' and `now' rather than tMINUTE_UNIT. Of course with correspondingly smaller numbers for tomorrow and yesterday. This change does not change the way the code works, since the grammar rules for the two symbols are analogous.
Jim Meyering e850d55e 1999-05-20T03:49:25 add the comment to go with last change
Jim Meyering 85a3961e 1999-05-20T03:47:24 (get_date): Let mktime deduce tm_isdst if we have an absolute timestamp, or if the relative timestamp mentions days, months, or years.
Jim Meyering 224dcca3 1999-04-18T23:17:30 <stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free". (LookupWord, yylex): Don't pass negative char to ctype macros.
Jim Meyering 2a2630ca 1999-04-07T17:43:36 (difftm): Protoize.
Jim Meyering dc062ad0 1999-03-28T20:58:51 (get_date): Reuse tm_isdst of first localtime call; this is an improvement on a bug fix suggested by martin@dresden.nacamar.de. Do not assume that localtime and gmtime return non-null. From Paul Eggert.
Jim Meyering f4e36b57 1999-02-19T07:31:48 <alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H. The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
Jim Meyering fdc9c3f1 1998-12-31T14:37:21 Fix warnings from gcc -W -Wall (__attribute__): Define. (ATTRIBUTE_UNUSED): Define. (yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED. (MonthDayTable): Add initializers for last entry. (UnitsTable): Likewise. (OtherTable): Likewise. (MilitaryTable): Likewise.
Jim Meyering a34cff22 1998-03-14T16:31:51 s/get-date.h/getdate.h/
Jim Meyering b24e4cd5 1998-02-20T21:42:11 s/getdate.h/get-date.h/
Jim Meyering 6509445b 1998-01-06T23:53:33 Add %expect directive. Move inclusion of getdate.h and dependent extern declarations down so getdate.h's prototype follows the sometimes-enabled definition of `const' to nothing. Otherwise, the prototype wouldn't match the definition because of the defined-away `const'. (get_date): ANSI-fy definition. From Kaveh Ghazi.
Jim Meyering 98cf1a06 1997-06-01T17:15:51 (OtherTable): Interpret `next' as 1 (not 2) units. Patch from Richard Sharman <rsharman@magmacom.com>.
Jim Meyering a8c629e2 1997-04-10T03:46:01 s/;/. in comment to placate francois
Jim Meyering 54d6b079 1997-02-27T05:53:15 (tYEAR_UNIT): Increase yyRelYear by $1, not just by 1. From Andreas Schwab.
Jim Meyering 2c1196cc 1997-02-22T20:13:19 (tMONTH_UNIT): Increase yyRelMonth by $1, not just by 1. (tDAY_UNIT): Likewise for yyRelDay. (tHOUR_UNIT): Likewise for yyRelHour. (tMINUTE_UNIT): Likewise for yyRelMinutes. (tSEC_UNIT): Likewise for yyRelSeconds.
Jim Meyering 07b2c332 1997-01-18T20:17:39 Indent with GNU indent.
Jim Meyering 09426796 1997-01-18T20:12:10 Indent 2 more cpp-directives to reflect nesting.
Jim Meyering 764d26f0 1997-01-18T20:11:05 (get_date): Change prototype to reflect const'ness of parameters. Indent cpp-directives to reflect nesting.
Jim Meyering d1f0e0d4 1997-01-18T15:32:16 1997-01-06 Paul Eggert <eggert@twinsun.com> * getdate.y: Rewrite to use mktime. <sys/timeb.h>: Don't include. (mktime): Declare. (struct timeb, timezone, DOOMSDAY, SECSPERDAY, DSTMODE, yyDSTmode, ToSeconds, Convert, DSTcorrect, RelativeDate, RelativeMonth): Remove. (ToHour): New function (part of the old ToSeconds fn). (ToYear): New function (part of the old Convert fn). (TABLE.value, yyDayOrdinal, yyDayNumber, yyTimezone, yyDay, yyHour, yyMinutes, yyMonth, yySeconds, yyYear, yyRelMonth, yyRelSeconds, Number): Now int instead of time_t. (HOUR): Don't cast to time_t. (tDAY_UNIT, tHOUR_UNIT, tYEAR_UNIT): New %tokens. (UnitsTable): Use new units that are closer to the keywords. (yyRelDay, yyRelHour, yyRelMinutes, yyRelYear): New variables. (rel, relunit, get_date): Add support for them. (time): Fix timezone calculations for negative half-hour offsets when integer division truncates towards minus infinity. (zone): Incorporiate DST calculation directly. (get_date): 2nd arg is now time_t *, not struct timeb *. Use mktime to do most of the work, instead of computing it ourselves. Guard against falsely reporting errors near the time_t boundaries when parsing times in other time zones.
Jim Meyering d13a8bfc 1996-12-18T03:28:09 add blank line.
Jim Meyering 870ce697 1996-12-13T03:05:00 (IN_CTYPE_DOMAIN): Rename from ISASCII. (ISDIGIT): New definition from Paul Eggert. This one evaluates its argument exactly once. (yylex): Move increment out of ISALPHA argument. Use a comma-expression instead.
Jim Meyering 9f9db322 1996-12-10T04:34:18 (Convert): Don't reject all dates in 2038. Some fit in 31 bits.
Jim Meyering 809464b3 1996-12-01T19:15:03 (date): Interpret the date, L/M/N, as YYYY/MM/DD if L >= 1000, otherwise as MM/DD/YY. With this change, date --date=DATE accepts dates like those in an RCS log listing.
Jim Meyering fa854d42 1996-11-01T00:32:12 Remap yacc globals to have gd_ prefix. Suggestion to do as in gdb/c-exp.y from Tom Tromey.
Jim Meyering 5546ba7c 1996-09-07T17:42:58 Define and use upper case variants of ctype.h IS* macros. From Bruno Haible.
Jim Meyering 9d4f95f6 1996-03-10T05:00:20 Merge changes from FSF.
Jim Meyering e131b14f 1996-03-06T04:57:01 (RelativeMonth): Add 1900 to the year so that relative date specs that push the year through the end of the century work. For example, `date -d "01/01/1998 3 years" +%Y' now prints 2001. From Peter Dalgaard (pd@kubism.ku.dk).
Jim Meyering b6c390fc 1995-08-07T16:07:28 Add FIXME comments.
Jim Meyering c9f48301 1995-06-07T18:10:17 (Convert): Use 2037 as threshold, not 1999. Otherwise years after 1999 are treated as invalid. From Andreas Schwab.
Jim Meyering a5ebad6e 1995-01-27T15:01:25 .
Jim Meyering cd063a22 1995-01-27T15:00:54 .
Jim Meyering cad3ddc5 1995-01-27T05:36:14 Remove/rewrite some comments.
Jim Meyering fd6a9293 1995-01-27T05:22:23 .
Jim Meyering 73448497 1994-10-08T00:41:11 merge with 1.10q
Jim Meyering 8f16c54c 1994-09-27T20:52:18 merge with 1.10n1
Jim Meyering 1be7ab66 1994-09-25T01:25:18 .
Jim Meyering 70317255 1994-09-24T19:12:57 merge with 1.10m
Jim Meyering a96a4ca1 1994-09-17T02:47:05 merge with 1.10j
Jim Meyering e69ce0b9 1994-09-08T04:48:47 merge with 1.10i
Jim Meyering 44e6e017 1994-09-01T23:20:39 merge with 1.10h
Jim Meyering c0b7d211 1994-04-25T18:34:37 merge with 1.9.4g
Jim Meyering 8d2f9f58 1994-04-25T16:34:49 merge with 1.9.4f
Jim Meyering cac485b4 1994-04-24T12:48:45 Revert 1.14-1.16 changes that removed difftm and modified get_date.
Jim Meyering 21d35002 1994-04-19T13:40:49 merge with 1.9.4e
Jim Meyering b4e2cc12 1994-04-19T02:30:46 .
Jim Meyering 3fb00e68 1994-02-10T19:14:34 merge with 1.9.2g
Jim Meyering 33ca528b 1993-12-23T00:38:42 merge with 1.9.2a
Jim Meyering 23dd0807 1993-12-23T00:08:30 .
Jim Meyering fb2a33bb 1993-11-10T06:05:05 merge with 1.9
Jim Meyering 2e296bb5 1993-11-09T13:21:36 merge with 1.9
Jim Meyering 8cb2dc32 1993-10-12T02:42:06 merge with 1.8.1c
Jim Meyering e174422e 1993-10-12T01:52:28 merge with 1.8.1b
Jim Meyering 46d11fcd 1993-10-04T21:22:19 .
Jim Meyering cd47583b 1993-10-04T21:20:39 merge with 1.8.1a
Jim Meyering 65eb9052 1993-09-08T18:23:16 merge with 1.8.1 + partial --version and --help
Jim Meyering f4654147 1993-04-04T16:36:44 * [sgi]: Undefine timezone before including <time.h>. * [time.h vs sys/time.h]: Fix boolean algebra typo from Mar 31 consolidation. * Move static dcls of yyerror and yylex to a point following the definition of those symbols to getdate_{yyerror,yylex}.
Jim Meyering 5bcef80b 1993-04-04T15:22:00 update from fsf
Jim Meyering 29e59276 1992-11-12T04:13:46 Make tables static and const when possible. getdate.c (getdate_yyerr, getdate_yylex): Declare these functions static.
Jim Meyering 43e78b97 1992-11-01T05:44:30 Initial revision