The Complete SPRLIB & ANNLIB

getopt

- an MS-DOS parameter parsing routine

SYNOPSIS

int getopt (argc, argv, optstring)

ARGUMENTS

int argc The number of programs passed to the routine, usually C's standard argc. The length of the array of strings argv.
char *argv[] An array of argc strings containing the parameters.
char *optstring A string containing all option letters to be recognized. If a letter is followed by a colon :, the option is supposed to be followed by one or more parameters separated by whitespace.

RETURNS

The next option letter in argv that matches a letter in optstring, or -1 when all options have been processed.

FUNCTION

This function is an MS-DOS replacement for the standard UNIX getopt routine (see unistd.h). It works identically: it scans argv for the options given in optstring and returns them. A pointer to the start of the option argument is returned in the variable *optarg (see GETOPT-variables).

NOTE

This function is available only in MS-DOS compiled libraries.

This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998