00001 #ifndef INC_ARGDESC_H
00002
00003 typedef enum {ARGD_REQUIRED, ARGD_OPTIONAL, ARGD_OPTIONAL_PREV,ARGD_OPTIONAL_PLACEHOLD} argtype;
00004 typedef enum {ARGD_STRING, ARGD_INT, ARGD_FLOAT, ARGD_ENUM, ARGD_OPTIONSET, ARGD_VARARG } argdtype;
00005 typedef enum {ARGD_OPT_NOARG, ARGD_OPT_WITHARG, ARGD_OPT_WITHOPTARG, } argdopttype;
00006
00007 struct argapp
00008 {
00009 char *name;
00010 char *desc;
00011 struct argdesc *args;
00012 struct appsetvar *setvars;
00013 struct argchoice *opts;
00014 struct argapp *next;
00015 };
00016
00017 struct argdesc
00018 {
00019 argtype type;
00020 argdtype dtype;
00021 char *name;
00022 struct argchoice *choices;
00023
00024 struct argdesc *last_args;
00025 struct argdesc *next;
00026 };
00027
00028 struct appsetvar
00029 {
00030 char *name;
00031 struct argchoice *vals;
00032 struct appsetvar *next;
00033 };
00034
00035 struct argchoice
00036 {
00037 char *name;
00038 argdopttype opttype;
00039 struct argchoice *next;
00040 };
00041
00042
00043
00044 struct parse_arginfo
00045 {
00046 struct argapp *apps;
00047 void *scanner;
00048 int syntax_error_count;
00049 };
00050
00051 struct argapp *argdesc_parse(char *filename, int *errors);
00052 void argdesc_destroy(struct argapp *apps);
00053
00054 #define INC_ARGDESC_H
00055 #endif