Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/3/84; site genrad.UUCP
Path: utzoo!decvax!genrad!sources-request
From: sources-requ...@genrad.UUCP
Newsgroups: mod.sources
Subject: public domain getopt(3)
Message-ID: <572@genrad.UUCP>
Date: Tue, 25-Dec-84 21:01:32 EST
Article-I.D.: genrad.572
Posted: Tue Dec 25 21:01:32 1984
Date-Received: Tue, 25-Dec-84 22:07:58 EST
Sender: j...@genrad.UUCP
Organization: GenRad, Inc., Bolton, Mass.
Lines: 95
Approved: j...@genrad.UUCP

From: Keith Bostic <harvard!seismo!keith>

There have recently been several requests for a public
domain version of getopt(3), recently.  Thought this
might be worth reposting.

		Keith Bostic
			ARPA: keith@seismo 
			UUCP: seismo!keith

======================================================================
In April of this year, Henry Spencer (utzoo!henry) released a public
domain version of getopt (USG, getopt(3)).  Well, I've been trying to
port some USG dependent software and it didn't seem to work.  The problem
ended up being that the USG version of getopt has some external variables
that aren't mentioned in the documentation.  Anyway, to fix these problems,
I rewrote the public version of getopt.  It has the following advantages:

	-- it includes those "unknown" variables
	-- it's smaller/faster 'cause it doesn't use the formatted
		output conversion routines in section 3 of the UNIX manual.
	-- the error messages are the same as S5's.
	-- it has the same side-effects that S5's has.
	-- the posted bug on how the error messages are flushed has been
		implemented.  (posting by Tony Hansen; pegasus!hansen)

I won't post the man pages since Henry already did; a special note,
it's not documented in the S5 manual that the options ':' and '?' are
illegal.  It should be obvious, but I thought I'd mention it...
This software was derived from binaries of S5 and the S5 man page, and is
(I think?) totally (I'm pretty sure?) compatible with S5 and backward
compatible to Henry's version.

		Keith Bostic
			ARPA: keith@seismo 
			UUCP: seismo!keith

*UNIX is a trademark of Bell Laboratories

.. cut along the dotted line .........................................

Code