00001 /* Layout and location of TZif files. */ 00002 00003 #ifndef TZFILE_H 00004 00005 #define TZFILE_H 00006 00007 /* 00008 ** This file is in the public domain, so clarified as of 00009 ** 1996-06-05 by Arthur David Olson. 00010 */ 00011 00012 /* 00013 ** This header is for use ONLY with the time conversion code. 00014 ** There is no guarantee that it will remain unchanged, 00015 ** or that it will remain at all. 00016 ** Do NOT copy it to any system include directory. 00017 ** Thank you! 00018 */ 00019 00020 /* 00021 ** Information about time zone files. 00022 */ 00023 00024 #ifndef TZDIR 00025 #define TZDIR "/usr/share/zoneinfo" /* Time zone object file directory */ 00026 #endif /* !defined TZDIR */ 00027 00028 #ifndef TZDEFAULT 00029 #define TZDEFAULT "/etc/localtime" 00030 #endif /* !defined TZDEFAULT */ 00031 00032 #ifndef TZDEFRULES 00033 #define TZDEFRULES "posixrules" 00034 #endif /* !defined TZDEFRULES */ 00035 00036 00037 /* See Internet RFC 8536 for more details about the following format. */ 00038 00039 /* 00040 ** Each file begins with. . . 00041 */ 00042 00043 #define TZ_MAGIC "TZif" 00044 00045 struct tzhead { 00046 char tzh_magic[4]; /* TZ_MAGIC */ 00047 char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */ 00048 char tzh_reserved[15]; /* reserved; must be zero */ 00049 char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */ 00050 char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */ 00051 char tzh_leapcnt[4]; /* coded number of leap seconds */ 00052 char tzh_timecnt[4]; /* coded number of transition times */ 00053 char tzh_typecnt[4]; /* coded number of local time types */ 00054 char tzh_charcnt[4]; /* coded number of abbr. chars */ 00055 }; 00056 00057 /* 00058 ** . . .followed by. . . 00059 ** 00060 ** tzh_timecnt (char [4])s coded transition times a la time(2) 00061 ** tzh_timecnt (unsigned char)s types of local time starting at above 00062 ** tzh_typecnt repetitions of 00063 ** one (char [4]) coded UT offset in seconds 00064 ** one (unsigned char) used to set tm_isdst 00065 ** one (unsigned char) that's an abbreviation list index 00066 ** tzh_charcnt (char)s '\0'-terminated zone abbreviations 00067 ** tzh_leapcnt repetitions of 00068 ** one (char [4]) coded leap second transition times 00069 ** one (char [4]) total correction after above 00070 ** tzh_ttisstdcnt (char)s indexed by type; if 1, transition 00071 ** time is standard time, if 0, 00072 ** transition time is wall clock time 00073 ** if absent, transition times are 00074 ** assumed to be wall clock time 00075 ** tzh_ttisgmtcnt (char)s indexed by type; if 1, transition 00076 ** time is UT, if 0, 00077 ** transition time is local time 00078 ** if absent, transition times are 00079 ** assumed to be local time 00080 */ 00081 00082 /* 00083 ** If tzh_version is '2' or greater, the above is followed by a second instance 00084 ** of tzhead and a second instance of the data in which each coded transition 00085 ** time uses 8 rather than 4 chars, 00086 ** then a POSIX-TZ-environment-variable-style std::string for use in handling 00087 ** instants after the last transition time stored in the file 00088 ** (with nothing between the newlines if there is no POSIX representation for 00089 ** such instants). 00090 ** 00091 ** If tz_version is '3' or greater, the above is extended as follows. 00092 ** First, the POSIX TZ std::string's hour offset may range from -167 00093 ** through 167 as compared to the POSIX-required 0 through 24. 00094 ** Second, its DST start time may be January 1 at 00:00 and its stop 00095 ** time December 31 at 24:00 plus the difference between DST and 00096 ** standard time, indicating DST all year. 00097 */ 00098 00099 /* 00100 ** In the current implementation, "tzset()" refuses to deal with files that 00101 ** exceed any of the limits below. 00102 */ 00103 00104 #ifndef TZ_MAX_TIMES 00105 #define TZ_MAX_TIMES 2000 00106 #endif /* !defined TZ_MAX_TIMES */ 00107 00108 #ifndef TZ_MAX_TYPES 00109 /* This must be at least 17 for Europe/Samara and Europe/Vilnius. */ 00110 #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */ 00111 #endif /* !defined TZ_MAX_TYPES */ 00112 00113 #ifndef TZ_MAX_CHARS 00114 #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ 00115 /* (limited by what unsigned chars can hold) */ 00116 #endif /* !defined TZ_MAX_CHARS */ 00117 00118 #ifndef TZ_MAX_LEAPS 00119 #define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */ 00120 #endif /* !defined TZ_MAX_LEAPS */ 00121 00122 #endif /* !defined TZFILE_H */