1 /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
2 #ifndef __dj_include_tzfile_h__
3 #define __dj_include_tzfile_h__
9 #ifndef __dj_ENFORCE_ANSI_FREESTANDING
11 #ifndef __STRICT_ANSI__
16 * Copyright (c) 1988 Regents of the University of California.
17 * All rights reserved.
19 * This code is derived from software contributed to Berkeley by
20 * Arthur David Olson of the National Cancer Institute.
22 * Redistribution and use in source and binary forms are permitted provided
23 * that: (1) source distributions retain this entire copyright notice and
24 * comment, and (2) distributions including binaries display the following
25 * acknowledgement: ``This product includes software developed by the
26 * University of California, Berkeley and its contributors'' in the
27 * documentation or other materials provided with the distribution and in
28 * all advertising materials mentioning features or use of this software.
29 * Neither the name of the University nor the names of its contributors may
30 * be used to endorse or promote products derived from this software without
31 * specific prior written permission.
32 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
33 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
34 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
36 * @(#)tzfile.h 5.9 (Berkeley) 6/11/90
40 ** Information about time zone files.
43 /* Time zone object file directory */
44 #define TZDIR "/usr/share/zoneinfo"
45 #define TZDEFAULT "/etc/localtime"
46 #define TZDEFRULES "posixrules"
49 ** Each file begins with. . .
53 char tzh_reserved[24]; /* reserved for future use */
54 char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
55 char tzh_leapcnt[4]; /* coded number of leap seconds */
56 char tzh_timecnt[4]; /* coded number of transition times */
57 char tzh_typecnt[4]; /* coded number of local time types */
58 char tzh_charcnt[4]; /* coded number of abbr. chars */
62 ** . . .followed by. . .
64 ** tzh_timecnt (char [4])s coded transition times a la time(2)
65 ** tzh_timecnt (unsigned char)s types of local time starting at above
66 ** tzh_typecnt repetitions of
67 ** one (char [4]) coded GMT offset in seconds
68 ** one (unsigned char) used to set tm_isdst
69 ** one (unsigned char) that's an abbreviation list index
70 ** tzh_charcnt (char)s '\0'-terminated zone abbreviations
71 ** tzh_leapcnt repetitions of
72 ** one (char [4]) coded leap second transition times
73 ** one (char [4]) total correction after above
74 ** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
75 ** time is standard time, if FALSE,
76 ** transition time is wall clock time
77 ** if absent, transition times are
78 ** assumed to be wall clock time
82 ** In the current implementation, "tzset()" refuses to deal with files that
83 ** exceed any of the limits below.
87 ** The TZ_MAX_TIMES value below is enough to handle a bit more than a
88 ** year's worth of solar time (corrected daily to the nearest second) or
89 ** 138 years of Pacific Presidential Election time
90 ** (where there are three time zone transitions every fourth year).
92 #define TZ_MAX_TIMES 370
94 #define NOSOLAR /* 4BSD doesn't currently handle solar time */
97 #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
99 #define TZ_MAX_TYPES 10 /* Maximum number of local time types */
102 #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
104 #define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
106 #define SECSPERMIN 60
107 #define MINSPERHOUR 60
108 #define HOURSPERDAY 24
109 #define DAYSPERWEEK 7
110 #define DAYSPERNYEAR 365
111 #define DAYSPERLYEAR 366
112 #define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
113 #define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY)
114 #define MONSPERYEAR 12
119 #define TM_WEDNESDAY 3
120 #define TM_THURSDAY 4
122 #define TM_SATURDAY 6
125 #define TM_FEBRUARY 1
132 #define TM_SEPTEMBER 8
134 #define TM_NOVEMBER 10
135 #define TM_DECEMBER 11
137 #define TM_YEAR_BASE 1900
139 #define EPOCH_YEAR 1970
140 #define EPOCH_WDAY TM_THURSDAY
143 ** Accurate only for the past couple of centuries;
144 ** that will probably do.
147 #define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
149 #endif /* !_POSIX_SOURCE */
150 #endif /* !__STRICT_ANSI__ */
151 #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
153 #ifndef __dj_ENFORCE_FUNCTION_CALLS
154 #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
160 #endif /* __dj_include_tzfile_h__ */