struct tzhead { char tzh_reserved[14]; unsigned short tzh_timecnt; unsigned short tzh_typecnt; unsigned short tzh_charcnt; };
The tzh_reserved element is currently unused. The tzh_timecnt element gives the number of "transition times" for which data is stored in the file; the tzh_typecnt (which must not be zero) element gives the number of "local time types" for which data is stored in the file; and the tzh_charcnt element gives the number of characters of "time zone abbreviation strings" stored in the file.
The above header is followed by tzh_timecnt values of type long, sorted in ascending order; each is used as a transition time (as returned by time(2)) at which the rules for computing local time change. Next come tzh_timecnt values of type unsigned char; each one tells which of the different types of "local time" described in the file is associated with the same-indexed transition time. These values serve as indices into an array of ttinfo structures that appears next in the file; these structures are defined as follows:
struct ttinfo { long tt_gmtoff; int tt_isdst; unsigned int tt_abbrind; };
In each structure, tt_gmtoff gives the number of seconds to be added to GMT, tt_isdst tells whether tm_isdst should be set by newlocaltime(3), and tt_abbrind serves as an index into the array of time zone abbreviation chaaracters that follow the ttinfo structure(s) in the file.
Newlocaltime uses the first ttinfo structure in the file if either tzh_timecnt is zero or newlocaltime's argument is less than the first transition time recorded in the file.