c_parsepar - Parse a unix argv[] buffer for TAE parameter specifications

SYNTAX

#include "notae.h"

FUNCTION c_parsepar( argc, argv, parms, scmdlist, list )

    long    argc;
    char    *argv[];
    struct  PARAMETER       *parms;
    char    *scmdlist[];
    char    list[][CMLEN];

PARAMETERS

argc( input, integer )

Number of string entries in argv[]. Value is passed to main().

argv( input, array of strings, length(argc) )

Array containing the strings the user entered on the unix command line. This array is passed to main() and has been parsed by the shell.

parms( input, pointer to PARAMETER structure )

This structure contains the definition of the parameters for the specific application and is defined in the local module getargv() function.

scmdlist( input, array of strings )

List of subcommand names and is defined in the local module getargv() function.

list( output, array of strings )

An array of strings containing the parsed parameters and their specifications in the format:

    list[0]="subcommand_name"
    list[1]="parm_name1=parm_val1 parm_val2 parm_val3"
    ...
    list[n]="parm_namen=parm_val1"

DESCRIPTION

Using the PARAMETER structure and subcommand list, c_parsepar() looks for matching names in argv[] expanding them if necessary. The corresponding values on the right hand side of the '=' sign are combined with the parameter name into one string. If positional values are specified, these are also combined with the appropriate parameter name. A final check is made to catch obvious parameter type mismatches such as strings instead of floats or integers. The parsed list is returned to the calling function, presumed to be getargv().

RETURN VALUE

c_parsepar() returns

    E_SUCC (0)  --> success
    E_FAIL (-1) --> failure