Commit | Line | Data |
---|---|---|
6949fc73 | 1 | /* |
23008b13 | 2 | * @(#)tzfile.h 5.2 tzfile.h %G% |
6949fc73 KB |
3 | */ |
4 | ||
5 | /* | |
6 | ** Information about time zone files. | |
7 | */ | |
8 | ||
9 | #define TZDIR "/etc/zoneinfo" /* Time zone object file directory */ | |
10 | #define TZDEFAULT "localtime" | |
11 | ||
12 | /* | |
13 | ** Each file begins with. . . | |
14 | */ | |
15 | ||
16 | struct tzhead { | |
17 | char tzh_reserved[32]; /* reserved for future use */ | |
18 | char tzh_timecnt[4]; /* coded number of transition times */ | |
19 | char tzh_typecnt[4]; /* coded number of local time types */ | |
20 | char tzh_charcnt[4]; /* coded number of abbr. chars */ | |
21 | }; | |
22 | ||
23 | /* | |
24 | ** . . .followed by. . . | |
25 | ** | |
26 | ** tzh_timecnt (char [4])s coded transition times a la time(2) | |
27 | ** tzh_timecnt (unsigned char)s types of local time starting at above | |
28 | ** tzh_typecnt repetitions of | |
29 | ** one (char [4]) coded GMT offset in seconds | |
30 | ** one (unsigned char) used to set tm_isdt | |
31 | ** one (unsigned char) that's an abbreviation list index | |
32 | ** tzh_charcnt (char)s '\0'-terminated zone abbreviaton strings | |
33 | */ | |
34 | ||
35 | /* | |
36 | ** In the current implementation, "tzset()" refuses to deal with files that | |
37 | ** exceed any of the limits below. | |
38 | */ | |
39 | ||
40 | /* | |
41 | ** The TZ_MAX_TIMES value below is enough to handle a bit more than a | |
42 | ** year's worth of solar time (corrected daily to the nearest second) or | |
43 | ** 138 years of Pacific Presidential Election time | |
44 | ** (where there are three time zone transitions every fourth year). | |
45 | */ | |
46 | #define TZ_MAX_TIMES 370 | |
47 | ||
48 | #define NOSOLAR /* We currently don't handle solar time */ | |
49 | ||
50 | #ifndef NOSOLAR | |
51 | #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */ | |
52 | #else /* !NOSOLAR */ | |
53 | #define TZ_MAX_TYPES 10 /* Maximum number of local time types */ | |
54 | #endif /* !NOSOLAR */ | |
55 | ||
56 | #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ | |
57 | ||
58 | #define SECS_PER_MIN 60 | |
59 | #define MINS_PER_HOUR 60 | |
60 | #define HOURS_PER_DAY 24 | |
61 | #define DAYS_PER_WEEK 7 | |
62 | #define DAYS_PER_NYEAR 365 | |
63 | #define DAYS_PER_LYEAR 366 | |
64 | #define SECS_PER_HOUR (SECS_PER_MIN * MINS_PER_HOUR) | |
65 | #define SECS_PER_DAY ((long) SECS_PER_HOUR * HOURS_PER_DAY) | |
66 | #define MONS_PER_YEAR 12 | |
67 | ||
68 | #define TM_SUNDAY 0 | |
69 | #define TM_MONDAY 1 | |
70 | #define TM_TUESDAY 2 | |
71 | #define TM_WEDNESDAY 3 | |
72 | #define TM_THURSDAY 4 | |
73 | #define TM_FRIDAY 5 | |
74 | #define TM_SATURDAY 6 | |
75 | ||
76 | #define TM_JANUARY 0 | |
77 | #define TM_FEBRUARY 1 | |
78 | #define TM_MARCH 2 | |
79 | #define TM_APRIL 3 | |
80 | #define TM_MAY 4 | |
81 | #define TM_JUNE 5 | |
82 | #define TM_JULY 6 | |
83 | #define TM_AUGUST 7 | |
84 | #define TM_SEPTEMBER 8 | |
85 | #define TM_OCTOBER 9 | |
86 | #define TM_NOVEMBER 10 | |
87 | #define TM_DECEMBER 11 | |
88 | #define TM_SUNDAY 0 | |
89 | ||
90 | #define TM_YEAR_BASE 1900 | |
91 | ||
92 | #define EPOCH_YEAR 1970 | |
93 | #define EPOCH_WDAY TM_THURSDAY | |
94 | ||
95 | /* | |
96 | ** Accurate only for the past couple of centuries; | |
97 | ** that will probably do. | |
98 | */ | |
99 | ||
100 | #define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0) |