X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCargs.h;h=5a143d6ffa8786e35a4e37655f021488bdf684bd;hb=bb226788dab3832b0ec0cda70874ce3fce4eebc6;hp=4208327070afec0e3f17d7a988d118a61c809f26;hpb=f0d3e26f7b91a687dbf34c7e3f56be5f371e1a1e;p=fw%2Fsdcc diff --git a/src/SDCCargs.h b/src/SDCCargs.h index 42083270..5a143d6f 100644 --- a/src/SDCCargs.h +++ b/src/SDCCargs.h @@ -24,18 +24,28 @@ /** Definition of the structures used by the options parser. The port may implement one of these for any options it wants parsed - automatically. + automatically. */ #ifndef SDCCARGS_H #define SDCCARGS_H +/** Specifies option argument types. */ +enum cl_opt_arg_type { + CLAT_BOOLEAN = 0, /* has to be zero! */ + CLAT_INTEGER, + CLAT_STRING, + CLAT_SET, + CLAT_ADD_SET +}; + /** Table of all options supported by all ports. This table provides: * A reference for all options. * An easy way to maintain help for the options. * Automatic support for setting flags on simple options. */ -typedef struct { +typedef struct + { /** The short option character e.g. 'h' for -h. 0 for none. */ char shortOpt; /** Long option e.g. "--help". Includes the -- prefix. NULL for @@ -44,9 +54,14 @@ typedef struct { /** Pointer to an int that will be incremented every time the option is encountered. May be NULL. */ - int *pparameter; + void *pparameter; /** Help text to go with this option. May be NULL. */ const char *help; -} OPTION; + /** Optin argument type */ + enum cl_opt_arg_type arg_type; + } OPTION; + +char *getStringArg(const char *szStart, char **argv, int *pi, int argc); +int getIntArg(const char *szStart, char **argv, int *pi, int argc); #endif