aboutsummaryrefslogtreecommitdiff
path: root/src/pproc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pproc.h')
-rw-r--r--src/pproc.h34
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/**