[tz] Decoding timezone data

Zefram zefram at fysh.org
Tue Nov 8 11:45:43 UTC 2011

Ian Abbott wrote:
>As an aside, maybe tzfile.5 should use exact-width integer type names
>from C99 stdint.h, such as "int32_t" instead of "long".

I think it would make more sense to excise the C terminology in favour
of file format terminology: "four-byte big-endian signed integer".

>As an other aside, is there a better way to describe the in-file layout
>of the ttinfo array members than using a C struct?

Exactly what follows the struct code:

    Each structure is written as a four-byte value for tt_gmtoff
    of type long, in a standard byte order, followed by a one-
    byte value for tt_isdst and a one-byte value for tt_abbrind.

In file format terminology, that would be:

    Each ttinfo structure consists of a four-byte big-endian signed
    integer tt_gmtoff, a one-byte signed integer tt_isdst, and a one-byte
    unsigned integer tt_abbrind.

Actually signedness of tt_isdst is rather irrelevant, since the only
values actually used are 0 and 1, so it may be better to describe that
as a truth-value type.


More information about the tz mailing list