[tz] tzcode for windows?

Jonathan Leffler jonathan.leffler at gmail.com
Fri Mar 8 23:18:30 UTC 2013


On Fri, Mar 8, 2013 at 12:42 PM, <random832 at fastmail.us> wrote:

> On Fri, Mar 8, 2013, at 14:39, Paul Eggert wrote:
> > If it can be mostly partitioned into a separate area, which
> > normally doesn't affect the mainline version, there'd be
> > some interest I suppose.  I hope it wouldn't require
> > many intrusive changes to the existing source.
>
> The only substantial source changes I had to make to make zic work were:
> Include a version of getopt (need one that's public-domain - I just used
> a BSD one I found online for testing - anyone know where a PD one can be
> found?)


I have a copy of the getopt() that AT&T released into the public domain way
back in the 80s.  The original is in pre-standard C (not prototyped) but I
looked it out recently:

The preamble starts:

/*
**    @(#)getopt.c    2.2 (smail) 1/26/87
*/

#ifndef lint
static    char    sccs[] = "@(#)Public Domain: $RCSfile: getopt.c,v $
$Revision: 1.1 $";
#endif

/*
 * Here's something you've all been waiting for:  the AT&T public domain
 * source for getopt(3).  It is the code which was given out at the 1985
 * UNIFORUM conference in Dallas.  I obtained it by electronic mail
 * directly from AT&T.  The people there assure me that it is indeed
 * in the public domain.
 *
 * There is no manual page.  That is because the one they gave out at
 * UNIFORUM was slightly different from the current System V Release 2
 * manual page.  The difference apparently involved a note about the
 * famous rules 5 and 6, recommending using white space between an option
 * and its first argument, and not grouping options that have arguments.
 * Getopt itself is currently lenient about both of these things White
 * space is allowed, but not mandatory, and the last option in a group can
 * have an argument.  That particular version of the man page evidently
 * has no official existence, and my source at AT&T did not send a copy.
 * The current SVR2 man page reflects the actual behavor of this getopt.
 * However, I am not about to post a copy of anything licensed by AT&T.
 */

If I remember correctly, I collected the code from the 'smail' mail agent —
the first check-in in my RCS (originally SCCS) respository was in April
1988.  I don't think I have the source for smail any more.  (The smail 3
source is available via its home page at
http://www.weird.com/~woods/projects/smail.html; the last release was in
2005.  It contains substantially the notice above and the original source
code, so you don't have to rely on me.)

The process of bringing the code up to date is straight-forward as long as
you don't want to support the POSIX-mandated (
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html)
'optional argument' processing, which is actually fairly useless anyway
(I'll bore you with the details on request — suffice to say only the last
option argument can be optional).

-- 
Jonathan Leffler <jonathan.leffler at gmail.com>  #include <disclaimer.h>
Guardian of DBD::Informix - v2013.0118 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm.icann.org/pipermail/tz/attachments/20130308/4ccea5ef/attachment.html 


More information about the tz mailing list