GETARGS.C Command line argument processor
Function
|
getargs
|
Include file
|
GETARGS.H
|
Prototype
|
int getargs( int argc , char **argv , ARG *tbl_ptr , int tbl_size )
|
Remarks
|
Process command line arguments. Stripping all command line
switches out of argv. Return a new argc. If an error is found
local_exit(1) is called (getargs won't return) and a usage message
is printed showing all arguments in the table.
|
Function
|
stoi
|
Include file
|
GETARGS.H
|
Prototype
|
static int stoi( register char **instr )
|
Remarks
|
stoi is a more powerful version of atoi.
Convert string to integer. If string starts with 0x it is
interpreted as a hex number, else if it starts with a 0 it is
octal, else it is decimal. Conversion stops on encountering
the first character which is not a digit in the indicated
radix. *instr is updated to point past the end of the number
|
Function
|
setarg
|
Include file
|
GETARGS.H
|
Prototype
|
static char *setarg( ARG *argp , char *linep )
|
Remarks
|
Set an argument , argp points at the argument table entry
corresponding to *linep. Return linep , updated to point
past the argument being set.
|
Function
|
findarg
|
Include file
|
GETARGS.H
|
Prototype
|
static ARG *findarg( int c , ARG *tbl_ptr , int tbl_size )
|
Remarks
|
Return pointer to argument table entry corresponding
to c ( or 0 if c isn't in the table ).
|
Function
|
pr_usage
|
Include file
|
GETARGS.H
|
Prototype
|
static void pr_usage( ARG *tbl_ptr , int tbl_size , char *arg_ptr )
|
Remarks
|
Print the arg_tbl in the form:
- (value is <*variable> )
|
Table of Contents
Function Index
generated on 22 September 1998 - 12:54:57
© 1998 Tierra del Fuego Ltd.
|