[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.5.28 libopts procedures

These are the publicly exported procedures from the libopts library.

`optionProcess'
This is the main entry point for processing options. It is intended that this procedure be called once at the beginning of the execution of a program. Depending on options selected earlier, it is sometimes necessary to stop and restart option processing, or to select completely different sets of options. This can be done easily, but you generally do not want to do this.

`optionVersion'
Returns the full version string compiled into the library.

`optionLoadLine'
When passed a pointer to the option struct and a string, it will find the option named by the first token on the string and set the option argument to the remainder of the string. The caller must NUL terminate the string. Any embedded new lines will be included in the option argument.

`putBourneShell'
This routine will write to stdout the state of the options as encoded in the option structure. It will also write out the number of arguments consumed by option processing. The output result can be eval-ed by a shell in the following manner:

 
eval "`handle-prog-opts ${1+\"$@\"}`"
[ -z "$OPTION_CT" ] && exit 1
shift $OPTION_CT

This routine is normally specified by specifying test-main = yes; in the option definitions file.

`putShellParse'
This routine will write to stdout a series of shell commands that will parse the command line options. This routine will be called when you specify test-main = putShellParse; and the result is compiled with -DTEST_xxx_OPTS defined. This is the only way it should ever be invoked.

`all the rest'
The remaining routines are for the exclusive use of the generated option processing code. You should not be using them directly.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Bruce Korb on February, 4 2002 using texi2html