Jim Meyering [Sat, 18 Jan 1997 15:32:16 +0000 (15:32 +0000)]
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 [Sat, 28 Dec 1996 02:59:25 +0000 (02:59 +0000)]
Rewrite the test so that systems lacking
getgroups don't try to use the supplied replacement function --
that depends on the existence of such a function.
Jim Meyering [Wed, 18 Dec 1996 03:30:20 +0000 (03:30 +0000)]
(ISDIGIT): Replace with smaller, faster edition
that yields nonzero only on ASCII digits.
(ISDIGIT_LOCALE): New macro, with same meaning that ISDIGIT
used to have. From Paul Eggert.
Jim Meyering [Fri, 13 Dec 1996 03:05:00 +0000 (03:05 +0000)]
(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 [Sun, 1 Dec 1996 19:15:03 +0000 (19:15 +0000)]
(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 [Tue, 5 Nov 1996 04:38:41 +0000 (04:38 +0000)]
Thu Oct 31 19:32:32 1996 Miles Bader <miles@gnu.ai.mit.edu>
[ENAMETOOLONG] (xgethostname): If gethostname
returns an error other than buffer overflow, exit with an error
message instead of allocating infinite amounts of space.
[!EXIT_FAILURE] (EXIT_FAILURE): New macro.
<errno.h>: New include.
[!errno] (errno): New declaration.
Jim Meyering [Sun, 3 Nov 1996 20:59:43 +0000 (20:59 +0000)]
Include sys/types.h for the definitions
(otherwise missing on some systems) of caddr_t (used by
sys/socket.h) and ushort (used by netinet/in.h). From Karl Heuer.