Age | Commit message (Collapse) | Author |
|
|
|
|
|
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.
|
|
Patch from Richard Sharman <rsharman@magmacom.com>.
|
|
|
|
From Andreas Schwab.
|
|
(tDAY_UNIT): Likewise for yyRelDay.
(tHOUR_UNIT): Likewise for yyRelHour.
(tMINUTE_UNIT): Likewise for yyRelMinutes.
(tSEC_UNIT): Likewise for yyRelSeconds.
|
|
|
|
|
|
Indent cpp-directives to reflect nesting.
|
|
* 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.
|
|
|
|
(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.
|
|
Some fit in 31 bits.
|
|
if L >= 1000, otherwise as MM/DD/YY. With this change,
date --date=DATE accepts dates like those in an RCS log listing.
|
|
Suggestion to do as in gdb/c-exp.y from Tom Tromey.
|
|
From Bruno Haible.
|
|
|
|
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).
|
|
|
|
Otherwise years after 1999 are treated as invalid.
From Andreas Schwab.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* [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}.
|
|
|
|
getdate.c (getdate_yyerr, getdate_yylex): Declare these functions static.
|