ID string in zic's output files
So much for the idea of storing ID strings in zic output files as (unused) abbreviations. The zone America/Pangnirtung needs 41 bytes to store all the abbreviations it uses: -00 AWT APT AST ADDT ADT EDT EST CST CDT A zic output file can have at most 50 bytes of abbreviations, as set by TZ_MAX_CHARS in tzfile.h The 9 bytes remaining isn't enough for our purposes. (We don't want to boost TZ_MAX_CHARS; localtime.c checks files to ensure they have at most that many abbreviation characters; files with more would be rejected, at least by now-in-the-field binaries compiled from localtime.c) Note that the last component of "Zone" names (such as the "Vevay" in "America/Indiana/Vevay") would fit in the 15 "reserved for future use" bytes at the front of zic output files; full names would not (always) fit, and there would not (always) be room for a prefix such as "@(#)." @dashdashado
Thanks for checking on this. Well… one could store a 15 byte *hash of the ID string*. $ echo -n 'America/Indiana/Vevay' | shasum -a 1 | cut -c1-30 3fec11cdc40957c5e5c8ab69ca3a68 $ echo -n 'America/Los_Angeles' | shasum -a 1 | cut -c1-30 c5095924a41ac815d5f355767d82b1 $ cd /usr/share/zoneinfo/ ; ( for z in $(find . -type f | cut -d/ -f2-); do echo $(echo -n $z | shasum -a 1 | cut -c1-30) $z; done) | fgrep c5095924a41ac815d5f355767d82b1 c5095924a41ac815d5f355767d82b1 America/Los_Angeles On 2/22/17 2:41 PM, Arthur David Olson wrote:
So much for the idea of storing ID strings in zic output files as (unused) abbreviations. The zone America/Pangnirtung needs 41 bytes to store all the abbreviations it uses: -00 AWT APT AST ADDT ADT EDT EST CST CDT A zic output file can have at most 50 bytes of abbreviations, as set by TZ_MAX_CHARS in tzfile.h The 9 bytes remaining isn't enough for our purposes.
(We don't want to boost TZ_MAX_CHARS; localtime.c checks files to ensure they have at most that many abbreviation characters; files with more would be rejected, at least by now-in-the-field binaries compiled from localtime.c)
Note that the last component of "Zone" names (such as the "Vevay" in "America/Indiana/Vevay") would fit in the 15 "reserved for future use" bytes at the front of zic output files; full names would not (always) fit, and there would not (always) be room for a prefix such as "@(#)."
@dashdashado
participants (2)
-
Arthur David Olson -
Steven R. Loomis