Wed Mar 8 13:38:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>

* posix/glob/configure.bat: Fixes from DJ.

	* time/backward, time/europe, time/northamerica, time/pacificnew,
	time/zdump.c, time/zic.c, time/tzfile.h, time/private.h,
	time/ialloc.c: Code and data updated from ADO's 95b.
	* time/emkdir.c: File removed.
	* time/Makefile (distribute, extra-objs, zic): Omit it.
	
	* time/localtime.c: Deansideclized.  Never #define __tzname et al
 	to non-__ names.

	* locale/lc-ctype.c (__ctype_tolower, __ctype_toupper): Use int *
 	instead of short int *.
	* ctype/ctype-info.c: Likewise.
	* ctype/ctype.h: Likewise.

	* locale/langinfo.h (_NL_CTYPE_CLASS): Use this (just one) instead
 	of EB and EL versions.
This commit is contained in:
Roland McGrath 1995-03-09 10:00:12 +00:00
parent 2863511535
commit 6c2f050742
19 changed files with 418 additions and 458 deletions

View File

@ -1,3 +1,24 @@
Wed Mar 8 13:38:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* posix/glob/configure.bat: Fixes from DJ.
* time/backward, time/europe, time/northamerica, time/pacificnew,
time/zdump.c, time/zic.c, time/tzfile.h, time/private.h,
time/ialloc.c: Code and data updated from ADO's 95b.
* time/emkdir.c: File removed.
* time/Makefile (distribute, extra-objs, zic): Omit it.
* time/localtime.c: Deansideclized. Never #define __tzname et al
to non-__ names.
* locale/lc-ctype.c (__ctype_tolower, __ctype_toupper): Use int *
instead of short int *.
* ctype/ctype-info.c: Likewise.
* ctype/ctype.h: Likewise.
* locale/langinfo.h (_NL_CTYPE_CLASS): Use this (just one) instead
of EB and EL versions.
Mon Mar 6 12:34:56 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> Mon Mar 6 12:34:56 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* ctype/ctype.h (_ISbit): New macro, defined dependent on byte order. * ctype/ctype.h (_ISbit): New macro, defined dependent on byte order.

View File

@ -24,8 +24,8 @@ extern const char _nl_C_LC_CTYPE_class[];
extern const char _nl_C_LC_CTYPE_toupper[]; extern const char _nl_C_LC_CTYPE_toupper[];
extern const char _nl_C_LC_CTYPE_tolower[]; extern const char _nl_C_LC_CTYPE_tolower[];
#define b(u,x) (((u short int *) _nl_C_LC_CTYPE_##x) + 128); #define b(u,x) (((u int *) _nl_C_LC_CTYPE_##x) + 128);
const unsigned short int *__ctype_b = b(unsigned, class); const unsigned short int *__ctype_b = b(unsigned short, class);
const short int *__ctype_tolower = b(, tolower); const int *__ctype_tolower = b(, tolower);
const short int *__ctype_toupper = b(, toupper); const int *__ctype_toupper = b(, toupper);

View File

@ -68,12 +68,12 @@ enum
char' value [0,255]; by EOF (-1); or by any `signed char' value char' value [0,255]; by EOF (-1); or by any `signed char' value
[-128,-1). ANSI requires that the ctype functions work for `unsigned [-128,-1). ANSI requires that the ctype functions work for `unsigned
char' values and for EOF; we also support negative `signed char' values char' values and for EOF; we also support negative `signed char' values
for broken old programs. The case conversion arrays are of `short int's for broken old programs. The case conversion arrays are of `int's
rather than `unsigned char's because tolower (EOF) must be EOF, which rather than `unsigned char's because tolower (EOF) must be EOF, which
doesn't fit into an `unsigned char'. */ doesn't fit into an `unsigned char'. */
extern __const unsigned short int *__ctype_b; /* Characteristics. */ extern __const unsigned short int *__ctype_b; /* Characteristics. */
extern __const short int *__ctype_tolower; /* Case conversions. */ extern __const int *__ctype_tolower; /* Case conversions. */
extern __const short int *__ctype_toupper; /* Case conversions. */ extern __const int *__ctype_toupper; /* Case conversions. */
#define __isctype(c, type) \ #define __isctype(c, type) \
(__ctype_b[(int) (c)] & (unsigned short int) type) (__ctype_b[(int) (c)] & (unsigned short int) type)

View File

@ -96,18 +96,17 @@ typedef enum
ERA, /* Alternate era. */ ERA, /* Alternate era. */
ERA_YEAR, /* Year in alternate era format. */ ERA_YEAR, /* Year in alternate era format. */
ERA_D_FMT, /* Date in alternate ear format. */ ERA_D_FMT, /* Date in alternate era format. */
ALT_DIGITS, /* Alternate symbols for digits. */ ALT_DIGITS, /* Alternate symbols for digits. */
_NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */ _NL_NUM_LC_TIME, /* Number of indices in LC_TIME category. */
/* LC_CTYPE category: character classification. /* LC_CTYPE category: character classification.
This information is accessed by the functions in <ctype.h>. This information is accessed by the functions in <ctype.h>.
These `nl_langinfo' names are used internally. */ These `nl_langinfo' names are used only internally. */
_NL_CTYPE_CLASS_EB = _NL_ITEM (LC_CTYPE, 0), _NL_CTYPE_CLASS = _NL_ITEM (LC_CTYPE, 0),
_NL_CTYPE_TOUPPER_EB, _NL_CTYPE_TOUPPER_EB,
_NL_CTYPE_TOLOWER_EB, _NL_CTYPE_TOLOWER_EB,
_NL_CTYPE_CLASS_EL,
_NL_CTYPE_TOUPPER_EL, _NL_CTYPE_TOUPPER_EL,
_NL_CTYPE_TOLOWER_EL, _NL_CTYPE_TOLOWER_EL,
_NL_NUM_LC_CTYPE, _NL_NUM_LC_CTYPE,

View File

@ -40,12 +40,13 @@ _nl_postload_ctype (void)
#else #else
#error bizarre byte order #error bizarre byte order
#endif #endif
#define eval(x) x
#define current(unsigned,x) \ #define current(unsigned,x) \
((const unsigned short int *) _NL_CURRENT (LC_CTYPE, bo(_NL_CTYPE_##x)) \ ((const unsigned int *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_##eval(x)) \
+ 128) + 128)
__ctype_b = current (unsigned, CLASS); __ctype_b = current (unsigned short, CLASS);
__ctype_toupper = current (, TOUPPER); __ctype_toupper = current (, bo (TOUPPER));
__ctype_tolower = current (, TOLOWER); __ctype_tolower = current (, bo (TOLOWER));
} }

View File

@ -7,10 +7,13 @@ echo # Makefile generated by "configure.bat"> Makefile
if exist config.sed del config.sed if exist config.sed del config.sed
echo "s/@srcdir@/./ ">> config.sed echo "s/@srcdir@/./ ">> config.sed
echo "s/@CC@/gcc/ ">> config.sed
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H -I../ ">> config.sed
echo "s/@AR@/ar/ ">> config.sed
echo "s/@RANLIB@/ranlib/ ">> config.sed echo "s/@RANLIB@/ranlib/ ">> config.sed
echo "s/@LDFLAGS@// ">> config.sed echo "s/@LDFLAGS@// ">> config.sed
echo "s/@DEFS@/-DHAVE_CONFIG_H -I../ ">> config.sed echo "s/@DEFS@// ">> config.sed
echo "s/@REMOTE@/s/ ">> config.sed
echo "s/@ALLOCA@// ">> config.sed echo "s/@ALLOCA@// ">> config.sed
echo "s/@LIBS@// ">> config.sed echo "s/@LIBS@// ">> config.sed
echo "s/@LIBOBJS@// ">> config.sed echo "s/@LIBOBJS@// ">> config.sed

View File

@ -284,7 +284,7 @@ strsignal (signal)
static char buf[] = "Signal 12345678901234567890"; static char buf[] = "Signal 12345678901234567890";
if (signal > 0 || signal < NSIG) if (signal > 0 || signal < NSIG)
return sys_siglist[signal]; return (char *) sys_siglist[signal];
sprintf (buf, "Signal %d", signal); sprintf (buf, "Signal %d", signal);
return buf; return buf;

View File

@ -22,8 +22,8 @@
subdir := time subdir := time
headers := time.h sys/time.h sys/timeb.h headers := time.h sys/time.h sys/timeb.h
distribute := tzfile.h private.h scheck.c ialloc.c emkdir.c yearistype distribute := tzfile.h private.h scheck.c ialloc.c yearistype
extra-objs = scheck.o ialloc.o emkdir.o zonenames $(tzfiles:%=z.%) extra-objs = scheck.o ialloc.o zonenames $(tzfiles:%=z.%)
routines := offtime asctime clock ctime difftime gmtime \ routines := offtime asctime clock ctime difftime gmtime \
localtime mktime strftime time tzset tzfile \ localtime mktime strftime time tzset tzfile \
@ -113,7 +113,7 @@ $(installed-posixrules-file): $(zonedir)/$(posixrules) $(objpfx)zic
endif endif
$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o $(objpfx)emkdir.o $(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
$(objpfx)tzfile.o: tzfile.c; $(tz-cc) $(objpfx)tzfile.o: tzfile.c; $(tz-cc)
$(objpfx)zic.o: zic.c; $(tz-cc) $(objpfx)zic.o: zic.c; $(tz-cc)

View File

@ -1,9 +1,9 @@
# @(#)backward 7.6 # @(#)backward 7.8
# This file provides links between late-1993-vintage names for time zones # This file provides links between current names for time zones
# and their previous names. # and their old names. Many names changed in late 1993.
Link Australia/Sydney Australia/ACT Link Australia/Canberra Australia/ACT
Link Australia/Lord_Howe Australia/LHI Link Australia/Lord_Howe Australia/LHI
Link Australia/Sydney Australia/NSW Link Australia/Sydney Australia/NSW
Link Australia/Darwin Australia/North Link Australia/Darwin Australia/North
@ -48,6 +48,7 @@ Link Africa/Tripoli Libya
Link America/Tijuana Mexico/BajaNorte Link America/Tijuana Mexico/BajaNorte
Link America/Mazatlan Mexico/BajaSur Link America/Mazatlan Mexico/BajaSur
Link America/Mexico_City Mexico/General Link America/Mexico_City Mexico/General
Link America/Shiprock Navajo
Link Pacific/Auckland NZ Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT Link Pacific/Chatham NZ-CHAT
Link Asia/Shanghai PRC Link Asia/Shanghai PRC

View File

@ -1,85 +0,0 @@
#ifndef lint
#ifndef NOID
static char elsieid[] = "@(#)emkdir.c 8.23";
#endif /* !defined NOID */
#endif /* !defined lint */
#ifndef emkdir
/*LINTLIBRARY*/
#include "private.h"
extern char * imalloc P((int n));
extern void ifree P((char * p));
static char *
quoted(name)
register const char * name;
{
register char * result;
register char * cp;
register int c;
if (name == NULL)
name = "";
result = imalloc((int) (4 * strlen(name) + 3));
if (result == NULL)
return NULL;
cp = result;
#ifdef unix
*cp++ = '\'';
while ((c = *name++) != '\0')
if (c == '\'') {
*cp++ = c;
*cp++ = '\\';
*cp++ = c;
*cp++ = c;
} else *cp++ = c;
*cp++ = '\'';
#endif /* defined unix */
#ifndef unix
while ((c = *name++) != '\0')
if (c == '/')
*cp++ = '\\';
else *cp++ = c;
#endif /* !defined unix */
*cp = '\0';
return result;
}
int
emkdir(name, mode)
const char * name;
const int mode;
{
register int result;
register const char * format;
register char * command;
register char * qname;
if ((qname = quoted(name)) == NULL)
return -1;
#ifdef unix
format = "mkdir 2>&- %s && chmod 2>&- %o %s";
#endif /* defined unix */
#ifndef unix
format = "mkdir %s";
#endif /* !defined unix */
command = imalloc((int) (strlen(format) + 2 * strlen(qname) + 20 + 1));
if (command == NULL) {
ifree(qname);
return -1;
}
(void) sprintf(command, format, qname, mode, qname);
ifree(qname);
result = system(command);
ifree(command);
return (result == 0) ? 0 : -1;
}
/*
** UNIX was a registered trademark of UNIX System Laboratories in 1993.
*/
#endif /* !defined emkdir */

View File

@ -714,27 +714,25 @@ Rule GB-Eire 1961 1967 - Oct Sun>=23 2:00s 0 GMT
Rule GB-Eire 1971 only - Oct 31 3:00 0 GMT Rule GB-Eire 1971 only - Oct 31 3:00 0 GMT
Rule GB-Eire 1972 1980 - Oct Sun>=23 2:00s 0 GMT Rule GB-Eire 1972 1980 - Oct Sun>=23 2:00s 0 GMT
# 1981 on # 1981 on
Rule GB-Eire 1981 max - Mar lastSun 1:00s 1:00 BST Rule GB-Eire 1981 max - Mar lastSun 1:00u 1:00 BST
Rule GB-Eire 1981 1989 - Oct Sun>=23 1:00s 0 GMT Rule GB-Eire 1981 1989 - Oct Sun>=23 1:00u 0 GMT
Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00s 0 GMT Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00u 0 GMT
Rule GB-Eire 1996 max - Oct lastSun 1:00s 0 GMT Rule GB-Eire 1996 max - Oct lastSun 1:00u 0 GMT
#Rule GB-Eire 1981 max - Mar lastSun 1:00u 1:00 BST # Also see EC, which (starting 1996) differs only in LETTER/S.
#Rule GB-Eire 1981 1989 - Oct Sun>=23 1:00u 0 GMT
#Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00u 0 GMT
#Rule GB-Eire 1996 max - Oct lastSun 1:00u 0 GMT
# Also see W-Eur, which (starting 1996) differs only in LETTER/S.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/London -0:01:15 - LMT 1847 Sep 22 Zone Europe/London -0:01:15 - LMT 1847 Sep 22
0:00 GB-Eire %s 1968 Feb 18 2:00 0:00 GB-Eire %s 1968 Feb 18 2:00
1:00 - BST 1971 Oct 31 2:00 1:00 - BST 1971 Oct 31 2:00
0:00 GB-Eire %s 0:00 GB-Eire %s 1996
0:00 EC GMT/BST
Zone Europe/Belfast -0:23:40 - LMT 1880 Aug 2 Zone Europe/Belfast -0:23:40 - LMT 1880 Aug 2
-0:25:21 - DMT 1916 May 21 2:00 # Dublin MT -0:25:21 - DMT 1916 May 21 2:00 # Dublin MT
-0:25:21 1:00 DST 1916 Oct 1 3:00 -0:25:21 1:00 DST 1916 Oct 1 3:00
0:00 GB-Eire %s 1968 Feb 18 2:00 0:00 GB-Eire %s 1968 Feb 18 2:00
1:00 - BST 1971 Oct 31 3:00 1:00 - BST 1971 Oct 31 3:00
0:00 GB-Eire %s 0:00 GB-Eire %s 1996
0:00 EC GMT/BST
Zone Europe/Dublin -0:25:21 - LMT 1880 Aug 2 Zone Europe/Dublin -0:25:21 - LMT 1880 Aug 2
-0:25:21 - DMT 1916 May 21 2:00 # Dublin MT -0:25:21 - DMT 1916 May 21 2:00 # Dublin MT
-0:25:21 1:00 DST 1916 Oct 1 3:00 -0:25:21 1:00 DST 1916 Oct 1 3:00
@ -745,17 +743,26 @@ Zone Europe/Dublin -0:25:21 - LMT 1880 Aug 2
0:00 - GMT 1948 Apr 18 2:00 0:00 - GMT 1948 Apr 18 2:00
0:00 GB-Eire %s 1968 Feb 18 2:00 0:00 GB-Eire %s 1968 Feb 18 2:00
1:00 - BST 1971 Oct 31 3:00 1:00 - BST 1971 Oct 31 3:00
0:00 GB-Eire %s 0:00 GB-Eire %s 1996
0:00 EC GMT/BST
############################################################################### ###############################################################################
# Continental Europe # Continental Europe
# The *-Eur rules now correspond to the European Community (EC). # EC rules are for the European Community.
# Three rulesets are used because the EC changes at 01:00 UTC, not local time.
# Older *-Eur rules are for convenience in the tables.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule EC 1800 only - Jan 1 0:00 0 -
Rule EC 1977 1980 - Apr Sun>=1 1:00u 1:00 " DST"
Rule EC 1977 only - Sep lastSun 1:00u 0 -
Rule EC 1978 only - Oct 1 1:00u 0 -
Rule EC 1979 1995 - Sep lastSun 1:00u 0 -
Rule EC 1981 max - Mar lastSun 1:00u 1:00 " DST"
Rule EC 1996 max - Oct lastSun 1:00u 0 -
# Also see GB-Eire, which (starting 1996) differs only in LETTER/S.
# W-Eur differs from EC only in that W-Eur uses standard time.
Rule W-Eur 1800 only - Jan 1 0:00 0 - Rule W-Eur 1800 only - Jan 1 0:00 0 -
Rule W-Eur 1977 1980 - Apr Sun>=1 1:00s 1:00 " DST" Rule W-Eur 1977 1980 - Apr Sun>=1 1:00s 1:00 " DST"
Rule W-Eur 1977 only - Sep lastSun 1:00s 0 - Rule W-Eur 1977 only - Sep lastSun 1:00s 0 -
@ -763,8 +770,9 @@ Rule W-Eur 1978 only - Oct 1 1:00s 0 -
Rule W-Eur 1979 1995 - Sep lastSun 1:00s 0 - Rule W-Eur 1979 1995 - Sep lastSun 1:00s 0 -
Rule W-Eur 1981 max - Mar lastSun 1:00s 1:00 " DST" Rule W-Eur 1981 max - Mar lastSun 1:00s 1:00 " DST"
Rule W-Eur 1996 max - Oct lastSun 1:00s 0 - Rule W-Eur 1996 max - Oct lastSun 1:00s 0 -
# Also see GB-Eire, which (starting 1996) differs only in LETTER/S.
# Older M-Eur rules are for convenience in the tables.
# From 1977 on, M-Eur differs from EC only in that M-Eur uses standard time.
Rule M-Eur 1800 only - Jan 1 0:00 0 - Rule M-Eur 1800 only - Jan 1 0:00 0 -
Rule M-Eur 1916 only - Apr 30 23:00 1:00 " DST" Rule M-Eur 1916 only - Apr 30 23:00 1:00 " DST"
Rule M-Eur 1916 only - Oct 1 1:00 0 - Rule M-Eur 1916 only - Oct 1 1:00 0 -
@ -789,10 +797,6 @@ Rule M-Eur 1979 1995 - Sep lastSun 2:00s 0 -
Rule M-Eur 1981 max - Mar lastSun 2:00s 1:00 " DST" Rule M-Eur 1981 max - Mar lastSun 2:00s 1:00 " DST"
Rule M-Eur 1996 max - Oct lastSun 2:00s 0 - Rule M-Eur 1996 max - Oct lastSun 2:00s 0 -
Rule E-Eur 1981 max - Mar lastSun 3:00s 1:00 " DST"
Rule E-Eur 1981 1995 - Sep lastSun 3:00s 0 -
Rule E-Eur 1996 max - Oct lastSun 3:00s 0 -
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Russia 1880 only - Jan 1 0:00 0 - Rule Russia 1880 only - Jan 1 0:00 0 -
Rule Russia 1917 only - Jul 1 23:00 1:00 " DST" Rule Russia 1917 only - Jul 1 23:00 1:00 " DST"
@ -817,9 +821,9 @@ Rule Russia 1985 max - Mar lastSun 2:00s 1:00 D
# These are for backward compatibility with older versions. # These are for backward compatibility with older versions.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone WET 0:00 W-Eur WET%s Zone WET 0:00 EC WET%s
Zone MET 1:00 M-Eur MET%s Zone MET 1:00 M-Eur MET%s
Zone EET 2:00 E-Eur EET%s Zone EET 2:00 EC EET%s
Zone W-SU 3:00 M-Eur ???? Zone W-SU 3:00 M-Eur ????
# Tom Hoffman says that MET is also known as Central European Time # Tom Hoffman says that MET is also known as Central European Time
@ -859,14 +863,14 @@ Zone Europe/Tirane 1:19:20 - LMT 1914
1:00 - MET 1940 Jun 16 1:00 - MET 1940 Jun 16
1:00 Albania MET%s 1985 Mar 31 1:00 1:00 Albania MET%s 1985 Mar 31 1:00
1:00 W-Eur MET%s 1:00 W-Eur MET%s
# This may change to `M-Eur' soon, for EC compatibility. # This may change to `EC' soon.
# Andorra # Andorra
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Andorra 0:06:04 - LMT 1901 Zone Europe/Andorra 0:06:04 - LMT 1901
0:00 - WET 1946 Sep 30 0:00 - WET 1946 Sep 30
1:00 - MET 1985 Mar 31 2:00 1:00 - MET 1985 Mar 31 2:00
1:00 M-Eur MET%s 1:00 EC MET%s
# Austria # Austria
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -884,8 +888,8 @@ Zone Europe/Vienna 1:05:20 - LMT 1893 Apr
1:00 M-Eur MET%s 1918 Jun 16 3:00 1:00 M-Eur MET%s 1918 Jun 16 3:00
1:00 Austria MET%s 1940 Apr 1 2:00 1:00 Austria MET%s 1940 Apr 1 2:00
1:00 M-Eur MET%s 1945 Apr 2 2:00 1:00 M-Eur MET%s 1945 Apr 2 2:00
1:00 Austria MET%s 1981 Mar 29 2:00 1:00 Austria MET%s 1981
1:00 M-Eur MET%s 1:00 EC MET%s
# Belarus # Belarus
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
@ -944,8 +948,8 @@ Zone Europe/Brussels 0:17:20 - LMT 1880
1:00 M-Eur MET%s 1919 Mar 1 23:00 1:00 M-Eur MET%s 1919 Mar 1 23:00
0:00 Belgium WET%s 1940 Feb 24 23:00 0:00 Belgium WET%s 1940 Feb 24 23:00
1:00 M-Eur MET%s 1945 Apr 2 2:00 1:00 M-Eur MET%s 1945 Apr 2 2:00
1:00 Belgium MET%s 1977 Apr 3 2:00 1:00 Belgium MET%s 1977
1:00 M-Eur MET%s 1:00 EC MET%s
# Bosnia and Herzegovina # Bosnia and Herzegovina
# They switched from the Julian to the Gregorian calendar on 1918 Mar 18. # They switched from the Julian to the Gregorian calendar on 1918 Mar 18.
@ -954,8 +958,8 @@ Zone Europe/Sarajevo 1:13:40 - LMT 1884
1:00 - MET 1941 Apr 18 23:00 1:00 - MET 1941 Apr 18 23:00
1:00 M-Eur MET%s 1945 May 8 2:00s 1:00 M-Eur MET%s 1945 May 8 2:00s
1:00 1:00 "MET DST" 1945 Sep 16 2:00s 1:00 1:00 "MET DST" 1945 Sep 16 2:00s
1:00 - MET 1983 Mar 27 2:00s 1:00 - MET 1983
1:00 M-Eur MET%s 1:00 EC MET%s
# Bulgaria # Bulgaria
# Part switched from the Julian to the Gregorian calendar on 1915 Nov 14; # Part switched from the Julian to the Gregorian calendar on 1915 Nov 14;
@ -974,7 +978,7 @@ Zone Europe/Sofia 1:33:16 - LMT 1880
2:00 - EET 1979 Mar 31 23:00 2:00 - EET 1979 Mar 31 23:00
2:00 Bulg EET%s 1982 Sep 26 2:00 2:00 Bulg EET%s 1982 Sep 26 2:00
2:00 M-Eur EET%s 2:00 M-Eur EET%s
# This may change to `E-Eur' soon, for EC compatibility. # This may change to `EC' soon.
# Croatia # Croatia
# They switched from the Julian to the Gregorian calendar on 1918 Mar 18. # They switched from the Julian to the Gregorian calendar on 1918 Mar 18.
@ -983,8 +987,8 @@ Zone Europe/Zagreb 1:03:52 - LMT 1884
1:00 - MET 1941 Apr 18 23:00 1:00 - MET 1941 Apr 18 23:00
1:00 M-Eur MET%s 1945 May 8 2:00s 1:00 M-Eur MET%s 1945 May 8 2:00s
1:00 1:00 "MET DST" 1945 Sep 16 2:00s 1:00 1:00 "MET DST" 1945 Sep 16 2:00s
1:00 - MET 1983 Mar 27 2:00s 1:00 - MET 1983
1:00 M-Eur MET%s 1:00 EC MET%s
# Czech Republic # Czech Republic
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1000,8 +1004,8 @@ Rule Czech 1949 only - Apr 9 2:00s 1:00 " DST"
Zone Europe/Prague 0:57:44 - LMT 1850 Zone Europe/Prague 0:57:44 - LMT 1850
0:58 - PMT 1891 Oct # Prague Mean Time 0:58 - PMT 1891 Oct # Prague Mean Time
1:00 M-Eur MET%s 1944 Sep 17 2:00s 1:00 M-Eur MET%s 1944 Sep 17 2:00s
1:00 Czech MET%s 1979 Apr 1 2:00 1:00 Czech MET%s 1979
1:00 M-Eur MET%s 1:00 EC MET%s
# Denmark # Denmark
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1025,11 +1029,11 @@ Zone Europe/Copenhagen 0:50:20 - LMT 1890
0:50 - CMT 1894 Apr # Copenhagen Mean Time 0:50 - CMT 1894 Apr # Copenhagen Mean Time
1:00 Denmark MET%s 1942 Nov 2 2:00s 1:00 Denmark MET%s 1942 Nov 2 2:00s
1:00 M-Eur MET%s 1945 Apr 2 2:00 1:00 M-Eur MET%s 1945 Apr 2 2:00
1:00 Denmark MET%s 1980 Apr 6 2:00 1:00 Denmark MET%s 1980
1:00 M-Eur MET%s 1:00 EC MET%s
Zone Atlantic/Faeroe -0:27:04 - LMT 1908 Jan 11 # Torshavn Zone Atlantic/Faeroe -0:27:04 - LMT 1908 Jan 11 # Torshavn
0:00 - WET 1981 Mar 29 1:00 0:00 - WET 1981
0:00 W-Eur WET%s 0:00 EC WET%s
Zone America/Scoresbysund -1:29:00 - LMT 1916 Jul 28 Zone America/Scoresbysund -1:29:00 - LMT 1916 Jul 28
-2:00 - MGT 1980 Apr 6 2:00 -2:00 - MGT 1980 Apr 6 2:00
-2:00 M-Eur MGT%s 1981 Mar 29 -2:00 M-Eur MGT%s 1981 Mar 29
@ -1058,7 +1062,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880
3:00 Russia MS%s 1989 Mar 26 2:00s 3:00 Russia MS%s 1989 Mar 26 2:00s
2:00 1:00 "EET DST" 1989 Sep 24 2:00s 2:00 1:00 "EET DST" 1989 Sep 24 2:00s
2:00 M-Eur EET%s 2:00 M-Eur EET%s
# This may change to `E-Eur' soon, for EC compatibility. # This may change to `EC' soon.
# Finland # Finland
# #
@ -1078,7 +1082,7 @@ Rule Finland 1942 only - Oct 3 0:00 0 -
Zone Europe/Helsinki 1:39:52 - LMT 1878 May 31 Zone Europe/Helsinki 1:39:52 - LMT 1878 May 31
1:40 - HMT 1921 May # Helsinki Mean Time 1:40 - HMT 1921 May # Helsinki Mean Time
2:00 Finland EET%s 1981 Mar 29 2:00 2:00 Finland EET%s 1981 Mar 29 2:00
2:00 E-Eur EET%s 2:00 EC EET%s
# France # France
# Shanks seems to use `24:00' ambiguously; we resolve it with Whitman. # Shanks seems to use `24:00' ambiguously; we resolve it with Whitman.
@ -1141,8 +1145,8 @@ Zone Europe/Paris 0:09:05 - LMT 1891 Mar 15 0:01
0:00 France WET%s 1940 Jun 14 0:00 France WET%s 1940 Jun 14
1:00 M-Eur MET%s 1944 Aug 25 1:00 M-Eur MET%s 1944 Aug 25
0:00 France WET%s 1945 Sep 16 3:00 0:00 France WET%s 1945 Sep 16 3:00
1:00 France MET%s 1977 Apr Sun>=1 2:00 1:00 France MET%s 1977
1:00 M-Eur MET%s 1:00 EC MET%s
# Germany # Germany
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1161,15 +1165,15 @@ Rule Germany 1949 only - Apr 10 2:00s 1:00 " DST"
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Berlin 0:53:28 - LMT 1893 Apr Zone Europe/Berlin 0:53:28 - LMT 1893 Apr
1:00 M-Eur MET%s 1945 Apr 2 2:00 1:00 M-Eur MET%s 1945 Apr 2 2:00
1:00 Germany MET%s 1980 Apr 6 2:00 1:00 Germany MET%s 1980
1:00 M-Eur MET%s 1:00 EC MET%s
# Gibraltar # Gibraltar
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Gibraltar -0:21:24 - LMT 1880 Aug 2 Zone Europe/Gibraltar -0:21:24 - LMT 1880 Aug 2
0:00 GB-Eire %s 1957 Apr 14 2:00 0:00 GB-Eire %s 1957 Apr 14 2:00
1:00 - MET 1982 Mar 28 2:00 1:00 - MET 1982
1:00 M-Eur MET%s 1:00 EC MET%s
# Greece # Greece
# They adopted the Julian calendar in 1846. # They adopted the Julian calendar in 1846.
@ -1205,10 +1209,10 @@ Zone Europe/Athens 1:34:52 - LMT 1895 Sep 14
1:35 - AMT 1916 Jul 28 0:01 # Athens MT 1:35 - AMT 1916 Jul 28 0:01 # Athens MT
2:00 Greece EET%s 1941 Apr 30 2:00 Greece EET%s 1941 Apr 30
1:00 Greece MET%s 1944 Apr 4 1:00 Greece MET%s 1944 Apr 4
2:00 Greece EET%s 1981 Mar 29 2:00 2:00 Greece EET%s 1981
# Greece must change by 1996 for EC compatibility. # Shanks says they switched to M-Eur in 1981;
2:00 M-Eur EET%s 1996 # Guess the last minute. # go with EC intead, since Greece joined it on Jan 1.
2:00 E-Eur EET%s 2:00 EC EET%s
# Hungary # Hungary
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1237,7 +1241,7 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 Oct
1:00 Hungary MET%s 1941 Apr 6 2:00 1:00 Hungary MET%s 1941 Apr 6 2:00
1:00 M-Eur MET%s 1945 May 1 23:00 1:00 M-Eur MET%s 1945 May 1 23:00
1:00 Hungary MET%s 1980 Sep 28 2:00s 1:00 Hungary MET%s 1980 Sep 28 2:00s
1:00 M-Eur MET%s 1:00 EC MET%s
# Iceland # Iceland
# #
@ -1347,9 +1351,11 @@ Zone Europe/Rome 0:49:56 - LMT 1866 Sep 22
0:50 - RMT 1893 Nov # Rome Mean Time 0:50 - RMT 1893 Nov # Rome Mean Time
1:00 Italy MET%s 1942 Nov 2 2:00s 1:00 Italy MET%s 1942 Nov 2 2:00s
1:00 M-Eur MET%s 1945 Apr 2 2:00s 1:00 M-Eur MET%s 1945 Apr 2 2:00s
1:00 Italy MET%s 1980 Apr 6 2:00 1:00 Italy MET%s 1980
1:00 M-Eur MET%s 1:00 EC MET%s
# Vatican is identical to Europe/Rome; San Marino is like Europe/Rome.
Link Europe/Rome Europe/Vatican
Link Europe/Rome Europe/San_Marino
# Latvia # Latvia
# They switched from the Julian to the Gregorian calendar on 1918 Feb 15. # They switched from the Julian to the Gregorian calendar on 1918 Feb 15.
@ -1365,13 +1371,13 @@ Zone Europe/Riga 1:36:24 - LMT 1880
3:00 Russia MS%s 1991 Mar 31 2:00s 3:00 Russia MS%s 1991 Mar 31 2:00s
2:00 1:00 "EET DST" 1991 Sep 29 2:00s 2:00 1:00 "EET DST" 1991 Sep 29 2:00s
2:00 M-Eur EET%s 2:00 M-Eur EET%s
# This may change to `E-Eur' soon, for EC compatibility. # This may change to `EC' soon.
# Liechtenstein # Liechtenstein
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun
1:00 - MET 1981 Mar 29 2:00 1:00 - MET 1981
1:00 M-Eur MET%s 1:00 EC MET%s
# Lithuania # Lithuania
# They switched from the Julian to the Gregorian calendar on 1918 Feb 15. # They switched from the Julian to the Gregorian calendar on 1918 Feb 15.
@ -1387,7 +1393,7 @@ Zone Europe/Vilnius 1:41:16 - LMT 1880
3:00 Russia MS%s 1991 Mar 31 2:00s 3:00 Russia MS%s 1991 Mar 31 2:00s
2:00 1:00 "EET DST" 1991 Sep 29 2:00s 2:00 1:00 "EET DST" 1991 Sep 29 2:00s
2:00 M-Eur EET%s 2:00 M-Eur EET%s
# This may change to `E-Eur' soon, for EC compatibility. # This may change to `EC' soon.
# Luxembourg # Luxembourg
# Whitman disagrees with most of these dates in minor ways; go with Shanks. # Whitman disagrees with most of these dates in minor ways; go with Shanks.
@ -1422,8 +1428,8 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun
0:00 Lux WET%s 1929 Oct 6 2:00s 0:00 Lux WET%s 1929 Oct 6 2:00s
0:00 Belgium WET%s 1940 May 14 3:00 0:00 Belgium WET%s 1940 May 14 3:00
1:00 M-Eur WET%s 1944 Sep 18 3:00 1:00 M-Eur WET%s 1944 Sep 18 3:00
1:00 Belgium MET%s 1979 Apr 1 2:00 1:00 Belgium MET%s 1979
1:00 M-Eur MET%s 1:00 EC MET%s
# Macedonia # Macedonia
# They switched from the Julian to the Gregorian calendar on 1918 Mar 18. # They switched from the Julian to the Gregorian calendar on 1918 Mar 18.
@ -1432,8 +1438,8 @@ Zone Europe/Skopje 1:25:44 - LMT 1884
1:00 - MET 1941 Apr 18 23:00 1:00 - MET 1941 Apr 18 23:00
1:00 M-Eur MET%s 1945 May 8 2:00s 1:00 M-Eur MET%s 1945 May 8 2:00s
1:00 1:00 "MET DST" 1945 Sep 16 2:00s 1:00 1:00 "MET DST" 1945 Sep 16 2:00s
1:00 - MET 1983 Mar 27 2:00s 1:00 - MET 1983
1:00 M-Eur MET%s 1:00 EC MET%s
# Malta # Malta
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1449,8 +1455,8 @@ Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 # Valletta
1:00 Italy MET%s 1942 Nov 2 2:00s 1:00 Italy MET%s 1942 Nov 2 2:00s
1:00 M-Eur MET%s 1945 Apr 2 2:00s 1:00 M-Eur MET%s 1945 Apr 2 2:00s
1:00 Italy MET%s 1973 Mar 31 1:00 Italy MET%s 1973 Mar 31
1:00 Malta MET%s 1981 Mar 29 2:00s 1:00 Malta MET%s 1981
1:00 M-Eur MET%s 1:00 EC MET%s
# Moldova # Moldova
# They switched from the Julian to the Gregorian calendar on 1919 Mar 18. # They switched from the Julian to the Gregorian calendar on 1919 Mar 18.
@ -1460,7 +1466,7 @@ Zone Europe/Chisinau 1:55:20 - LMT 1924 May 2
3:00 Russia MS%s 1991 Mar 31 2:00s 3:00 Russia MS%s 1991 Mar 31 2:00s
2:00 1:00 "EET DST" 1991 Sep 29 2:00s 2:00 1:00 "EET DST" 1991 Sep 29 2:00s
2:00 M-Eur EET%s 2:00 M-Eur EET%s
# This may change to `E-Eur' soon, for EC compatibility. # This may change to `EC' soon.
# Monaco # Monaco
# Shanks gives 0:09 for Paris Mean Time; go with Whitman's more precise 0:09:05. # Shanks gives 0:09 for Paris Mean Time; go with Whitman's more precise 0:09:05.
@ -1468,8 +1474,8 @@ Zone Europe/Chisinau 1:55:20 - LMT 1924 May 2
Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15 Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
0:09:05 - PMT 1911 Mar 11 # Paris Mean Time 0:09:05 - PMT 1911 Mar 11 # Paris Mean Time
0:00 France WET%s 1945 Sep 16 3:00 0:00 France WET%s 1945 Sep 16 3:00
1:00 France MET%s 1977 Apr Sun>=1 2:00 1:00 France MET%s 1977
1:00 M-Eur MET%s 1:00 EC MET%s
# Netherlands # Netherlands
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1496,16 +1502,16 @@ Rule Neth 1933 1936 - May 15 2:00s 1:00 NST
Rule Neth 1937 only - May 22 2:00s 1:00 NST Rule Neth 1937 only - May 22 2:00s 1:00 NST
# Whitman gives 1939 Apr 15 and 1940 Apr 19; go with Shanks. # Whitman gives 1939 Apr 15 and 1940 Apr 19; go with Shanks.
Rule Neth 1938 1939 - May 15 2:00s 1:00 NST Rule Neth 1938 1939 - May 15 2:00s 1:00 NST
Rule Neth 1945 only - Apr 2 2:00s 1:00 - Rule Neth 1945 only - Apr 2 2:00s 1:00 " DST"
Rule Neth 1945 only - May 20 2:00s 0 " DST" Rule Neth 1945 only - May 20 2:00s 0 -
# Before 1937, Shanks says just `0:20'; we use Whitman's more precise figure. # Before 1937, Shanks says just `0:20'; we use Whitman's more precise figure.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Amsterdam 0:19:28 - LMT 1892 May Zone Europe/Amsterdam 0:19:28 - LMT 1892 May
0:19:28 Neth %s 1937 Jul 0:19:28 Neth %s 1937 Jul
0:20 Neth %s 1940 May 16 0:40 0:20 Neth %s 1940 May 16 0:40
1:00 M-Eur MET%s 1945 Apr 2 2:00 1:00 M-Eur MET%s 1945 Apr 2 2:00
1:00 Neth MET%s 1977 Apr Sun>=1 2:00 1:00 Neth MET%s 1977
1:00 M-Eur MET%s 1:00 EC MET%s
# Norway # Norway
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1526,8 +1532,8 @@ Rule Norway 1965 only - Apr 25 2:00s 1:00 " DST"
Zone Europe/Oslo 0:43:00 - LMT 1895 Zone Europe/Oslo 0:43:00 - LMT 1895
1:00 Norway MET%s 1940 Aug 10 23:00 1:00 Norway MET%s 1940 Aug 10 23:00
1:00 M-Eur MET%s 1945 Apr 2 2:00 1:00 M-Eur MET%s 1945 Apr 2 2:00
1:00 Norway MET%s 1980 Apr 6 2:00 1:00 Norway MET%s 1980
1:00 M-Eur MET%s 1:00 EC MET%s
# Svalbard is like Europe/Oslo. # Svalbard is like Europe/Oslo.
# #
# From Whitman: # From Whitman:
@ -1568,7 +1574,7 @@ Zone Europe/Warsaw 1:24:00 - LMT 1880
1:00 M-Eur MET%s 1944 Oct 1:00 M-Eur MET%s 1944 Oct
1:00 Poland MET%s 1977 Apr 3 1:00 1:00 Poland MET%s 1977 Apr 3 1:00
1:00 W-Eur MET%s 1:00 W-Eur MET%s
# This may change to `M-Eur' soon, for EC compatibility. # This may change to `EC' soon.
# Portugal # Portugal
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1639,11 +1645,11 @@ Zone Europe/Lisbon -0:36:32 - LMT 1884
0:00 Port WET%s 1966 Apr 3 2:00 0:00 Port WET%s 1966 Apr 3 2:00
1:00 - MET 1976 Sep 26 1:00 1:00 - MET 1976 Sep 26 1:00
0:00 Port WET%s 1983 Sep 25 1:00s 0:00 Port WET%s 1983 Sep 25 1:00s
0:00 W-Eur WET%s 1992 Sep 27 1:00s 0:00 EC WET%s 1992 Sep 27 1:00s
# From Rui Pedro Salgueiro <rps@inescca.inescc.pt> (November 12, 1992): # From Rui Pedro Salgueiro <rps@inescca.inescc.pt> (November 12, 1992):
# Portugal has recently (September, 27) changed timezone # Portugal has recently (September, 27) changed timezone
# (from WET to MET or CET) to harmonize with EEC. # (from WET to MET or CET) to harmonize with EEC.
1:00 M-Eur MET%s 1:00 EC MET%s
# We don't know what happened to Madeira or the Azores, # We don't know what happened to Madeira or the Azores,
# so we'll just use Shanks for now. # so we'll just use Shanks for now.
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
@ -1658,7 +1664,7 @@ Zone Atlantic/Madeira -1:07:36 - LMT 1884 # Funchal
-1:00 Port ACT%s 1966 Apr 3 2:00 -1:00 Port ACT%s 1966 Apr 3 2:00
0:00 - WET 1977 Mar 27 0:00 - WET 1977 Mar 27
0:00 Port WET%s 1983 Sep 25 1:00s 0:00 Port WET%s 1983 Sep 25 1:00s
0:00 W-Eur WET%s 0:00 EC WET%s
# Slovakia # Slovakia
Link Europe/Prague Europe/Bratislava Link Europe/Prague Europe/Bratislava
@ -1680,7 +1686,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct
1:44 - BMT 1931 Jul 24 # Bucharest MT 1:44 - BMT 1931 Jul 24 # Bucharest MT
2:00 Romania EET%s 1981 Mar 29 2:00s 2:00 Romania EET%s 1981 Mar 29 2:00s
2:00 M-Eur EET%s 2:00 M-Eur EET%s
# This may change to `E-Eur' soon, for EC compatibility. # This may change to `EC' soon.
# Russia # Russia
# From Paul Eggert <eggert@twinsun.com> (May 28, 1994): # From Paul Eggert <eggert@twinsun.com> (May 28, 1994):
@ -1790,8 +1796,8 @@ Zone Europe/Belgrade 1:22:00 - LMT 1884
1:00 - MET 1941 Apr 18 23:00 1:00 - MET 1941 Apr 18 23:00
1:00 M-Eur MET%s 1945 May 8 2:00s 1:00 M-Eur MET%s 1945 May 8 2:00s
1:00 1:00 "MET DST" 1945 Sep 16 2:00s 1:00 1:00 "MET DST" 1945 Sep 16 2:00s
1:00 - MET 1983 Mar 27 2:00s 1:00 - MET 1983
1:00 M-Eur MET%s 1:00 EC MET%s
# Slovenia # Slovenia
# They switched from the Julian to the Gregorian calendar on 1918 Mar 18. # They switched from the Julian to the Gregorian calendar on 1918 Mar 18.
@ -1800,8 +1806,8 @@ Zone Europe/Ljubljana 0:58:04 - LMT 1884
1:00 - MET 1941 Apr 18 23:00 1:00 - MET 1941 Apr 18 23:00
1:00 M-Eur MET%s 1945 May 8 2:00s 1:00 M-Eur MET%s 1945 May 8 2:00s
1:00 1:00 "MET DST" 1945 Sep 16 2:00s 1:00 1:00 "MET DST" 1945 Sep 16 2:00s
1:00 - MET 1983 Mar 27 2:00s 1:00 - MET 1983
1:00 M-Eur MET%s 1:00 EC MET%s
# Spain # Spain
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
@ -1845,13 +1851,13 @@ Rule Spain 1978 only - Oct 1 1:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Madrid -0:14:44 - LMT 1901 Zone Europe/Madrid -0:14:44 - LMT 1901
0:00 Spain WET%s 1946 Sep 30 0:00 Spain WET%s 1946 Sep 30
1:00 Spain MET%s 1979 Apr 1 2:00 1:00 Spain MET%s 1979
1:00 M-Eur MET%s 1:00 EC MET%s
Zone Atlantic/Canary -1:01:36 - LMT 1922 Mar # Las Palmas de Gran C. Zone Atlantic/Canary -1:01:36 - LMT 1922 Mar # Las Palmas de Gran C.
-1:00 - ACT 1946 Sep 30 1:00 -1:00 - ACT 1946 Sep 30 1:00
0:00 - WET 1980 Apr 6 0:00s 0:00 - WET 1980 Apr 6 0:00s
0:00 1:00 "WET DST" 1980 Sep 28 0:00s 0:00 1:00 "WET DST" 1980 Sep 28 0:00s
0:00 W-Eur WET%s 0:00 EC WET%s
# Sweden # Sweden
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
@ -1859,8 +1865,8 @@ Zone Europe/Stockholm 1:12:12 - LMT 1878 May 31
1:12 - SMT 1900 Jan 1 1:00 # Stockholm MT 1:12 - SMT 1900 Jan 1 1:00 # Stockholm MT
1:00 - MET 1916 Apr 14 23:00s 1:00 - MET 1916 Apr 14 23:00s
1:00 1:00 "MET DST" 1916 Sep 30 23:00s 1:00 1:00 "MET DST" 1916 Sep 30 23:00s
1:00 - MET 1980 Apr 6 2:00 1:00 - MET 1980
1:00 M-Eur MET%s 1:00 EC MET%s
# Switzerland # Switzerland
# From Howse (1988), p 82: # From Howse (1988), p 82:
@ -1871,15 +1877,15 @@ Zone Europe/Stockholm 1:12:12 - LMT 1878 May 31
Rule Swiss 1894 only - Jun 1 0:00 0 - Rule Swiss 1894 only - Jun 1 0:00 0 -
# From Whitman (who writes ``Midnight?''): # From Whitman (who writes ``Midnight?''):
Rule Swiss 1940 only - Nov 2 0:00 1:00 " DST" Rule Swiss 1940 only - Nov 2 0:00 1:00 " DST"
Rule Swiss 1940 only - Dec 31 0:00 0 " DST" Rule Swiss 1940 only - Dec 31 0:00 0 -
# From Shanks (1991): # From Shanks (1991):
Rule Swiss 1941 1942 - May Sun>=1 2:00 1:00 " DST" Rule Swiss 1941 1942 - May Sun>=1 2:00 1:00 " DST"
Rule Swiss 1941 1942 - Oct Sun>=1 0:00 0 " DST" Rule Swiss 1941 1942 - Oct Sun>=1 0:00 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL] # Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12 Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12
0:30 - SST 1894 Jun # Swiss Standard Time 0:30 - SST 1894 Jun # Swiss Standard Time
1:00 Swiss MET%s 1981 Mar 29 2:00 1:00 Swiss MET%s 1981
1:00 M-Eur MET%s 1:00 EC MET%s
# Turkey # Turkey
# European Turkey switched to the Gregorian calendar in 1908. # European Turkey switched to the Gregorian calendar in 1908.
@ -1945,7 +1951,7 @@ Zone Europe/Istanbul 1:55:52 - LMT 1880
3:00 Turkey TUR%s 1985 Apr 20 3:00 Turkey TUR%s 1985 Apr 20
2:00 Turkey EET%s 1986 2:00 Turkey EET%s 1986
2:00 M-Eur EET%s 2:00 M-Eur EET%s
# This may change to `E-Eur' soon, for EC compatibility. # This may change to `EC' soon.
Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents. Link Europe/Istanbul Asia/Istanbul # Istanbul is in both continents.
# Ukraine # Ukraine
@ -1963,7 +1969,7 @@ Zone Europe/Kiev 2:02:04 - LMT 1880
2:00 - EET 1930 Jun 21 2:00 - EET 1930 Jun 21
3:00 Russia MS%s 1990 Jul 17 3:00 Russia MS%s 1990 Jul 17
2:00 M-Eur EET%s 2:00 M-Eur EET%s
# This may change to `E-Eur' soon, for EC compatibility. # This may change to `EC' soon.
Zone Europe/Simferopol 2:16:24 - LMT 1880 Zone Europe/Simferopol 2:16:24 - LMT 1880
2:08 Russia LST%s 1919 Jul 1 2:00 2:08 Russia LST%s 1919 Jul 1 2:00
2:08 Ukraine LST%s 1924 May 2 2:08 Ukraine LST%s 1924 May 2

View File

@ -1,6 +1,6 @@
#ifndef lint #ifndef lint
#ifndef NOID #ifndef NOID
static char elsieid[] = "@(#)ialloc.c 8.24"; static char elsieid[] = "@(#)ialloc.c 8.28";
#endif /* !defined NOID */ #endif /* !defined NOID */
#endif /* !defined lint */ #endif /* !defined lint */
@ -8,13 +8,6 @@ static char elsieid[] = "@(#)ialloc.c 8.24";
#include "private.h" #include "private.h"
#ifdef MAL
#define NULLMAL(x) ((x) == NULL || (x) == MAL)
#endif /* defined MAL */
#ifndef MAL
#define NULLMAL(x) ((x) == NULL)
#endif /* !defined MAL */
#define nonzero(n) (((n) == 0) ? 1 : (n)) #define nonzero(n) (((n) == 0) ? 1 : (n))
char * icalloc P((int nelem, int elsize)); char * icalloc P((int nelem, int elsize));
@ -28,15 +21,7 @@ char *
imalloc(n) imalloc(n)
const int n; const int n;
{ {
#ifdef MAL return malloc((size_t) nonzero(n));
register char * result;
result = malloc((alloc_size_T) nonzero(n));
return NULLMAL(result) ? NULL : result;
#endif /* defined MAL */
#ifndef MAL
return malloc((alloc_size_T) nonzero(n));
#endif /* !defined MAL */
} }
char * char *
@ -46,7 +31,7 @@ int elsize;
{ {
if (nelem == 0 || elsize == 0) if (nelem == 0 || elsize == 0)
nelem = elsize = 1; nelem = elsize = 1;
return calloc((alloc_size_T) nelem, (alloc_size_T) elsize); return calloc((size_t) nelem, (size_t) elsize);
} }
void * void *
@ -54,9 +39,9 @@ irealloc(pointer, size)
void * const pointer; void * const pointer;
const int size; const int size;
{ {
if (NULLMAL(pointer)) if (pointer == NULL)
return imalloc(size); return imalloc(size);
return realloc((genericptr_T) pointer, (alloc_size_T) nonzero(size)); return realloc((void *) pointer, (size_t) nonzero(size));
} }
char * char *
@ -67,14 +52,14 @@ const char * const new;
register char * result; register char * result;
register int oldsize, newsize; register int oldsize, newsize;
newsize = NULLMAL(new) ? 0 : strlen(new); newsize = (new == NULL) ? 0 : strlen(new);
if (NULLMAL(old)) if (old == NULL)
oldsize = 0; oldsize = 0;
else if (newsize == 0) else if (newsize == 0)
return old; return old;
else oldsize = strlen(old); else oldsize = strlen(old);
if ((result = irealloc(old, oldsize + newsize + 1)) != NULL) if ((result = irealloc(old, oldsize + newsize + 1)) != NULL)
if (!NULLMAL(new)) if (new != NULL)
(void) strcpy(result + oldsize, new); (void) strcpy(result + oldsize, new);
return result; return result;
} }
@ -90,7 +75,7 @@ void
ifree(p) ifree(p)
char * const p; char * const p;
{ {
if (!NULLMAL(p)) if (p != NULL)
(void) free(p); (void) free(p);
} }
@ -98,6 +83,6 @@ void
icfree(p) icfree(p)
char * const p; char * const p;
{ {
if (!NULLMAL(p)) if (p != NULL)
(void) free(p); (void) free(p);
} }

View File

@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave, not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */ Cambridge, MA 02139, USA. */
#include <ansidecl.h>
#include <stddef.h> #include <stddef.h>
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>
@ -25,19 +24,14 @@ Cambridge, MA 02139, USA. */
#include <time.h> #include <time.h>
#ifndef HAVE_GNU_LD
#define __tzname tzname
#define __daylight daylight
#define __timezone timezone
#endif
/* Return the `struct tm' representation of *TIMER in the local timezone. */ /* Return the `struct tm' representation of *TIMER in the local timezone. */
struct tm * struct tm *
DEFUN(localtime, (timer), CONST time_t *timer) localtime (timer)
const time_t *timer;
{ {
extern int __use_tzfile; extern int __use_tzfile;
extern int EXFUN(__tz_compute, (time_t timer, struct tm *tp)); extern int __tz_compute __P ((time_t timer, struct tm *tp));
extern int EXFUN(__tzfile_compute, (time_t timer, extern int __tzfile_compute __P ((time_t timer,
long int *leap_correct, int *leap_hit)); long int *leap_correct, int *leap_hit));
register struct tm *tp; register struct tm *tp;
long int leap_correction; long int leap_correction;

View File

@ -1,4 +1,4 @@
# @(#)northamerica 7.12 # @(#)northamerica 7.15
# also includes Central America and the Caribbean # also includes Central America and the Caribbean
# This data is by no means authoritative; if you think you know better, # This data is by no means authoritative; if you think you know better,
@ -148,7 +148,7 @@ Zone America/Phoenix -7:00 US M%sT 1946
# large size and location in three states." (The "only" means that other # large size and location in three states." (The "only" means that other
# tribal nations don't use DST.) # tribal nations don't use DST.)
Link America/Denver Navajo Link America/Denver America/Shiprock
# From Bob Devine (January 28, 1988): # From Bob Devine (January 28, 1988):
# Michigan didn't observe DST from 1968 to 1973. # Michigan didn't observe DST from 1968 to 1973.

View File

@ -1,4 +1,4 @@
# @(#)pacificnew 7.6 # @(#)pacificnew 7.7
# From Arthur David Olson (April 5, 1989): # From Arthur David Olson (April 5, 1989):
# On April 5, 1989, the U. S. House of Representatives passed (238-154) a bill # On April 5, 1989, the U. S. House of Representatives passed (238-154) a bill

View File

@ -16,12 +16,63 @@
#ifndef lint #ifndef lint
#ifndef NOID #ifndef NOID
static char privatehid[] = "@(#)private.h 7.10"; static char privatehid[] = "@(#)private.h 7.33";
#endif /* !defined NOID */ #endif /* !defined NOID */
#endif /* !defined lint */ #endif /* !defined lint */
/* /*
** const ** Defaults for preprocessor symbols.
** You can override these in your C compiler options, e.g. `-DHAVE_ADJTIME=0'.
*/
#ifndef HAVE_ADJTIME
#define HAVE_ADJTIME 1
#endif /* !defined HAVE_ADJTIME */
#ifndef HAVE_SETTIMEOFDAY
#define HAVE_SETTIMEOFDAY 3
#endif /* !defined HAVE_SETTIMEOFDAY */
#ifndef HAVE_UNISTD_H
#define HAVE_UNISTD_H 1
#endif /* !defined HAVE_UNISTD_H */
#ifndef LOCALE_HOME
#define LOCALE_HOME "/usr/lib/locale"
#endif /* !defined LOCALE_HOME */
/*
** Nested includes
*/
#include "sys/types.h" /* for time_t */
#include "stdio.h"
#include "ctype.h"
#include "errno.h"
#include "string.h"
#include "limits.h" /* for CHAR_BIT */
#include "time.h"
#include "stdlib.h"
#if HAVE_UNISTD_H - 0
#include "unistd.h" /* for F_OK and R_OK */
#endif /* HAVE_UNISTD_H - 0 */
#if !(HAVE_UNISTD_H - 0)
#ifndef F_OK
#define F_OK 0
#endif /* !defined F_OK */
#ifndef R_OK
#define R_OK 4
#endif /* !defined R_OK */
#endif /* !(HAVE_UNISTD_H - 0) */
/*
** Workarounds for compilers/systems.
*/
/*
** SunOS 4.1.1 cc lacks const.
*/ */
#ifndef const #ifndef const
@ -31,43 +82,7 @@ static char privatehid[] = "@(#)private.h 7.10";
#endif /* !defined const */ #endif /* !defined const */
/* /*
** void ** SunOS 4.1.1 cc lacks prototypes.
*/
#ifndef void
#ifndef __STDC__
#ifndef vax
#ifndef sun
#define void char
#endif /* !defined sun */
#endif /* !defined vax */
#endif /* !defined __STDC__ */
#endif /* !defined void */
/*
** INITIALIZE
*/
#ifndef GNUC_or_lint
#ifdef lint
#define GNUC_or_lint
#endif /* defined lint */
#ifdef __GNUC__
#define GNUC_or_lint
#endif /* defined __GNUC__ */
#endif /* !defined GNUC_or_lint */
#ifndef INITIALIZE
#ifdef GNUC_or_lint
#define INITIALIZE(x) ((x) = 0)
#endif /* defined GNUC_or_lint */
#ifndef GNUC_or_lint
#define INITIALIZE(x)
#endif /* !defined GNUC_or_lint */
#endif /* !defined INITIALIZE */
/*
** P((args))
*/ */
#ifndef P #ifndef P
@ -80,30 +95,24 @@ static char privatehid[] = "@(#)private.h 7.10";
#endif /* !defined P */ #endif /* !defined P */
/* /*
** genericptr_T ** SunOS 4.1.1 headers lack EXIT_SUCCESS.
*/ */
#ifdef __STDC__ #ifndef EXIT_SUCCESS
typedef void * genericptr_T; #define EXIT_SUCCESS 0
#endif /* defined __STDC__ */ #endif /* !defined EXIT_SUCCESS */
#ifndef __STDC__
typedef char * genericptr_T;
#endif /* !defined __STDC__ */
#include "sys/types.h" /* for time_t */ /*
#include "stdio.h" ** SunOS 4.1.1 headers lack EXIT_FAILURE.
#include "ctype.h" */
#include "errno.h"
#include "string.h"
#include "limits.h" /* for CHAR_BIT */
#ifndef _TIME_
#include "time.h"
#endif /* !defined _TIME_ */
#ifndef remove #ifndef EXIT_FAILURE
extern int unlink P((const char * filename)); #define EXIT_FAILURE 1
#define remove unlink #endif /* !defined EXIT_FAILURE */
#endif /* !defined remove */
/*
** SunOS 4.1.1 headers lack FILENAME_MAX.
*/
#ifndef FILENAME_MAX #ifndef FILENAME_MAX
@ -122,62 +131,18 @@ extern int unlink P((const char * filename));
#endif /* !defined FILENAME_MAX */ #endif /* !defined FILENAME_MAX */
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif /* !defined EXIT_SUCCESS */
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif /* !defined EXIT_FAILURE */
#ifdef __STDC__
#define alloc_size_T size_t
#define qsort_size_T size_t
#define fwrite_size_T size_t
#endif /* defined __STDC__ */
#ifndef __STDC__
#ifndef alloc_size_T
#define alloc_size_T unsigned
#endif /* !defined alloc_size_T */
#ifndef qsort_size_T
#ifdef USG
#define qsort_size_T unsigned
#endif /* defined USG */
#ifndef USG
#define qsort_size_T int
#endif /* !defined USG */
#endif /* !defined qsort_size_T */
#ifndef fwrite_size_T
#define fwrite_size_T int
#endif /* !defined fwrite_size_T */
#ifndef USG
extern char * sprintf P((char * buf, const char * format, ...));
#endif /* !defined USG */
#endif /* !defined __STDC__ */
/* /*
** Ensure that these are declared--redundantly declaring them shouldn't hurt. ** SunOS 4.1.1 libraries lack remove.
*/ */
extern char * getenv P((const char * name)); #ifndef remove
extern genericptr_T malloc P((alloc_size_T size)); extern int unlink P((const char * filename));
extern genericptr_T calloc P((alloc_size_T nelem, alloc_size_T elsize)); #define remove unlink
extern genericptr_T realloc P((genericptr_T oldptr, alloc_size_T newsize)); #endif /* !defined remove */
#ifdef USG /*
extern void exit P((int s)); ** Finally, some convenience items.
extern void qsort P((genericptr_T base, qsort_size_T nelem, */
qsort_size_T elsize, int (*comp)()));
extern void perror P((const char * string));
extern void free P((char * buf));
#endif /* defined USG */
#ifndef TRUE #ifndef TRUE
#define TRUE 1 #define TRUE 1
@ -198,13 +163,32 @@ extern void free P((char * buf));
((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2) ((sizeof(type) * CHAR_BIT - 1) * 302 / 1000 + 2)
#endif /* !defined INT_STRLEN_MAXIMUM */ #endif /* !defined INT_STRLEN_MAXIMUM */
#ifndef LOCALE_HOME /*
#define LOCALE_HOME "/usr/lib/locale" ** INITIALIZE(x)
#endif /* !defined LOCALE_HOME */ */
#ifndef GNUC_or_lint
#ifdef lint
#define GNUC_or_lint
#endif /* defined lint */
#ifndef lint
#ifdef __GNUC__
#define GNUC_or_lint
#endif /* defined __GNUC__ */
#endif /* !defined lint */
#endif /* !defined GNUC_or_lint */
#ifndef INITIALIZE
#ifdef GNUC_or_lint
#define INITIALIZE(x) ((x) = 0)
#endif /* defined GNUC_or_lint */
#ifndef GNUC_or_lint
#define INITIALIZE(x)
#endif /* !defined GNUC_or_lint */
#endif /* !defined INITIALIZE */
/* /*
** UNIX was a registered trademark of UNIX System Laboratories in 1993. ** UNIX was a registered trademark of UNIX System Laboratories in 1993.
** VAX is a trademark of Digital Equipment Corporation.
*/ */
#endif /* !defined PRIVATE_H */ #endif /* !defined PRIVATE_H */

View File

@ -16,7 +16,7 @@
#ifndef lint #ifndef lint
#ifndef NOID #ifndef NOID
static char tzfilehid[] = "@(#)tzfile.h 7.4"; static char tzfilehid[] = "@(#)tzfile.h 7.6";
#endif /* !defined NOID */ #endif /* !defined NOID */
#endif /* !defined lint */ #endif /* !defined lint */
@ -41,7 +41,8 @@ static char tzfilehid[] = "@(#)tzfile.h 7.4";
*/ */
struct tzhead { struct tzhead {
char tzh_reserved[24]; /* reserved for future use */ char tzh_reserved[20]; /* reserved for future use */
char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */ char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */ char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */ char tzh_timecnt[4]; /* coded number of transition times */
@ -67,6 +68,11 @@ struct tzhead {
** transition time is wall clock time ** transition time is wall clock time
** if absent, transition times are ** if absent, transition times are
** assumed to be wall clock time ** assumed to be wall clock time
** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition
** time is GMT, if FALSE,
** transition time is local time
** if absent, transition times are
** assumed to be local time
*/ */
/* /*
@ -89,7 +95,11 @@ struct tzhead {
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */ #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
#endif /* !defined NOSOLAR */ #endif /* !defined NOSOLAR */
#ifdef NOSOLAR #ifdef NOSOLAR
#define TZ_MAX_TYPES 10 /* Maximum number of local time types */ /*
** Must be at least 14 for Europe/Riga as of Jan 12 1995,
** as noted by Earl Chew <earl@hpato.aus.hp.com>.
*/
#define TZ_MAX_TYPES 20 /* Maximum number of local time types */
#endif /* !defined NOSOLAR */ #endif /* !defined NOSOLAR */
#endif /* !defined TZ_MAX_TYPES */ #endif /* !defined TZ_MAX_TYPES */

View File

@ -1,6 +1,6 @@
#ifndef lint #ifndef lint
#ifndef NOID #ifndef NOID
static char elsieid[] = "@(#)zdump.c 7.12"; static char elsieid[] = "@(#)zdump.c 7.20";
#endif /* !defined NOID */ #endif /* !defined NOID */
#endif /* !defined lint */ #endif /* !defined lint */
@ -10,10 +10,11 @@ static char elsieid[] = "@(#)zdump.c 7.12";
** You can use this code to help in verifying other implementations. ** You can use this code to help in verifying other implementations.
*/ */
#include "stdio.h" /* for stdout, stderr */ #include "stdio.h" /* for stdout, stderr, perror */
#include "string.h" /* for strcpy */ #include "string.h" /* for strcpy */
#include "sys/types.h" /* for time_t */ #include "sys/types.h" /* for time_t */
#include "time.h" /* for struct tm */ #include "time.h" /* for struct tm */
#include "stdlib.h" /* for exit, malloc, atoi */
#ifndef MAX_STRING_LENGTH #ifndef MAX_STRING_LENGTH
#define MAX_STRING_LENGTH 1024 #define MAX_STRING_LENGTH 1024
@ -71,9 +72,11 @@ static char elsieid[] = "@(#)zdump.c 7.12";
#ifdef lint #ifdef lint
#define GNUC_or_lint #define GNUC_or_lint
#endif /* defined lint */ #endif /* defined lint */
#ifndef lint
#ifdef __GNUC__ #ifdef __GNUC__
#define GNUC_or_lint #define GNUC_or_lint
#endif /* defined __GNUC__ */ #endif /* defined __GNUC__ */
#endif /* !defined lint */
#endif /* !defined GNUC_or_lint */ #endif /* !defined GNUC_or_lint */
#ifndef INITIALIZE #ifndef INITIALIZE
@ -92,11 +95,6 @@ extern int optind;
extern time_t time(); extern time_t time();
extern char * tzname[2]; extern char * tzname[2];
#ifdef USG
extern void exit();
extern void perror();
#endif /* defined USG */
static char * abbr(); static char * abbr();
static long delta(); static long delta();
static time_t hunt(); static time_t hunt();
@ -109,16 +107,19 @@ main(argc, argv)
int argc; int argc;
char * argv[]; char * argv[];
{ {
register int i, c; register int i;
register int c;
register int vflag; register int vflag;
register char * cutoff; register char * cutoff;
register int cutyear; register int cutyear;
register long cuttime; register long cuttime;
char ** fakeenv; char ** fakeenv;
time_t now; time_t now;
time_t t, newt; time_t t;
time_t newt;
time_t hibit; time_t hibit;
struct tm tm, newtm; struct tm tm;
struct tm newtm;
INITIALIZE(cuttime); INITIALIZE(cuttime);
progname = argv[0]; progname = argv[0];
@ -152,13 +153,16 @@ char * argv[];
for (hibit = 1; (hibit << 1) != 0; hibit <<= 1) for (hibit = 1; (hibit << 1) != 0; hibit <<= 1)
continue; continue;
{ {
register int from, to; register int from;
register int to;
for (i = 0; environ[i] != NULL; ++i) for (i = 0; environ[i] != NULL; ++i)
continue; continue;
fakeenv = (char **) malloc((i + 2) * sizeof *fakeenv); fakeenv = (char **) malloc((size_t) ((i + 2) *
sizeof *fakeenv));
if (fakeenv == NULL || if (fakeenv == NULL ||
(fakeenv[0] = (char *) malloc(longest + 4)) == NULL) { (fakeenv[0] = (char *) malloc((size_t) (longest +
4))) == NULL) {
(void) perror(progname); (void) perror(progname);
(void) exit(EXIT_FAILURE); (void) exit(EXIT_FAILURE);
} }

View File

@ -1,11 +1,14 @@
#ifndef lint #ifndef lint
#ifndef NOID #ifndef NOID
static char elsieid[] = "@(#)zic.c 7.28"; static char elsieid[] = "@(#)zic.c 7.50";
#endif /* !defined NOID */ #endif /* !defined NOID */
#endif /* !defined lint */ #endif /* !defined lint */
#include "private.h" #include "private.h"
#include "tzfile.h" #include "tzfile.h"
#ifdef unix
#include "sys/stat.h" /* for umask manifest constants */
#endif /* defined unix */
struct rule { struct rule {
const char * r_filename; const char * r_filename;
@ -25,7 +28,7 @@ struct rule {
long r_tod; /* time from midnight */ long r_tod; /* time from midnight */
int r_todisstd; /* above is standard time if TRUE */ int r_todisstd; /* above is standard time if TRUE */
/* or wall clock time if FALSE */ /* or wall clock time if FALSE */
int r_todisuniv; /* above is universal time if TRUE */ int r_todisgmt; /* above is GMT if TRUE */
/* or local time if FALSE */ /* or local time if FALSE */
long r_stdoff; /* offset from standard time */ long r_stdoff; /* offset from standard time */
const char * r_abbrvar; /* variable part of abbreviation */ const char * r_abbrvar; /* variable part of abbreviation */
@ -60,8 +63,8 @@ struct zone {
time_t z_untiltime; time_t z_untiltime;
}; };
extern int emkdir P((const char * name, int mode)); extern int getopt P((int argc, char * const argv[],
extern int getopt P((int argc, char * argv[], const char * options)); const char * options));
extern char * icatalloc P((char * old, const char * new)); extern char * icatalloc P((char * old, const char * new));
extern char * icpyalloc P((const char * string)); extern char * icpyalloc P((const char * string));
extern void ifree P((char * p)); extern void ifree P((char * p));
@ -74,13 +77,15 @@ extern char * scheck P((const char * string, const char * format));
static void addtt P((time_t starttime, int type)); static void addtt P((time_t starttime, int type));
static int addtype P((long gmtoff, const char * abbr, int isdst, static int addtype P((long gmtoff, const char * abbr, int isdst,
int ttisstd)); int ttisstd, int ttisgmt));
static void leapadd P((time_t t, int positive, int rolling, int count)); static void leapadd P((time_t t, int positive, int rolling, int count));
static void adjleap P((void)); static void adjleap P((void));
static void associate P((void)); static void associate P((void));
static int ciequal P((const char * ap, const char * bp)); static int ciequal P((const char * ap, const char * bp));
static void convert P((long val, char * buf)); static void convert P((long val, char * buf));
static void dolink P((const char * fromfile, const char * tofile)); static void dolink P((const char * fromfile, const char * tofile));
static void doabbr P((char * abbr, const char * format,
const char * letters, int isdst));
static void eat P((const char * name, int num)); static void eat P((const char * name, int num));
static void eats P((const char * name, int num, static void eats P((const char * name, int num,
const char * rname, int rnum)); const char * rname, int rnum));
@ -105,7 +110,7 @@ static void newabbr P((const char * abbr));
static long oadd P((long t1, long t2)); static long oadd P((long t1, long t2));
static void outzone P((const struct zone * zp, int ntzones)); static void outzone P((const struct zone * zp, int ntzones));
static void puttzcode P((long code, FILE * fp)); static void puttzcode P((long code, FILE * fp));
static int rcomp P((const genericptr_T leftp, const genericptr_T rightp)); static int rcomp P((const void * leftp, const void * rightp));
static time_t rpytime P((const struct rule * rp, int wantedy)); static time_t rpytime P((const struct rule * rp, int wantedy));
static void rulesub P((struct rule * rp, static void rulesub P((struct rule * rp,
const char * loyearp, const char * hiyearp, const char * loyearp, const char * hiyearp,
@ -321,6 +326,7 @@ static long gmtoffs[TZ_MAX_TYPES];
static char isdsts[TZ_MAX_TYPES]; static char isdsts[TZ_MAX_TYPES];
static unsigned char abbrinds[TZ_MAX_TYPES]; static unsigned char abbrinds[TZ_MAX_TYPES];
static char ttisstds[TZ_MAX_TYPES]; static char ttisstds[TZ_MAX_TYPES];
static char ttisgmts[TZ_MAX_TYPES];
static char chars[TZ_MAX_CHARS]; static char chars[TZ_MAX_CHARS];
static time_t trans[TZ_MAX_LEAPS]; static time_t trans[TZ_MAX_LEAPS];
static long corr[TZ_MAX_LEAPS]; static long corr[TZ_MAX_LEAPS];
@ -392,8 +398,8 @@ const char * const string;
static void static void
usage P((void)) usage P((void))
{ {
(void) fprintf(stderr, (void) fprintf(stderr, "%s: usage is %s \
"%s: usage is %s [ -s ] [ -v ] [ -l localtime ] [ -p posixrules ] [ -d directory ] \n\ [ -s ] [ -v ] [ -l localtime ] [ -p posixrules ] [ -d directory ]\n\
\t[ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n", \t[ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n",
progname, progname); progname, progname);
(void) exit(EXIT_FAILURE); (void) exit(EXIT_FAILURE);
@ -411,11 +417,12 @@ main(argc, argv)
int argc; int argc;
char * argv[]; char * argv[];
{ {
register int i, j; register int i;
register int j;
register int c; register int c;
#ifdef unix #ifdef unix
(void) umask(umask(022) | 022); (void) umask(umask(S_IWGRP | S_IWOTH) | (S_IWGRP | S_IWOTH));
#endif /* defined unix */ #endif /* defined unix */
progname = argv[0]; progname = argv[0];
while ((c = getopt(argc, argv, "d:l:p:L:vsy:")) != EOF) while ((c = getopt(argc, argv, "d:l:p:L:vsy:")) != EOF)
@ -601,7 +608,7 @@ const char * const name;
myname = ecpyalloc(name); myname = ecpyalloc(name);
myname = ecatalloc(myname, "/."); myname = ecatalloc(myname, "/.");
accres = access(myname, 0); accres = access(myname, F_OK);
ifree(myname); ifree(myname);
return accres == 0; return accres == 0;
} }
@ -616,11 +623,11 @@ const char * const name;
static int static int
rcomp(cp1, cp2) rcomp(cp1, cp2)
const genericptr_T cp1; const void * cp1;
const genericptr_T cp2; const void * cp2;
{ {
return strcmp(((struct rule *) cp1)->r_name, return strcmp(((const struct rule *) cp1)->r_name,
((struct rule *) cp2)->r_name); ((const struct rule *) cp2)->r_name);
} }
static void static void
@ -632,9 +639,8 @@ associate P((void))
register int i; register int i;
if (nrules != 0) if (nrules != 0)
(void) qsort((genericptr_T) rules, (void) qsort((void *) rules, (size_t) nrules,
(qsort_size_T) nrules, (size_t) sizeof *rules, rcomp);
(qsort_size_T) sizeof *rules, rcomp);
for (i = 0; i < nzones; ++i) { for (i = 0; i < nzones; ++i) {
zp = &zones[i]; zp = &zones[i];
zp->z_rules = NULL; zp->z_rules = NULL;
@ -956,7 +962,8 @@ const int iscont;
zones[nzones - 1].z_untiltime > min_time && zones[nzones - 1].z_untiltime > min_time &&
zones[nzones - 1].z_untiltime < max_time && zones[nzones - 1].z_untiltime < max_time &&
zones[nzones - 1].z_untiltime >= z.z_untiltime) { zones[nzones - 1].z_untiltime >= z.z_untiltime) {
error("Zone continuation line end time is not after end time of previous line"); error("Zone continuation line end time is not \
after end time of previous line");
return FALSE; return FALSE;
} }
} }
@ -1115,25 +1122,25 @@ const char * const timep;
} }
rp->r_month = lp->l_value; rp->r_month = lp->l_value;
rp->r_todisstd = FALSE; rp->r_todisstd = FALSE;
rp->r_todisuniv = FALSE; rp->r_todisgmt = FALSE;
dp = ecpyalloc(timep); dp = ecpyalloc(timep);
if (*dp != '\0') { if (*dp != '\0') {
ep = dp + strlen(dp) - 1; ep = dp + strlen(dp) - 1;
switch (lowerit(*ep)) { switch (lowerit(*ep)) {
case 's': /* Standard */ case 's': /* Standard */
rp->r_todisstd = TRUE; rp->r_todisstd = TRUE;
rp->r_todisuniv = FALSE; rp->r_todisgmt = FALSE;
*ep = '\0'; *ep = '\0';
break; break;
case 'w': /* Wall */ case 'w': /* Wall */
rp->r_todisstd = FALSE; rp->r_todisstd = FALSE;
rp->r_todisuniv = FALSE; rp->r_todisgmt = FALSE;
*ep = '\0'; *ep = '\0';
case 'g': /* Greenwich */ case 'g': /* Greenwich */
case 'u': /* Universal */ case 'u': /* Universal */
case 'z': /* Zulu */ case 'z': /* Zulu */
rp->r_todisstd = TRUE; rp->r_todisstd = TRUE;
rp->r_todisuniv = TRUE; rp->r_todisgmt = TRUE;
*ep = '\0'; *ep = '\0';
break; break;
} }
@ -1144,7 +1151,8 @@ const char * const timep;
** Year work. ** Year work.
*/ */
cp = loyearp; cp = loyearp;
if ((lp = byword(cp, begin_years)) != NULL) switch ((int) lp->l_value) { lp = byword(cp, begin_years);
if (lp != NULL) switch ((int) lp->l_value) {
case YR_MINIMUM: case YR_MINIMUM:
rp->r_loyear = min_int; rp->r_loyear = min_int;
break; break;
@ -1260,9 +1268,7 @@ FILE * const fp;
char buf[4]; char buf[4];
convert(val, buf); convert(val, buf);
(void) fwrite((genericptr_T) buf, (void) fwrite((void *) buf, (size_t) sizeof buf, (size_t) 1, fp);
(fwrite_size_T) sizeof buf,
(fwrite_size_T) 1, fp);
} }
static void static void
@ -1286,14 +1292,22 @@ const char * const name;
(void) exit(EXIT_FAILURE); (void) exit(EXIT_FAILURE);
} }
} }
convert(eitol(typecnt), tzh.tzh_ttisgmtcnt);
convert(eitol(typecnt), tzh.tzh_ttisstdcnt); convert(eitol(typecnt), tzh.tzh_ttisstdcnt);
convert(eitol(leapcnt), tzh.tzh_leapcnt); convert(eitol(leapcnt), tzh.tzh_leapcnt);
convert(eitol(timecnt), tzh.tzh_timecnt); convert(eitol(timecnt), tzh.tzh_timecnt);
convert(eitol(typecnt), tzh.tzh_typecnt); convert(eitol(typecnt), tzh.tzh_typecnt);
convert(eitol(charcnt), tzh.tzh_charcnt); convert(eitol(charcnt), tzh.tzh_charcnt);
(void) fwrite((genericptr_T) &tzh, #define DO(field) (void) fwrite((void *) tzh.field, \
(fwrite_size_T) sizeof tzh, (size_t) sizeof tzh.field, (size_t) 1, fp)
(fwrite_size_T) 1, fp); DO(tzh_reserved);
DO(tzh_ttisgmtcnt);
DO(tzh_ttisstdcnt);
DO(tzh_leapcnt);
DO(tzh_timecnt);
DO(tzh_typecnt);
DO(tzh_charcnt);
#undef DO
for (i = 0; i < timecnt; ++i) { for (i = 0; i < timecnt; ++i) {
j = leapcnt; j = leapcnt;
while (--j >= 0) while (--j >= 0)
@ -1304,18 +1318,16 @@ const char * const name;
puttzcode((long) ats[i], fp); puttzcode((long) ats[i], fp);
} }
if (timecnt > 0) if (timecnt > 0)
(void) fwrite((genericptr_T) types, (void) fwrite((void *) types, (size_t) sizeof types[0],
(fwrite_size_T) sizeof types[0], (size_t) timecnt, fp);
(fwrite_size_T) timecnt, fp);
for (i = 0; i < typecnt; ++i) { for (i = 0; i < typecnt; ++i) {
puttzcode((long) gmtoffs[i], fp); puttzcode((long) gmtoffs[i], fp);
(void) putc(isdsts[i], fp); (void) putc(isdsts[i], fp);
(void) putc(abbrinds[i], fp); (void) putc(abbrinds[i], fp);
} }
if (charcnt != 0) if (charcnt != 0)
(void) fwrite((genericptr_T) chars, (void) fwrite((void *) chars, (size_t) sizeof chars[0],
(fwrite_size_T) sizeof chars[0], (size_t) charcnt, fp);
(fwrite_size_T) charcnt, fp);
for (i = 0; i < leapcnt; ++i) { for (i = 0; i < leapcnt; ++i) {
if (roll[i]) { if (roll[i]) {
if (timecnt == 0 || trans[i] < ats[0]) { if (timecnt == 0 || trans[i] < ats[0]) {
@ -1337,6 +1349,8 @@ const char * const name;
} }
for (i = 0; i < typecnt; ++i) for (i = 0; i < typecnt; ++i)
(void) putc(ttisstds[i], fp); (void) putc(ttisstds[i], fp);
for (i = 0; i < typecnt; ++i)
(void) putc(ttisgmts[i], fp);
if (ferror(fp) || fclose(fp)) { if (ferror(fp) || fclose(fp)) {
(void) fprintf(stderr, "%s: Write error on ", progname); (void) fprintf(stderr, "%s: Write error on ", progname);
(void) perror(fullname); (void) perror(fullname);
@ -1344,6 +1358,25 @@ const char * const name;
} }
} }
static void
doabbr(abbr, format, letters, isdst)
char * const abbr;
const char * const format;
const char * const letters;
const int isdst;
{
if (strchr(format, '/') == NULL) {
if (letters == NULL)
(void) strcpy(abbr, format);
else (void) sprintf(abbr, format, letters);
} else if (isdst)
(void) strcpy(abbr, strchr(format, '/') + 1);
else {
(void) strcpy(abbr, format);
*strchr(abbr, '/') = '\0';
}
}
static void static void
outzone(zpfirst, zonecount) outzone(zpfirst, zonecount)
const struct zone * const zpfirst; const struct zone * const zpfirst;
@ -1360,6 +1393,7 @@ const int zonecount;
register long startoff; register long startoff;
register int startisdst; register int startisdst;
register int startttisstd; register int startttisstd;
register int startttisgmt;
register int type; register int type;
char startbuf[BUFSIZ]; char startbuf[BUFSIZ];
@ -1381,9 +1415,7 @@ const int zonecount;
** for noting the need to unconditionally initialize startttisstd. ** for noting the need to unconditionally initialize startttisstd.
*/ */
startttisstd = FALSE; startttisstd = FALSE;
#ifdef lint startttisgmt = FALSE;
starttime = 0;
#endif /* defined lint */
for (i = 0; i < zonecount; ++i) { for (i = 0; i < zonecount; ++i) {
zp = &zpfirst[i]; zp = &zpfirst[i];
usestart = i > 0 && (zp - 1)->z_untiltime > min_time; usestart = i > 0 && (zp - 1)->z_untiltime > min_time;
@ -1395,9 +1427,11 @@ const int zonecount;
startisdst = -1; startisdst = -1;
if (zp->z_nrules == 0) { if (zp->z_nrules == 0) {
stdoff = zp->z_stdoff; stdoff = zp->z_stdoff;
(void) strcpy(startbuf, zp->z_format); doabbr(startbuf, zp->z_format,
(char *) NULL, stdoff != 0);
type = addtype(oadd(zp->z_gmtoff, stdoff), type = addtype(oadd(zp->z_gmtoff, stdoff),
startbuf, stdoff != 0, startttisstd); startbuf, stdoff != 0, startttisstd,
startttisgmt);
if (usestart) if (usestart)
addtt(starttime, type); addtt(starttime, type);
else if (stdoff != 0) else if (stdoff != 0)
@ -1433,7 +1467,7 @@ const int zonecount;
** stdoff values. ** stdoff values.
*/ */
untiltime = zp->z_untiltime; untiltime = zp->z_untiltime;
if (!zp->z_untilrule.r_todisuniv) if (!zp->z_untilrule.r_todisgmt)
untiltime = tadd(untiltime, untiltime = tadd(untiltime,
-gmtoff); -gmtoff);
if (!zp->z_untilrule.r_todisstd) if (!zp->z_untilrule.r_todisstd)
@ -1445,16 +1479,13 @@ const int zonecount;
** that takes effect earliest in the year. ** that takes effect earliest in the year.
*/ */
k = -1; k = -1;
#ifdef lint
ktime = 0;
#endif /* defined lint */
for (j = 0; j < zp->z_nrules; ++j) { for (j = 0; j < zp->z_nrules; ++j) {
rp = &zp->z_rules[j]; rp = &zp->z_rules[j];
if (!rp->r_todo) if (!rp->r_todo)
continue; continue;
eats(zp->z_filename, zp->z_linenum, eats(zp->z_filename, zp->z_linenum,
rp->r_filename, rp->r_linenum); rp->r_filename, rp->r_linenum);
offset = rp->r_todisuniv ? 0 : gmtoff; offset = rp->r_todisgmt ? 0 : gmtoff;
if (!rp->r_todisstd) if (!rp->r_todisstd)
offset = oadd(offset, stdoff); offset = oadd(offset, stdoff);
jtime = rp->r_temp; jtime = rp->r_temp;
@ -1478,8 +1509,9 @@ const int zonecount;
stdoff = rp->r_stdoff; stdoff = rp->r_stdoff;
startoff = oadd(zp->z_gmtoff, startoff = oadd(zp->z_gmtoff,
rp->r_stdoff); rp->r_stdoff);
(void) sprintf(startbuf, zp->z_format, doabbr(startbuf, zp->z_format,
rp->r_abbrvar); rp->r_abbrvar,
rp->r_stdoff != 0);
startisdst = rp->r_stdoff != 0; startisdst = rp->r_stdoff != 0;
continue; continue;
} }
@ -1499,16 +1531,17 @@ const int zonecount;
&chars[abbrinds[type]]); &chars[abbrinds[type]]);
} }
if (startisdst >= 0) if (startisdst >= 0)
addtt(starttime, addtype(startoff, startbuf, startisdst, startttisstd)); addtt(starttime, addtype(startoff, startbuf, startisdst, startttisstd,
startttisgmt));
} }
} }
eats(zp->z_filename, zp->z_linenum, eats(zp->z_filename, zp->z_linenum,
rp->r_filename, rp->r_linenum); rp->r_filename, rp->r_linenum);
(void) sprintf(buf, zp->z_format, doabbr(buf, zp->z_format, rp->r_abbrvar,
rp->r_abbrvar); rp->r_stdoff != 0);
offset = oadd(zp->z_gmtoff, rp->r_stdoff); offset = oadd(zp->z_gmtoff, rp->r_stdoff);
type = addtype(offset, buf, rp->r_stdoff != 0, type = addtype(offset, buf, rp->r_stdoff != 0,
rp->r_todisstd); rp->r_todisstd, rp->r_todisgmt);
addtt(ktime, type); addtt(ktime, type);
stdoff = rp->r_stdoff; stdoff = rp->r_stdoff;
} }
@ -1519,6 +1552,7 @@ addtt(starttime, addtype(startoff, startbuf, startisdst, startttisstd));
if (useuntil) { if (useuntil) {
starttime = tadd(zp->z_untiltime, -gmtoff); starttime = tadd(zp->z_untiltime, -gmtoff);
startttisstd = zp->z_untilrule.r_todisstd; startttisstd = zp->z_untilrule.r_todisstd;
startttisgmt = zp->z_untilrule.r_todisgmt;
if (!startttisstd) if (!startttisstd)
starttime = tadd(starttime, -stdoff); starttime = tadd(starttime, -stdoff);
} }
@ -1545,11 +1579,12 @@ const int type;
} }
static int static int
addtype(gmtoff, abbr, isdst, ttisstd) addtype(gmtoff, abbr, isdst, ttisstd, ttisgmt)
const long gmtoff; const long gmtoff;
const char * const abbr; const char * const abbr;
const int isdst; const int isdst;
const int ttisstd; const int ttisstd;
const int ttisgmt;
{ {
register int i, j; register int i, j;
@ -1560,7 +1595,8 @@ const int ttisstd;
for (i = 0; i < typecnt; ++i) { for (i = 0; i < typecnt; ++i) {
if (gmtoff == gmtoffs[i] && isdst == isdsts[i] && if (gmtoff == gmtoffs[i] && isdst == isdsts[i] &&
strcmp(abbr, &chars[abbrinds[i]]) == 0 && strcmp(abbr, &chars[abbrinds[i]]) == 0 &&
ttisstd == ttisstds[i]) ttisstd == ttisstds[i] &&
ttisgmt == ttisgmts[i])
return i; return i;
} }
/* /*
@ -1574,6 +1610,7 @@ const int ttisstd;
gmtoffs[i] = gmtoff; gmtoffs[i] = gmtoff;
isdsts[i] = isdst; isdsts[i] = isdst;
ttisstds[i] = ttisstd; ttisstds[i] = ttisstd;
ttisgmts[i] = ttisgmt;
for (j = 0; j < charcnt; ++j) for (j = 0; j < charcnt; ++j)
if (strcmp(&chars[j], abbr) == 0) if (strcmp(&chars[j], abbr) == 0)
@ -1908,7 +1945,7 @@ char * const argname;
*cp = '\0'; *cp = '\0';
#ifndef unix #ifndef unix
/* /*
** MS-DOS drive specifier? ** DOS drive specifier?
*/ */
if (strlen(name) == 2 && isascii(name[0]) && if (strlen(name) == 2 && isascii(name[0]) &&
isalpha(name[0]) && name[1] == ':') { isalpha(name[0]) && name[1] == ':') {
@ -1920,7 +1957,7 @@ char * const argname;
/* /*
** It doesn't seem to exist, so we try to create it. ** It doesn't seem to exist, so we try to create it.
*/ */
if (emkdir(name, 0755) != 0) { if (mkdir(name, 0755) != 0) {
(void) fprintf(stderr, (void) fprintf(stderr,
"%s: Can't create directory ", "%s: Can't create directory ",
progname); progname);