OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / original / man5 / tzfile.5
1 .\" @(#)tzfile.5        7.11
2 .\" This file is in the public domain, so clarified as of
3 .\" 1996-06-05 by Arthur David Olson <arthur_david_olson@nih.gov>.
4 .TH TZFILE 5 1996-06-05 "" "Linux Programmer's Manual"
5 .SH NAME
6 tzfile \- timezone information
7 .SH SYNOPSIS
8 .B #include <tzfile.h>
9 .SH DESCRIPTION
10 The timezone information files used by
11 .BR tzset (3)
12 begin with the magic characters "TZif" to identify then as
13 timezone information files,
14 followed by sixteen bytes reserved for future use,
15 followed by six four-byte values of type
16 .IR long ,
17 written in a "standard" byte order
18 (the high-order byte of the value is written first).
19 These values are,
20 in order:
21 .TP
22 .I tzh_ttisgmtcnt
23 The number of UTC/local indicators stored in the file.
24 .TP
25 .I tzh_ttisstdcnt
26 The number of standard/wall indicators stored in the file.
27 .TP
28 .I tzh_leapcnt
29 The number of leap seconds for which data is stored in the file.
30 .TP
31 .I tzh_timecnt
32 The number of "transition times" for which data is stored
33 in the file.
34 .TP
35 .I tzh_typecnt
36 The number of "local time types" for which data is stored
37 in the file (must not be zero).
38 .TP
39 .I tzh_charcnt
40 The number of characters of "timezone abbreviation strings"
41 stored in the file.
42 .PP
43 The above header is followed by
44 .I tzh_timecnt
45 four-byte values of type
46 .IR long ,
47 sorted in ascending order.
48 These values are written in "standard" byte order.
49 Each is used as a transition time (as returned by
50 .BR time (2))
51 at which the rules for computing local time change.
52 Next come
53 .I tzh_timecnt
54 one-byte values of type
55 .IR "unsigned char" ;
56 each one tells which of the different types of "local time" types
57 described in the file is associated with the same-indexed transition time.
58 These values serve as indices into an array of
59 .I ttinfo
60 structures that appears next in the file;
61 these structures are defined as follows:
62 .in +4n
63 .sp
64 .nf
65 struct ttinfo {
66     long         tt_gmtoff;
67     int          tt_isdst;
68     unsigned int tt_abbrind;
69 };
70 .in
71 .fi
72 .sp
73 Each structure is written as a four-byte value for
74 .I tt_gmtoff
75 of type
76 .IR long ,
77 in a standard byte order, followed by a one-byte value for
78 .I tt_isdst
79 and a one-byte value for
80 .IR tt_abbrind .
81 In each structure,
82 .I tt_gmtoff
83 gives the number of seconds to be added to UTC,
84 .I tt_isdst
85 tells whether
86 .I tm_isdst
87 should be set by
88 .BR localtime (3),
89 and
90 .I tt_abbrind
91 serves as an index into the array of timezone abbreviation characters
92 that follow the
93 .I ttinfo
94 structure(s) in the file.
95 .PP
96 Then there are
97 .I tzh_leapcnt
98 pairs of four-byte values, written in standard byte order;
99 the first value of each pair gives the time
100 (as returned by
101 .BR time (2))
102 at which a leap second occurs;
103 the second gives the
104 .I total
105 number of leap seconds to be applied after the given time.
106 The pairs of values are sorted in ascending order by time.
107 .PP
108 Then there are
109 .I tzh_ttisstdcnt
110 standard/wall indicators, each stored as a one-byte value;
111 they tell whether the transition times associated with local time types
112 were specified as standard time or wall clock time,
113 and are used when a timezone file is used in handling POSIX-style
114 timezone environment variables.
115 .PP
116 Finally, there are
117 .I tzh_ttisgmtcnt
118 UTC/local indicators, each stored as a one-byte value;
119 they tell whether the transition times associated with local time types
120 were specified as UTC or local time,
121 and are used when a timezone file is used in handling POSIX-style
122 timezone environment variables.
123 .PP
124 .I Localtime
125 uses the first standard-time
126 .I ttinfo
127 structure in the file
128 (or simply the first
129 .I ttinfo
130 structure in the absence of a standard-time structure)
131 if either
132 .I tzh_timecnt
133 is zero or the time argument is less than the first transition time recorded
134 in the file.