4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 * from Arthur Olson's 6.1
38 * Information about time zone files.
41 #define TZDIR "/usr/share/zoneinfo" /* Time zone object file directory */
43 #define TZDEFAULT (getenv("TZ"))
45 #define TZDEFRULES "posixrules"
48 * Each file begins with. . .
52 char tzh_reserved
[24]; /* reserved for future use */
53 char tzh_ttisstdcnt
[4]; /* coded number of trans. time flags */
54 char tzh_leapcnt
[4]; /* coded number of leap seconds */
55 char tzh_timecnt
[4]; /* coded number of transition times */
56 char tzh_typecnt
[4]; /* coded number of local time types */
57 char tzh_charcnt
[4]; /* coded number of abbr. chars */
61 * . . .followed by. . .
63 * tzh_timecnt (char [4])s coded transition times a la time(2)
64 * tzh_timecnt (unsigned char)s types of local time starting at above
65 * tzh_typecnt repetitions of
66 * one (char [4]) coded GMT offset in seconds
67 * one (unsigned char) used to set tm_isdst
68 * one (unsigned char) that's an abbreviation list index
69 * tzh_charcnt (char)s '\0'-terminated zone abbreviations
70 * tzh_leapcnt repetitions of
71 * one (char [4]) coded leap second transition times
72 * one (char [4]) total correction after above
73 * tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
74 * time is standard time, if FALSE,
75 * transition time is wall clock time
76 * if absent, transition times are
77 * assumed to be wall clock time
81 * In the current implementation, "tzset()" refuses to deal with files that
82 * exceed any of the limits below.
86 * The TZ_MAX_TIMES value below is enough to handle a bit more than a
87 * year's worth of solar time (corrected daily to the nearest second) or
88 * 138 years of Pacific Presidential Election time
89 * (where there are three time zone transitions every fourth year).
91 #define TZ_MAX_TIMES 370
93 #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
95 #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
97 #define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
100 #define MINSPERHOUR 60
101 #define HOURSPERDAY 24
102 #define DAYSPERWEEK 7
103 #define DAYSPERNYEAR 365
104 #define DAYSPERLYEAR 366
105 #define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
106 #define SECSPERDAY ((long)SECSPERHOUR * HOURSPERDAY)
107 #define MONSPERYEAR 12
112 #define TM_WEDNESDAY 3
113 #define TM_THURSDAY 4
115 #define TM_SATURDAY 6
118 #define TM_FEBRUARY 1
125 #define TM_SEPTEMBER 8
127 #define TM_NOVEMBER 10
128 #define TM_DECEMBER 11
130 #define TM_YEAR_BASE 1900
132 #define EPOCH_YEAR 1970
133 #define EPOCH_WDAY TM_THURSDAY
136 * Accurate only for the past couple of centuries;
137 * that will probably do.
140 #define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
143 * Use of the underscored variants may cause problems if you move your code to
144 * certain System-V-based systems; for maximum portability, use the
145 * underscore-free variants. The underscored variants are provided for
146 * backward compatibility only; they may disappear from future versions of
150 #define SECS_PER_MIN SECSPERMIN
151 #define MINS_PER_HOUR MINSPERHOUR
152 #define HOURS_PER_DAY HOURSPERDAY
153 #define DAYS_PER_WEEK DAYSPERWEEK
154 #define DAYS_PER_NYEAR DAYSPERNYEAR
155 #define DAYS_PER_LYEAR DAYSPERLYEAR
156 #define SECS_PER_HOUR SECSPERHOUR
157 #define SECS_PER_DAY SECSPERDAY
158 #define MONS_PER_YEAR MONSPERYEAR
164 #endif /* _SYS_TZFILE_H */