home *** CD-ROM | disk | FTP | other *** search
-
- PARSEARGS
-
- extracted from Eric Allman's
-
- NIFTY UTILITY LIBRARY
-
- Eric P. Allman
- University of California
- Berkeley, California
- eric@Berkeley.EDU
-
- modifications by
-
- Peter da Silva
- Ferranti International Controls Corporation
- Sugar Land, Texas
- peter@ficc.uu.net
-
-
- 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.
-
- [ The rest of the utility library has been left out, to reduce
- the size of Parseargs. The complete set of utilities was pubbed
- in the first comp.sources.misc distribution. -- PDS ]
-
- 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.
-
- 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.
- parseargs.h -- headers for the argument parser.
- [ parseargs.c is now broken down into the following files -- PDS ]
- unix_args.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.
- amiga_args.c -- Amiga version of unix_args.c
- arglist.c -- routines for ARGLIST options.
- argtype.c -- routines for other options.
- [ end of parseargs.c -- PDS ]
- parseargs.3 -- documentation for parseargs.
- fp_argtype.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 becaus
- 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.
- stest.c -- a small test program for the argument parser.
- [ strtol.c -- for systems that don't implement strtol. ]
-
- 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.
-
- [ Added, with ARGLIST flag. -- PDS ]
-
- 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 $
-