CL_ORDER - getting the order of command line arguments.

Usage:

#include <cl.h>
order = cl_order(cl, num_opts, index1, index2, ...);

Where:

CL_PARSED *cl;
points to a parsed command line structure, as returned by "cl_parse" or a related routine.
int num_opts;
is the number of arguments that follow "num_opts" in the "cl_order" argument list.
int index1, index2, ...;
are one or more integers indexing into the Options Table. Each of these refers to a table entry for an option that can take multiple values. This means that the table entries must have been constructed with one of the macros:
CL_MUNFLAGGED    CL_MSTRING
CL_MNUMBER       CL_MREAL
CL_ORDERED *order;
points to a linked list of structures giving the order of the arguments on the command line. See below for more about the CL_ORDERED type.

Description:

The "cl_order" function lets you determine the order of values supplied as part of multi-valued command line options. The order is given by a linked list of structures which have the following contents:

typedef struct CL_ORDERED {
    struct CL_ORDERED *next;
    int index;
    union {
        char *sval;
        long lval;
        double dval;
    } _;
};

Each item in this list gives an index into the Options Table (telling you the option associated with the value) and a string, integer, or floating point value. The "next" element points to the next item in the list. By following this linked list, you can determine the order of the specified option values on the original command line.

See Also:

expl c internal parser
for an overview of the parser routines.
expl c internal parser macros
for macros used in creating an Options Table.
expl c internal parser cl_parse
for the basic routine that parses a command line.

Copyright © 1996, Thinkage Ltd.