Merge from vendor branch. We are now completely up-to-date with

respect to the ADO timezone code.
This commit is contained in:
Garrett Wollman 1996-07-18 19:59:09 +00:00
parent 712ad5544b
commit 4deb5f7924
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17214
5 changed files with 385 additions and 202 deletions

View File

@ -20,8 +20,7 @@ These options are available:
For each
.I zonename
on the command line,
print the current time,
the time at the lowest possible time value,
print the time at the lowest possible time value,
the time one day after the lowest possible time value,
the times both one second before and exactly at
each detected time discontinuity,
@ -37,4 +36,4 @@ otherwise.
Cut off the verbose output near the start of the given year.
.SH "SEE ALSO"
ctime(3), tzfile(5), zic(8)
.\" @(#)zdump.8 7.2
.\" @(#)zdump.8 7.3

View File

@ -1,6 +1,6 @@
#ifndef lint
#ifndef NOID
static char elsieid[] = "@(#)zdump.c 7.20";
static char elsieid[] = "@(#)zdump.c 7.24";
#endif /* !defined NOID */
#endif /* !defined lint */
@ -68,6 +68,11 @@ static char elsieid[] = "@(#)zdump.c 7.20";
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
#endif /* !defined isleap */
#if HAVE_GETTEXT - 0
#include "locale.h" /* for setlocale */
#include "libintl.h"
#endif /* HAVE_GETTEXT - 0 */
#ifndef GNUC_or_lint
#ifdef lint
#define GNUC_or_lint
@ -88,6 +93,24 @@ static char elsieid[] = "@(#)zdump.c 7.20";
#endif /* !defined GNUC_or_lint */
#endif /* !defined INITIALIZE */
/*
** For the benefit of GNU folk...
** `_(MSGID)' uses the current locale's message library string for MSGID.
** The default is to use gettext if available, and use MSGID otherwise.
*/
#ifndef _
#if HAVE_GETTEXT - 0
#define _(msgid) gettext(msgid)
#else /* !(HAVE_GETTEXT - 0) */
#define _(msgid) msgid
#endif /* !(HAVE_GETTEXT - 0) */
#endif /* !defined _ */
#ifndef TZ_DOMAIN
#define TZ_DOMAIN "tz"
#endif /* !defined TZ_DOMAIN */
extern char ** environ;
extern int getopt();
extern char * optarg;
@ -122,6 +145,13 @@ char * argv[];
struct tm newtm;
INITIALIZE(cuttime);
#if HAVE_GETTEXT - 0
(void) setlocale(LC_MESSAGES, "");
#ifdef TZ_DOMAINDIR
(void) bindtextdomain(TZ_DOMAIN, TZ_DOMAINDIR);
#endif /* defined(TEXTDOMAINDIR) */
(void) textdomain(TZ_DOMAIN);
#endif /* HAVE_GETTEXT - 0 */
progname = argv[0];
vflag = 0;
cutoff = NULL;
@ -132,7 +162,7 @@ char * argv[];
if (c != EOF ||
(optind == argc - 1 && strcmp(argv[optind], "=") == 0)) {
(void) fprintf(stderr,
"%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n",
_("%s: usage is %s [ -v ] [ -c cutoff ] zonename ...\n"),
argv[0], argv[0]);
(void) exit(EXIT_FAILURE);
}
@ -178,9 +208,10 @@ char * argv[];
static char buf[MAX_STRING_LENGTH];
(void) strcpy(&fakeenv[0][3], argv[i]);
show(argv[i], now, FALSE);
if (!vflag)
if (!vflag) {
show(argv[i], now, FALSE);
continue;
}
/*
** Get lowest value of t.
*/
@ -224,9 +255,9 @@ char * argv[];
show(argv[i], t, TRUE);
}
if (fflush(stdout) || ferror(stdout)) {
(void) fprintf(stderr, "%s: Error writing standard output ",
(void) fprintf(stderr, _("%s: Error writing standard output "),
argv[0]);
(void) perror("standard output");
(void) perror(_("standard output"));
(void) exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);

View File

@ -154,17 +154,7 @@ then the rule applies in all years between
.B FROM
and
.B TO
inclusive;
if
.B TYPE
is
.BR uspres ,
the rule applies in U.S. Presidential election years;
if
.B TYPE
is
.BR nonpres ,
the rule applies in years other than U.S. Presidential election years.
inclusive.
If
.B TYPE
is something else, then
@ -219,14 +209,18 @@ Any of these forms may be followed by the letter
.B w
if the given time is local
.q "wall clock"
time or
time,
.B s
if the given time is local
.q standard
time; in the absence of
.B w
time, or
.B u
(or
.B g
or
.BR s ,
.BR z )
if the given time is universal time;
in the absence of an indicator,
wall clock time is assumed.
.TP
.B SAVE
@ -300,6 +294,9 @@ The pair of characters
is used to show where the
.q "variable part"
of the time zone abbreviation goes.
Alternately,
a slash (/)
separates standard and daylight abbreviations.
.TP
.B UNTIL
The time at which the GMT offset or the rule(s) change for a location.
@ -326,14 +323,13 @@ A link line has the form
.sp
.nf
.ti +.5i
.if t .ta \w'Link\0\0'u +\w'LINK-FROM\0\0'u
.if n .ta \w'Link\0\0'u +\w'US/Eastern\0\0'u
.ta \w'Link\0\0'u +\w'Europe/Istanbul\0\0'u
Link LINK-FROM LINK-TO
.sp
For example:
.sp
.ti +.5i
Link US/Eastern EST5EDT
Link Europe/Istanbul Asia/Istanbul
.sp
.fi
The
@ -409,4 +405,4 @@ the earliest transition time recorded in the compiled file is correct.
/usr/share/zoneinfo standard directory used for created files
.SH "SEE ALSO"
ctime(3), tzfile(5), zdump(8)
.\" @(#)zic.8 7.7
.\" @(#)zic.8 7.12

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
# $Id$
# $Id: Makefile,v 1.1 1994/09/13 03:36:16 wollman Exp $
.PATH: ${.CURDIR}/..
@ -9,5 +9,6 @@ MAN8= ${.CURDIR}/../zic.8
CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../../../lib/libc/stdtime
CFLAGS+= -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS
CFLAGS+= -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\" -Demkdir=mkdir
CFLAGS+= -DHAVE_STRERROR -DHAVE_UNISTD_H
.include <bsd.prog.mk>