Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:29

0001 /* Layout and location of TZif files.  */
0002 
0003 #ifndef TZFILE_H
0004 
0005 #define TZFILE_H
0006 
0007 /*
0008 ** This file is in the public domain, so clarified as of
0009 ** 1996-06-05 by Arthur David Olson.
0010 */
0011 
0012 /*
0013 ** This header is for use ONLY with the time conversion code.
0014 ** There is no guarantee that it will remain unchanged,
0015 ** or that it will remain at all.
0016 ** Do NOT copy it to any system include directory.
0017 ** Thank you!
0018 */
0019 
0020 /*
0021 ** Information about time zone files.
0022 */
0023 
0024 #ifndef TZDEFRULES
0025 #define TZDEFRULES "posixrules"
0026 #endif /* !defined TZDEFRULES */
0027 
0028 /* See Internet RFC 8536 for more details about the following format.  */
0029 
0030 /*
0031 ** Each file begins with. . .
0032 */
0033 
0034 #define TZ_MAGIC "TZif"
0035 
0036 struct tzhead {
0037   char tzh_magic[4];      /* TZ_MAGIC */
0038   char tzh_version[1];    /* '\0' or '2'-'4' as of 2021 */
0039   char tzh_reserved[15];  /* reserved; must be zero */
0040   char tzh_ttisutcnt[4];  /* coded number of trans. time flags */
0041   char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
0042   char tzh_leapcnt[4];    /* coded number of leap seconds */
0043   char tzh_timecnt[4];    /* coded number of transition times */
0044   char tzh_typecnt[4];    /* coded number of local time types */
0045   char tzh_charcnt[4];    /* coded number of abbr. chars */
0046 };
0047 
0048 /*
0049 ** . . .followed by. . .
0050 **
0051 **  tzh_timecnt (char [4])s     coded transition times a la time(2)
0052 **  tzh_timecnt (unsigned char)s    types of local time starting at above
0053 **  tzh_typecnt repetitions of
0054 **      one (char [4])      coded UT offset in seconds
0055 **      one (unsigned char) used to set tm_isdst
0056 **      one (unsigned char) that's an abbreviation list index
0057 **  tzh_charcnt (char)s     '\0'-terminated zone abbreviations
0058 **  tzh_leapcnt repetitions of
0059 **      one (char [4])      coded leap second transition times
0060 **      one (char [4])      total correction after above
0061 **  tzh_ttisstdcnt (char)s      indexed by type; if 1, transition
0062 **                  time is standard time, if 0,
0063 **                  transition time is local (wall clock)
0064 **                  time; if absent, transition times are
0065 **                  assumed to be local time
0066 **  tzh_ttisutcnt (char)s       indexed by type; if 1, transition
0067 **                  time is UT, if 0, transition time is
0068 **                  local time; if absent, transition
0069 **                  times are assumed to be local time.
0070 **                  When this is 1, the corresponding
0071 **                  std/wall indicator must also be 1.
0072 */
0073 
0074 /*
0075 ** If tzh_version is '2' or greater, the above is followed by a second instance
0076 ** of tzhead and a second instance of the data in which each coded transition
0077 ** time uses 8 rather than 4 chars,
0078 ** then a POSIX-TZ-environment-variable-style string for use in handling
0079 ** instants after the last transition time stored in the file
0080 ** (with nothing between the newlines if there is no POSIX.1-2017
0081 ** representation for such instants).
0082 **
0083 ** If tz_version is '3' or greater, the above is extended as follows.
0084 ** First, the TZ string's hour offset may range from -167
0085 ** through 167 as compared to the POSIX-required 0 through 24.
0086 ** Second, its DST start time may be January 1 at 00:00 and its stop
0087 ** time December 31 at 24:00 plus the difference between DST and
0088 ** standard time, indicating DST all year.
0089 */
0090 
0091 /*
0092 ** In the current implementation, "tzset()" refuses to deal with files that
0093 ** exceed any of the limits below.
0094 */
0095 
0096 #ifndef TZ_MAX_TIMES
0097 /* This must be at least 242 for Europe/London with 'zic -b fat'.  */
0098 #define TZ_MAX_TIMES 2000
0099 #endif /* !defined TZ_MAX_TIMES */
0100 
0101 #ifndef TZ_MAX_TYPES
0102 /* This must be at least 18 for Europe/Vilnius with 'zic -b fat'.  */
0103 #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
0104 #endif                   /* !defined TZ_MAX_TYPES */
0105 
0106 #ifndef TZ_MAX_CHARS
0107 /* This must be at least 40 for America/Anchorage.  */
0108 #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
0109                         /* (limited by what unsigned chars can hold) */
0110 #endif                  /* !defined TZ_MAX_CHARS */
0111 
0112 #ifndef TZ_MAX_LEAPS
0113 /* This must be at least 27 for leap seconds from 1972 through mid-2023.
0114    There's a plan to discontinue leap seconds by 2035.  */
0115 #define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
0116 #endif                  /* !defined TZ_MAX_LEAPS */
0117 
0118 #endif /* !defined TZFILE_H */