/*  ArgParse.h 
**
**  Various argument parsing support stuff
*/


struct CmdOptions = {
    char * OptString;	/* pointer to option string: i.e. "-f" */
    int OptFlags;	/* how the option works. see below */
    void * OptVal;	/* pointer to what to store value into */
    int OptType;	/* what the OptVal is , how to store the data */
};

/* OptFlags: */
#define   OPT_SWITCH	0x0001	/* switch: its appearance turns on value */
#define   OPT_CUMULTVE	0x0002	/* cumulative use increases value */
#define   OPT_NEGTIVE	0x0004  /* negative:  decrease, or unset value */

#define   OPT_ARGMT	0x0008  /* following argument. How it's used
				** controled OptType */
#define   OPT_ARG_OPT   0x0010  /* following argument is optional */

/* OptType: */
/* The various types that OptVal could point to */
/* Basic types */
#define OPT_INT_T	0x0001
#define OPT_SHORT_T	0x0002
#define OPT_CHAR_T	0x0003
#define OPT_LONG_T	0x0004

/* modifiers to the type */
#define OPT_T_UNSIGN	0x0100	/* unsigned */
#define OPT_T_ARRY	0x0200	/* array */
#define OPT_T_PTR_ARRY	0x0400	/* array of pointers  to the types */


/*  ParseOptions gets called with an array of CmdOptions structures
**  which descirbes how to deal with the arguments sent it (in standard
**  main( int argc, char ** argv) format 
**  The CmdOptions array is 'null' terminated via all pointers NULL and
**  all ints zero.
*/

int ParseOptions( struct CmdOptnios **, char * , int);
int PrintUsage( struct CmdOptions * );
