summaryrefslogtreecommitdiff
path: root/src/pproc.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-06-29 02:50:56 +0000
committerMike Buland <eichlan@xagasoft.com>2006-06-29 02:50:56 +0000
commit5e386890b41fe043e2639b25b613831ef8362e7b (patch)
tree60da93a6ade1db5ed2620fbe47b472291459a1a1 /src/pproc.h
parentac98da8eacbf1147d69e378db62432db05e8c73e (diff)
downloadlibbu++-5e386890b41fe043e2639b25b613831ef8362e7b.tar.gz
libbu++-5e386890b41fe043e2639b25b613831ef8362e7b.tar.bz2
libbu++-5e386890b41fe043e2639b25b613831ef8362e7b.tar.xz
libbu++-5e386890b41fe043e2639b25b613831ef8362e7b.zip
Completely removed the old, crappy pproc and replaced it with the new, shiny
ParamProc class...it's soooo much better it makes me wanna' throw things...
Diffstat (limited to 'src/pproc.h')
-rw-r--r--src/pproc.h65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/pproc.h b/src/pproc.h
deleted file mode 100644
index 31d7c02..0000000
--- a/src/pproc.h
+++ /dev/null
@@ -1,65 +0,0 @@
1#ifndef PPROC_H_
2#define PPROC_H_
3
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/**
32 * Contains all required info to handle a single program parameter.
33 *@author Mike Buland
34 */
35typedef struct PPROC
36{
37 const char *lpWord; /**< The full text-word to use as a 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
42 /**
43 * Pointer to the function to call when this param is triggered.
44 *@param argc The number of params after and including the one that
45 * triggered this call.
46 *@param argv The array of commandline tokens to use as parameters.
47 *@returns 0 for everything is ok. A number greater than zero signals that
48 * this parameter function used n parameters and they should be skipped by
49 * the processParams function.
50 */
51 int (*proc)( int argc, char *argv[] );
52 void *stateVar; /**< A pointer to a variable to set */
53 const char *shortHelp;
54} PPROC;
55
56/**
57 * Process command line parameters based on a null-terminated array of PPROC
58 * structures.
59 *@param argc Should come straight from your main function's argc.
60 *@param argv Should come straight from your main function's argv.
61 *@param pproc The array of params that this function can respond to.
62 */
63void processParams( int argc, char *argv[], PPROC *pproc );
64
65#endif /*PPROC_H_*/