delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2013/07/27/05:09:46

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
Message-ID: <51F38E96.8030203@gmx.de>
Date: Sat, 27 Jul 2013 11:10:46 +0200
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: zoneinfo not able to recognize if daylight saving time is in
effect.
References: <51F2C9B5 DOT 3090202 AT gmx DOT de>
In-Reply-To: <51F2C9B5.3090202@gmx.de>
X-Provags-ID: V03:K0:SIYFibi51qK6GIyoVVFMBPhyKICv+/AyvXJBY+CTnrejNiqVC/c
a1FHJ3AWthiNDUPnedAxedyOyve+Z+SjQ4RzuDuYJOx97tRI6+4UIgyVLD0FJYZMXaTf/JF
U07NPmzc1hhA73j0Vmzj6hVCN4mOTJ5V8w6bU71ybTtR6DbOVm70c8MRTAl2i+de80iDSjg
NUvHNQ98S5n/jIRPq+Y2A==
Reply-To: djgpp-workers AT delorie DOT com

The real reason why the zoneinfo handling of djgpp does not work seems to be it
assumes that the file and encoding format of the files in /zoneinfo have never
changed.  But this is not longer true.  The new version is version 2 as introduced
in 2005.  If the file is a version 2 file can be checked by inspecting the byte
following the "TZiF" string.  If the byte is 2 or greater then it uses the new
format that is unknown to djgpp.
This info has been verbatim taken from tzfile.h included in tzcode*.tar.gz:


#define    TZ_MAGIC    "TZif"

struct tzhead {
     char    tzh_magic[4];        /* TZ_MAGIC */
     char    tzh_version[1];        /* '\0' or '2' as of 2005 */
     char    tzh_reserved[15];    /* reserved--must be zero */
     char    tzh_ttisgmtcnt[4];    /* coded number of trans. time flags */
     char    tzh_ttisstdcnt[4];    /* coded number of trans. time flags */
     char    tzh_leapcnt[4];        /* coded number of leap seconds */
     char    tzh_timecnt[4];        /* coded number of transition times */
     char    tzh_typecnt[4];        /* coded number of local time types */
     char    tzh_charcnt[4];        /* coded number of abbr. chars */
};

/*
** . . .followed by. . .
**
**    tzh_timecnt (char [4])s        coded transition times a la time(2)
**    tzh_timecnt (unsigned char)s    types of local time starting at above
**    tzh_typecnt repetitions of
**        one (char [4])        coded UTC offset in seconds
**        one (unsigned char)    used to set tm_isdst
**        one (unsigned char)    that's an abbreviation list index
**    tzh_charcnt (char)s        '\0'-terminated zone abbreviations
**    tzh_leapcnt repetitions of
**        one (char [4])        coded leap second transition times
**        one (char [4])        total correction after above
**    tzh_ttisstdcnt (char)s        indexed by type; if TRUE, transition
**                    time is standard time, if FALSE,
**                    transition time is wall clock time
**                    if absent, transition times are
**                    assumed to be wall clock time
**    tzh_ttisgmtcnt (char)s        indexed by type; if TRUE, transition
**                    time is UTC, if FALSE,
**                    transition time is local time
**                    if absent, transition times are
**                    assumed to be local time
*/

/*
** If tzh_version is '2' or greater, the above is followed by a second instance
** of tzhead and a second instance of the data in which each coded transition
** time uses 8 rather than 4 chars,
** then a POSIX-TZ-environment-variable-style string for use in handling
** instants after the last transition time stored in the file
** (with nothing between the newlines if there is no POSIX representation for
** such instants).
*/


As can be seen, djgpp needs new code to identify the format of the file loaded
and new decoding code for the new format.  It will take certainly some time to
implement all this if it is ever done.
The situation is that all files that djgpp can decode are very likely outdated
and the new ones are all of version 2 format and cannot be decode by djgpp.
I have found no information if it would be possible to still produce version 0
files using zic and the other tools.  If someone knows how this can be done
please let me know.
Neither less I think djgpp should be able to decode the new format.

Regards,
Juan M. Guerrero

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019