X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCargs.h;h=5a143d6ffa8786e35a4e37655f021488bdf684bd;hb=80972b2e54c9b88f11c27b878874fd2a6a681391;hp=1a379101356107fe6326e9d21e3a7b90c685decc;hpb=2fa6944da0e3a79b9218dcabbc0b282e60cd9899;p=fw%2Fsdcc diff --git a/src/SDCCargs.h b/src/SDCCargs.h index 1a379101..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,10 +54,12 @@ 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);