diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-05-26 04:03:24 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-05-26 04:03:24 +0000 |
commit | bd5bb1ca60a6a97b110cbf221b3625e6e6200141 (patch) | |
tree | 063b1576b57aba698159f50a04461ddfb7c4dfb6 /src/pproc.h | |
parent | bc6f456ef27bdf25bf7a7f677217b9b7204b4241 (diff) | |
download | libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.tar.gz libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.tar.bz2 libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.tar.xz libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.zip |
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...
Diffstat (limited to 'src/pproc.h')
-rw-r--r-- | src/pproc.h | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/pproc.h b/src/pproc.h index bf5063c..31d7c02 100644 --- a/src/pproc.h +++ b/src/pproc.h | |||
@@ -2,6 +2,33 @@ | |||
2 | #define PPROC_H_ | 2 | #define PPROC_H_ |
3 | 3 | ||
4 | /** | 4 | /** |
5 | * A mask to discover what the type is even if flags are set. | ||
6 | */ | ||
7 | #define PPROC_TYPE 0x0F | ||
8 | |||
9 | #define PPROC_BOOL_TRUE 0x01 | ||
10 | #define PPROC_BOOL_FALSE 0x02 | ||
11 | #define PPROC_BOOL_TOGGLE 0x03 | ||
12 | #define PPROC_CHAR 0x04 | ||
13 | #define PPROC_SHORT 0x05 | ||
14 | #define PPROC_LONG 0x06 | ||
15 | #define PPREC_LONG_LONG 0x07 | ||
16 | #define PPROC_UCHAR 0x08 | ||
17 | #define PPROC_USHORT 0x09 | ||
18 | #define PPROC_ULONG 0x0A | ||
19 | #define PPREC_ULONG_LONG 0x0B | ||
20 | #define PPROC_FLOAT 0x0C | ||
21 | #define PPROC_DOUBLE 0x0D | ||
22 | #define PPROC_LONG_DOUBLE 0x0E | ||
23 | #define PPROC_STRING 0x0F | ||
24 | |||
25 | #define PPROCF_CALLBACK 0x10 | ||
26 | #define PPROCF_ALLOW_EQUALS 0x20 | ||
27 | #define PPROCF_SHORT_TERMINAL 0x40 | ||
28 | #define PPROCF_TERMINATE 0x80 | ||
29 | |||
30 | |||
31 | /** | ||
5 | * Contains all required info to handle a single program parameter. | 32 | * Contains all required info to handle a single program parameter. |
6 | *@author Mike Buland | 33 | *@author Mike Buland |
7 | */ | 34 | */ |
@@ -9,6 +36,9 @@ typedef struct PPROC | |||
9 | { | 36 | { |
10 | const char *lpWord; /**< The full text-word to use as a param. */ | 37 | const char *lpWord; /**< The full text-word to use as a param. */ |
11 | const char cChar; /**< The short char version of the param. */ | 38 | const char cChar; /**< The short char version of the param. */ |
39 | |||
40 | const char cMode; /**< One of the PPROC_* macros, these are not flags. */ | ||
41 | |||
12 | /** | 42 | /** |
13 | * Pointer to the function to call when this param is triggered. | 43 | * Pointer to the function to call when this param is triggered. |
14 | *@param argc The number of params after and including the one that | 44 | *@param argc The number of params after and including the one that |
@@ -19,8 +49,8 @@ typedef struct PPROC | |||
19 | * the processParams function. | 49 | * the processParams function. |
20 | */ | 50 | */ |
21 | int (*proc)( int argc, char *argv[] ); | 51 | int (*proc)( int argc, char *argv[] ); |
22 | bool *stateVar; /**< A pointer to a bool to be setwhen this is triggered */ | 52 | void *stateVar; /**< A pointer to a variable to set */ |
23 | bool bSetState; /**< The state to set the above bool to. */ | 53 | const char *shortHelp; |
24 | } PPROC; | 54 | } PPROC; |
25 | 55 | ||
26 | /** | 56 | /** |