]>
Commit | Line | Data |
---|---|---|
2aa62f2b | 1 | /** @file\r |
2 | Time Zone processing, declarations and macros.\r | |
3 | \r | |
53e1e5c6 | 4 | Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r |
2aa62f2b | 5 | This program and the accompanying materials are licensed and made available under\r |
6 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
7 | The full text of the license may be found at\r | |
53e1e5c6 | 8 | http://opensource.org/licenses/bsd-license.\r |
2aa62f2b | 9 | \r |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | Derived from the NIH time zone package file, tzfile.h, which contains the following notice:\r | |
14 | \r | |
15 | This file is in the public domain, so clarified as of\r | |
16 | 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).\r | |
17 | \r | |
18 | This header is for use ONLY with the time conversion code.\r | |
19 | There is no guarantee that it will remain unchanged,\r | |
20 | or that it will remain at all.\r | |
21 | Do NOT copy it to any system include directory.\r | |
22 | Thank you!\r | |
23 | \r | |
24 | NetBSD: tzfile.h,v 1.8 1998/01/22 07:06:59 jtc Exp\r | |
25 | **/\r | |
26 | #ifndef TZFILE_H\r | |
27 | #define TZFILE_H\r | |
28 | \r | |
29 | /*\r | |
30 | ** Information about time zone files.\r | |
31 | */\r | |
32 | \r | |
33 | #ifndef TZDIR /* Time zone object file directory */\r | |
34 | #define TZDIR "/usr/share/zoneinfo"\r | |
35 | #endif /* !defined TZDIR */\r | |
36 | \r | |
37 | #ifndef TZDEFAULT\r | |
38 | #define TZDEFAULT "/etc/localtime"\r | |
39 | #endif /* !defined TZDEFAULT */\r | |
40 | \r | |
41 | #ifndef TZDEFRULES\r | |
42 | #define TZDEFRULES "posixrules"\r | |
43 | #endif /* !defined TZDEFRULES */\r | |
44 | \r | |
45 | /*\r | |
46 | ** Each file begins with. . .\r | |
47 | */\r | |
48 | \r | |
49 | #define TZ_MAGIC "TZif"\r | |
50 | \r | |
51 | struct tzhead {\r | |
52 | char tzh_magic[4]; /* TZ_MAGIC */\r | |
53 | char tzh_reserved[16]; /* reserved for future use */\r | |
54 | char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */\r | |
55 | char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */\r | |
56 | char tzh_leapcnt[4]; /* coded number of leap seconds */\r | |
57 | char tzh_timecnt[4]; /* coded number of transition times */\r | |
58 | char tzh_typecnt[4]; /* coded number of local time types */\r | |
59 | char tzh_charcnt[4]; /* coded number of abbr. chars */\r | |
60 | };\r | |
61 | \r | |
62 | /*\r | |
63 | ** . . .followed by. . .\r | |
64 | **\r | |
65 | ** tzh_timecnt (char [4])s coded transition times a la time(2)\r | |
66 | ** tzh_timecnt (unsigned char)s types of local time starting at above\r | |
67 | ** tzh_typecnt repetitions of\r | |
68 | ** one (char [4]) coded UTC offset in seconds\r | |
69 | ** one (unsigned char) used to set tm_isdst\r | |
70 | ** one (unsigned char) that's an abbreviation list index\r | |
71 | ** tzh_charcnt (char)s '\0'-terminated zone abbreviations\r | |
72 | ** tzh_leapcnt repetitions of\r | |
73 | ** one (char [4]) coded leap second transition times\r | |
74 | ** one (char [4]) total correction after above\r | |
75 | ** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition\r | |
76 | ** time is standard time, if FALSE,\r | |
77 | ** transition time is wall clock time\r | |
78 | ** if absent, transition times are\r | |
79 | ** assumed to be wall clock time\r | |
80 | ** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition\r | |
81 | ** time is UTC, if FALSE,\r | |
82 | ** transition time is local time\r | |
83 | ** if absent, transition times are\r | |
84 | ** assumed to be local time\r | |
85 | */\r | |
86 | \r | |
87 | /*\r | |
88 | ** In the current implementation, "tzset()" refuses to deal with files that\r | |
89 | ** exceed any of the limits below.\r | |
90 | */\r | |
91 | \r | |
92 | #ifndef TZ_MAX_TIMES\r | |
93 | /*\r | |
94 | ** The TZ_MAX_TIMES value below is enough to handle a bit more than a\r | |
95 | ** year's worth of solar time (corrected daily to the nearest second) or\r | |
96 | ** 138 years of Pacific Presidential Election time\r | |
97 | ** (where there are three time zone transitions every fourth year).\r | |
98 | */\r | |
99 | #define TZ_MAX_TIMES 370\r | |
100 | #endif /* !defined TZ_MAX_TIMES */\r | |
101 | \r | |
102 | #ifndef TZ_MAX_TYPES\r | |
103 | #ifndef NOSOLAR\r | |
104 | #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */\r | |
105 | #endif /* !defined NOSOLAR */\r | |
106 | #ifdef NOSOLAR\r | |
107 | /*\r | |
108 | ** Must be at least 14 for Europe/Riga as of Jan 12 1995,\r | |
109 | ** as noted by Earl Chew <earl@hpato.aus.hp.com>.\r | |
110 | */\r | |
111 | #define TZ_MAX_TYPES 20 /* Maximum number of local time types */\r | |
112 | #endif /* !defined NOSOLAR */\r | |
113 | #endif /* !defined TZ_MAX_TYPES */\r | |
114 | \r | |
115 | #ifndef TZ_MAX_CHARS\r | |
116 | #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */\r | |
117 | /* (limited by what unsigned chars can hold) */\r | |
118 | #endif /* !defined TZ_MAX_CHARS */\r | |
119 | \r | |
120 | #ifndef TZ_MAX_LEAPS\r | |
121 | #define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */\r | |
122 | #endif /* !defined TZ_MAX_LEAPS */\r | |
123 | \r | |
124 | #define SECSPERMIN 60\r | |
125 | #define MINSPERHOUR 60\r | |
126 | #define HOURSPERDAY 24\r | |
127 | #define DAYSPERWEEK 7\r | |
128 | #define DAYSPERNYEAR 365\r | |
129 | #define DAYSPERLYEAR 366\r | |
130 | #define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)\r | |
131 | #define SECSPERDAY ((LONG32)(SECSPERHOUR * HOURSPERDAY))\r | |
132 | #define MONSPERYEAR 12\r | |
133 | \r | |
2aa62f2b | 134 | #define EPOCH_YEAR 1970\r |
135 | #define EPOCH_WDAY TM_THURSDAY // Use this for 32-bit time_t\r | |
136 | //#define EPOCH_WDAY TM_SUNDAY // Use this for 64-bit time_t\r | |
137 | \r | |
138 | /*\r | |
139 | ** Accurate only for the past couple of centuries;\r | |
140 | ** that will probably do.\r | |
141 | */\r | |
142 | \r | |
143 | #define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))\r | |
144 | \r | |
145 | #endif /* !defined TZFILE_H */\r |