Sat Aug 6 00:39:22 2011

Asterisk developer's documentation


argdesc.h

Go to the documentation of this file.
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; /* REQUIRED, OPTIONAL, OPTIONAL_PREV */
00020    argdtype dtype; /* STRING, INT,FLOAT, ENUM, OPTIONSET, VARARG */
00021    char *name;
00022    struct argchoice *choices; /* if dtype == ENUM */
00023    
00024    struct argdesc *last_args; /* for makeing an ordered list */
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; /* IF THIS IS AN OPTION LIST */
00039    struct argchoice *next;
00040 };
00041 
00042 /* for passing info into and out of yyparse */
00043 
00044 struct parse_arginfo
00045 {
00046    struct argapp *apps; /* yyparse will set this to point to the parse tree */
00047    void *scanner;       /* yylex needs a scanner. Set it up, and pass it in */
00048    int syntax_error_count;  /* the count of syntax errors encountered */
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

Generated on Sat Aug 6 00:39:22 2011 for Asterisk - the Open Source PBX by  doxygen 1.4.7