Should not assume that files have x bit set for shell scripts in the
[unix-history] / share / zoneinfo / tzfile.5
CommitLineData
1bd76676
GW
1.TH TZFILE 5
2.SH NAME
3tzfile \- time zone information
4.SH SYNOPSIS
5.B
6#include <tzfile.h>
7.SH DESCRIPTION
15637ed4 8The time zone information files used by
1bd76676 9.IR tzset (3)
15637ed4
RG
10begin with bytes reserved for future use,
11followed by four four-byte values of type
1bd76676 12.BR long ,
15637ed4
RG
13written in a ``standard'' byte order
14(the high-order byte of the value is written first).
15These values are,
16in order:
1bd76676
GW
17.TP
18.I tzh_ttisstdcnt
15637ed4 19The number of standard/wall indicators stored in the file.
1bd76676
GW
20.TP
21.I tzh_leapcnt
15637ed4 22The number of leap seconds for which data is stored in the file.
1bd76676
GW
23.TP
24.I tzh_timecnt
15637ed4
RG
25The number of "transition times" for which data is stored
26in the file.
1bd76676
GW
27.TP
28.I tzh_typecnt
15637ed4
RG
29The number of "local time types" for which data is stored
30in the file (must not be zero).
1bd76676
GW
31.TP
32.I tzh_charcnt
15637ed4
RG
33The number of characters of "time zone abbreviation strings"
34stored in the file.
1bd76676 35.PP
15637ed4 36The above header is followed by
1bd76676 37.I tzh_timecnt
15637ed4 38four-byte values of type
1bd76676 39.BR long ,
15637ed4
RG
40sorted in ascending order.
41These values are written in ``standard'' byte order.
42Each is used as a transition time (as returned by
1bd76676 43.IR time (2))
15637ed4
RG
44at which the rules for computing local time change.
45Next come
1bd76676 46.I tzh_timecnt
15637ed4 47one-byte values of type
1bd76676 48.BR "unsigned char" ;
15637ed4
RG
49each one tells which of the different types of ``local time'' types
50described in the file is associated with the same-indexed transition time.
51These values serve as indices into an array of
1bd76676
GW
52.I ttinfo
53structures that appears next in the file;
15637ed4 54these structures are defined as follows:
1bd76676
GW
55.in +.5i
56.sp
57.nf
58.ta .5i +\w'unsigned int\0\0'u
59struct ttinfo {
15637ed4
RG
60 long tt_gmtoff;
61 int tt_isdst;
62 unsigned int tt_abbrind;
63};
1bd76676
GW
64.in -.5i
65.fi
66.sp
15637ed4 67Each structure is written as a four-byte value for
1bd76676 68.I tt_gmtoff
15637ed4 69of type
1bd76676 70.BR long ,
15637ed4 71in a standard byte order, followed by a one-byte value for
1bd76676 72.I tt_isdst
15637ed4 73and a one-byte value for
1bd76676 74.IR tt_abbrind .
15637ed4 75In each structure,
1bd76676 76.I tt_gmtoff
15637ed4 77gives the number of seconds to be added to GMT,
1bd76676 78.I tt_isdst
15637ed4 79tells whether
1bd76676 80.I tm_isdst
15637ed4 81should be set by
1bd76676 82.I localtime (3)
15637ed4 83and
1bd76676 84.I tt_abbrind
15637ed4
RG
85serves as an index into the array of time zone abbreviation characters
86that follow the
1bd76676 87.I ttinfo
15637ed4 88structure(s) in the file.
1bd76676 89.PP
15637ed4 90Then there are
1bd76676 91.I tzh_leapcnt
15637ed4
RG
92pairs of four-byte values, written in standard byte order;
93the first value of each pair gives the time
1bd76676
GW
94(as returned by
95.IR time(2))
15637ed4
RG
96at which a leap second occurs;
97the second gives the
1bd76676 98.I total
15637ed4
RG
99number of leap seconds to be applied after the given time.
100The pairs of values are sorted in ascending order by time.
1bd76676 101.PP
15637ed4 102Finally there are
1bd76676 103.I tzh_ttisstdcnt
15637ed4
RG
104standard/wall indicators, each stored as a one-byte value;
105they tell whether the transition times associated with local time types
106were specified as standard time or wall clock time,
1bd76676 107and are used when a time zone file is used in handling POSIX-style
15637ed4 108time zone environment variables.
1bd76676
GW
109.PP
110.I Localtime
15637ed4 111uses the first standard-time
1bd76676 112.I ttinfo
15637ed4
RG
113structure in the file
114(or simply the first
1bd76676 115.I ttinfo
15637ed4
RG
116structure in the absence of a standard-time structure)
117if either
1bd76676 118.I tzh_timecnt
15637ed4
RG
119is zero or the time argument is less than the first transition time recorded
120in the file.
1bd76676
GW
121.SH SEE ALSO
122newctime(3)
123.\" @(#)tzfile.5 7.2