<br><br><div class="gmail_quote">On Fri, Mar 8, 2013 at 12:42 PM,  <span dir="ltr">&lt;<a href="mailto:random832@fastmail.us" target="_blank">random832@fastmail.us</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Fri, Mar 8, 2013, at 14:39, Paul Eggert wrote:<br>
&gt; If it can be mostly partitioned into a separate area, which<br>
&gt; normally doesn&#39;t affect the mainline version, there&#39;d be<br>
&gt; some interest I suppose.  I hope it wouldn&#39;t require<br>
&gt; many intrusive changes to the existing source.<br>
<br>
</div>The only substantial source changes I had to make to make zic work were:<br>
Include a version of getopt (need one that&#39;s public-domain - I just used<br>
a BSD one I found online for testing - anyone know where a PD one can be<br>
found?)</blockquote><div><br>I have a copy of the getopt() that AT&amp;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:<br><br>The preamble starts:<br>

<br>/*<br>**    @(#)getopt.c    2.2 (smail) 1/26/87<br>*/<br><br>#ifndef lint<br>static    char    sccs[] = &quot;@(#)Public Domain: $RCSfile: getopt.c,v $ $Revision: 1.1 $&quot;;<br>#endif<br><br>/*<br> * Here&#39;s something you&#39;ve all been waiting for:  the AT&amp;T public domain<br>

 * source for getopt(3).  It is the code which was given out at the 1985<br> * UNIFORUM conference in Dallas.  I obtained it by electronic mail<br> * directly from AT&amp;T.  The people there assure me that it is indeed<br>

 * in the public domain.<br> * <br> * There is no manual page.  That is because the one they gave out at<br> * UNIFORUM was slightly different from the current System V Release 2<br> * manual page.  The difference apparently involved a note about the<br>

 * famous rules 5 and 6, recommending using white space between an option<br> * and its first argument, and not grouping options that have arguments.<br> * Getopt itself is currently lenient about both of these things White<br>

 * space is allowed, but not mandatory, and the last option in a group can<br> * have an argument.  That particular version of the man page evidently<br> * has no official existence, and my source at AT&amp;T did not send a copy.<br>

 * The current SVR2 man page reflects the actual behavor of this getopt.<br> * However, I am not about to post a copy of anything licensed by AT&amp;T.<br> */<br><br>If I remember correctly, I collected the code from the &#39;smail&#39; mail agent — the first check-in in my RCS (originally SCCS) respository was in April 1988.  I don&#39;t think I have the source for smail any more.  (The smail 3 source is available via its home page at <a href="http://www.weird.com/~woods/projects/smail.html">http://www.weird.com/~woods/projects/smail.html</a>; the last release was in 2005.  It contains substantially the notice above and the original source code, so you don&#39;t have to rely on me.)<br>

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

 </div></div>-- <br>Jonathan Leffler &lt;<a href="mailto:jonathan.leffler@gmail.com" target="_blank">jonathan.leffler@gmail.com</a>&gt;  #include &lt;disclaimer.h&gt;<br>Guardian of DBD::Informix - v2013.0118 - <a href="http://dbi.perl.org" target="_blank">http://dbi.perl.org</a><br>

&quot;Blessed are we who can laugh at ourselves, for we shall never cease to be amused.&quot;