Hi, I'm trying to parse the compiled (i.e.zic'd) time zone files. Is there a document indicating the exact structure of the files? I did a 'man tzfile' but it's not exact: NAME tzfile - time zone information SYNOPSIS #include <tzfile.h> DESCRIPTION The time zone information files used by tzset(3) begin with bytes reserved for future use, followed by six four- byte values of type long, written in a ``standard'' byte order (the high-order byte of the value is written first). These values are, in order: How many bytes is "...bytes..."? What would be most helpful is some code (preferably in C) showing how to parse the files. Also I looked at the rule files, and I sort of understand them, but I'm not too sure what the format is exactly as well as some of the syntax (e.g. what is 'Link')? Thanks, Avery -- At the back of the Daylight Saving scheme I detect the bony, blue-fingered hand of Puritanism, eager to push people into bed earlier, and get them up earlier, to make them healthy, wealthy and wise in spite of themselves. -- Robertson Davies, The Diary of Samuel Marchbanks I wish Daylight Saving Time would die. -- Avery Chan
Date: Fri, 5 Apr 2002 13:51:49 -0800 From: Avery Chan <avery@apple.com>
What would be most helpful is some code (preferably in C) showing how to
parse the files.
That's in localtime.c, which is part of the tzcode distribution. There's an independent implementation in the GNU C library, which you can also look at.
Also I looked at the rule files, and I sort of understand them, but I'm not too sure what the format is exactly as well as some of the syntax (e.g. what is 'Link')?
The zic man page covers that topic; it's in the file "zic.8" in the tz distribution.
Two files in the tz-distribution give virtually all information about the structure of the tz-data: Theory zic.8 both in the tzcode directory. 'Theory' is readable even if you don't have a Unix machine or a nroff/troff reader. 'zic.8' is not easily readable on non-Unix platforms. In my email dated 2000-04-19 I tried to propose an html format for zic.8. I even added an html-converted zic.8 to this email. Only Paul Eggert replied with, amongst others: <quote> "groff -Thtml -man zic.8" would have done it automatically, though with results that don't look as nice as what you did. If we were to switch the format of manual, it should be to a format that is designed for documentation, e.g. Texinfo, DocBook or linuxdoc-sgml; I think this would be more useful than switching to HTML. <unquote> Since repeatedly questions are asked about the structure of the tz-data, I really think it would be very useful to add a universal, platform independent html file to the tz-data directory. Just leave everything as it is (Unix people seem to dislike changes!), but ADD a file called Documentation.html. Put in the file Documentation.html the text of the file Theory and add at least the html converted zic.8 file to the Documentation.html file. This would mean less guesswork for strangers to the tz distribution. You could even put this file into the tzdata directory. Please don't make it more difficult. Texinfo, DocBook, linuxdoc-sgml, xml, whatever, are NOT platform independent nor universally readable. Since the version of the zic.8 file is still 7.19 one could use the html version, found in my email dated 2000-04-19. Regards, Oscar van Vlijmen 2002-04-07
Date: Sun, 07 Apr 2002 12:17:15 +0200 From: Oscar van Vlijmen <o.van.vlijmen@tip.nl>
ADD a file called Documentation.html. Put in the file Documentation.html the text of the file Theory and add at least the html converted zic.8 file to the Documentation.html file.
That would require that we maintain two copies of the same information by hand, indefinitely. From long experience I've learned this is a bad idea. It more than doubles the maintenance burden. Inevitably the two versions will disagree. It'd be a good thing to have an HTML version of this information. But it wouldn't be good to maintain a separate copy by hand. Also, I'd rather not invest too much more time maintaining the documentation in HTML format. There are better formats for documentation, and HTML can be generated from them, so I'd prefer to do that. I realize that tz-link.htm is in HTML, but that's a pain and I'd rather not increase the pain level.
Texinfo, DocBook, linuxdoc-sgml, xml, whatever, are NOT platform independent nor universally readable.
That wouldn't be a problem, so long as we could generate the HTML (and the man page) automatically from the common format.
At 12:17 PM +0200 4/7/02, Oscar van Vlijmen wrote:
Since repeatedly questions are asked about the structure of the tz-data, I really think it would be very useful to add a universal, platform independent html file to the tz-data directory.
Excellent idea. As Paul suggests, however, one format that could generate HTML makes more sense from a maintenance perspective. The process of generating HTML needs to be platform independent, or someone needs to generate the HTML as part of the distribution process. Regards, Steve Mann -- Creative Digital Publishing Inc. 1315 Palm Street, San Luis Obispo, CA 93401-3117 ------------------------------------------- 805.784.9461 805.784.9462 (fax) info@cdpubs.com http://www.cdpubs.com
participants (4)
-
Avery Chan -
Oscar van Vlijmen -
Paul Eggert -
Steve Mann