From bd5bb1ca60a6a97b110cbf221b3625e6e6200141 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 26 May 2006 04:03:24 +0000 Subject: Loads of updates to several systems, see each for what really changed, the biggest are the updates to the exception framework, and to the pproc system, which is almost a competitor to popt already... --- src/pproc.h | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'src/pproc.h') diff --git a/src/pproc.h b/src/pproc.h index bf5063c..31d7c02 100644 --- a/src/pproc.h +++ b/src/pproc.h @@ -1,6 +1,33 @@ #ifndef PPROC_H_ #define PPROC_H_ +/** + * A mask to discover what the type is even if flags are set. + */ +#define PPROC_TYPE 0x0F + +#define PPROC_BOOL_TRUE 0x01 +#define PPROC_BOOL_FALSE 0x02 +#define PPROC_BOOL_TOGGLE 0x03 +#define PPROC_CHAR 0x04 +#define PPROC_SHORT 0x05 +#define PPROC_LONG 0x06 +#define PPREC_LONG_LONG 0x07 +#define PPROC_UCHAR 0x08 +#define PPROC_USHORT 0x09 +#define PPROC_ULONG 0x0A +#define PPREC_ULONG_LONG 0x0B +#define PPROC_FLOAT 0x0C +#define PPROC_DOUBLE 0x0D +#define PPROC_LONG_DOUBLE 0x0E +#define PPROC_STRING 0x0F + +#define PPROCF_CALLBACK 0x10 +#define PPROCF_ALLOW_EQUALS 0x20 +#define PPROCF_SHORT_TERMINAL 0x40 +#define PPROCF_TERMINATE 0x80 + + /** * Contains all required info to handle a single program parameter. *@author Mike Buland @@ -9,6 +36,9 @@ typedef struct PPROC { const char *lpWord; /**< The full text-word to use as a param. */ const char cChar; /**< The short char version of the param. */ + + const char cMode; /**< One of the PPROC_* macros, these are not flags. */ + /** * Pointer to the function to call when this param is triggered. *@param argc The number of params after and including the one that @@ -19,8 +49,8 @@ typedef struct PPROC * the processParams function. */ int (*proc)( int argc, char *argv[] ); - bool *stateVar; /**< A pointer to a bool to be setwhen this is triggered */ - bool bSetState; /**< The state to set the above bool to. */ + void *stateVar; /**< A pointer to a variable to set */ + const char *shortHelp; } PPROC; /** -- cgit v1.2.3