Mercurial > hg > nnchat
comparison th_args.h @ 81:69aed051f84d
Synced th-libs.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 20 Apr 2009 22:02:37 +0300 |
parents | 728243125263 |
children | 59992d930e70 |
comparison
equal
deleted
inserted
replaced
80:335b5a74c22e | 81:69aed051f84d |
---|---|
16 #include "th_util.h" | 16 #include "th_util.h" |
17 | 17 |
18 | 18 |
19 /* Option flags | 19 /* Option flags |
20 */ | 20 */ |
21 #define OPT_NONE (0) /* Simple option with no arguments */ | 21 #define OPT_NONE (0) /* Simple option with no arguments */ |
22 | 22 |
23 #define OPT_ARGREQ (1) /* Option's argument is required */ | 23 #define OPT_ARGREQ (1) /* Option's argument is required */ |
24 #define OPT_ARGOPT (3) /* Option's argument is optional */ | 24 #define OPT_ARGOPT (3) /* Option's argument is optional */ |
25 #define OPT_ARGMASK (3) /* Mask for option argument flags */ | 25 #define OPT_ARGMASK (3) /* Mask for option argument flags */ |
26 | 26 |
27 #define OPT_REQUIRED (4) /* This option is required to be given */ | 27 #define OPT_REQUIRED (4) /* This option is required to be given */ |
28 | 28 |
29 | 29 |
30 typedef struct { | 30 typedef struct { |
31 int optID; | 31 int optID; |
32 char optShort; | 32 char optShort; |
33 char *optLong; | 33 char *optLong; |
34 char *optDesc; | 34 char *optDesc; |
35 int optFlags; | 35 int optFlags; |
36 } optarg_t; | 36 } optarg_t; |
37 | 37 |
38 | 38 |
39 BOOL th_args_process(int argc, char *argv[], | 39 BOOL th_args_process(int argc, char *argv[], |
40 optarg_t argList[], int argListN, | 40 optarg_t argList[], int argListN, |
41 BOOL (*handleOpt)(int, char *, char *), | 41 BOOL (*handleOpt)(int, char *, char *), |
42 BOOL (*handleFile)(char *), BOOL); | 42 BOOL (*handleFile)(char *), BOOL); |
43 | 43 |
44 void th_args_help(FILE *, optarg_t optList[], int optListN, | 44 void th_args_help(FILE *, optarg_t optList[], int optListN, |
45 char *, char *); | 45 char *, char *); |
46 | 46 |
47 #ifdef __cplusplus | 47 #ifdef __cplusplus |
48 } | 48 } |
49 #endif | 49 #endif |
50 #endif /* _TH_ARGS */ | 50 #endif /* _TH_ARGS */ |