home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume10
/
parseargs
/
README
< prev
next >
Wrap
Text File
|
1990-02-16
|
4KB
|
96 lines
NIFTY UTILITY LIBRARY
Eric P. Allman
University of California
Berkeley, California
eric@Berkeley.EDU
SUMMARY
This directory contains a subset of a utility library that I have
used (in various forms) for several years now. This particular
version is rather sparse, being a relatively recent reimplementation.
I am making this available as a result of the rather surprising
response to my C Advisor column in UNIX Review Vol. 7 No. 11 on
argument parsing, in which I described an alternative to getopt.
Several dozen people have asked for the source code -- an amazing
number, considering that in the four years prior to this column,
I have gotten perhaps six letters in toto.
Rather than limiting this distribution to the single argument
parsing module, I have added several other routines, many of which
my more faithful readers will recognize.
COPY/REUSE POLICY
Permission is hereby granted to freely copy and redistribute this
software, provided that the author is clearly credited in all
copies and derivations. Neither the name of the author nor that
of the University may be used to endorse or promote products
derived from this software without specific written permission.
This software is provided ``As Is'' and without any express or
implied warranties.
CONTENTS
This directory contains:
README -- this file.
Makefile -- a makefile for the library.
useful.h -- a general header file, used by most everything.
ckalloc.c -- an interface to malloc(3) which diagnoses
out of memory conditions. This topic was discussed
in the C Advisor column in UNIX Review Vol. 7 No 7.
ckalloc.3 -- documentation for ckalloc.
funclist.h -- a header file specific to the function list
routines in funclist.c.
funclist.c -- routines that provide lists of ``callout''
functions, used by several of the other routines
to handle errors.
funclist.3 -- documentation for the funclist routines.
lwp_dump.c -- a routine to dump the state of the LightWeight
Process system in SunOS 4.0 -- this isn't used, but
may be useful to some of you.
openpath.c -- a routine to open a file, searching through
a path of directories to find it.
openpath.3 -- documentation for openpath.
parseargs.h -- headers for the argument parser.
parseargs.c -- a command line argument parser. Popular
response to my C Advisor column about this routine
in UNIX Review Vol. 7 No. 11 prompted me to make
this distribution available.
parseargs.3 -- documentation for parseargs.
fp_args.c -- argument value parsers for floating point values;
used by parseargs. This is only included if you need
FP values. I had to break this out because RISC/os
4.01 from Mips doesn't seem to support strtod in the
BSD environment. You may find you need to include
-lm for this to work.
syserr.c -- error message printing routines. A version of
this was discussed in the C Advisor column in UNIX
Review, Vol. 7 No. 7.
syserr.3 -- documentation for syserr.
traceset.c -- routines to set trace flags. The flags are
tested by macros contained in useful.h.
trace.3 -- documentation for the trace routines and macros.
stest.c -- a small test program for the argument parser.
The parseargs routine really ought to have a way of matching a
list (e.g., return the rest of argv). This isn't especially
hard to do, but I haven't gotten around to it yet.
DISCLAIMERS
I hacked this code up to (hopefully) work on ANSI C compilers,
since several readers seem to be interested in this sort of thing.
I can't claim to have really tested this.
The original version was tested under SunOS 4.0 on SPARC architectures.
The version you see has been loosely tested on a Mips M/2000 running
RISC/os 4.01; I have only tried it in the BSD environment, and that
only loosely.
ACKNOWLEDGEMENTS
I wrote the first version of this code while working at the
International Computer Science Institute in Berkeley, CA.
$Header: README,v 2.1 89/12/30 20:59:14 eric Exp $