slib2c0: time killer

Aubrey Jaffer (jaffer@martigny.ai.mit.edu)
Sun, 16 Nov 1997 21:52:15 -0500 (EST)

I released slib2c0 today. In slib2c0, I completed implementing the
POSIX time functions. SLIB's implementation should be less troublesome
than depending on C-libraries. Here are comments from "timezone.scm":

The C-library support for time in general and time-zones in particular
stands as a fine example of how *not* to create interfaces.

Functions are not consistently named. Support for GMT is offered in one
direction only; The localtime function returns some timezone data in the
structure which it returns, and some data in shared global variables.
The structure which localtime returns is overwritten with each
invocation. There is no way to find local time in zones other than GMT
and the local timezone.

The tzfile(5) format encodes only a single timezone per file. There is
no dispatch on zone names, so multiple copies of a timezone file exist
under different names. The TZ `:' specification is unix filesystem
specific. The tzfile(5) format makes no provision for byte-order
differences; It mixes 32-bit integer data with characters; specifying
ASCII bytes, it is incompatible with different character sizes. The
binary format makes it impossible to easily inspect a file for
corruption.

I have corrected most of the failings of the C-library time interface in
SLIB while maintaining compatablility. I wrote support for Linux
timezone files because on a system where TZ is not set, there is no
other way to reveal this information. HP-UX appears to have a more
sensible arrangement; I invite you to add support for it and other
platforms.

Writing this was a long, tedious, and unenlightening process. I hope it
is useful.

Sat Nov 15 00:15:33 1997 Aubrey Jaffer <jaffer@martigny.ai.mit.edu>