Mercurial > hg > nnchat
comparison th_args.h @ 182:59992d930e70
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 15 Nov 2010 19:20:04 +0200 |
parents | 69aed051f84d |
children |
comparison
equal
deleted
inserted
replaced
181:b0a88d3835e9 | 182:59992d930e70 |
---|---|
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 #define OPT_ARGREQ (1) /* Option's argument is required */ |
23 #define OPT_ARGREQ (1) /* Option's argument is required */ | 23 #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 */ | 24 #define OPT_ARGMASK (3) /* Mask for option argument flags */ |
26 | 25 #define OPT_REQUIRED (4) /* This option is required to be given */ |
27 #define OPT_REQUIRED (4) /* This option is required to be given */ | |
28 | 26 |
29 | 27 |
30 typedef struct { | 28 typedef struct { |
31 int optID; | 29 int optID; |
32 char optShort; | 30 char optShort; |
35 int optFlags; | 33 int optFlags; |
36 } optarg_t; | 34 } optarg_t; |
37 | 35 |
38 | 36 |
39 BOOL th_args_process(int argc, char *argv[], | 37 BOOL th_args_process(int argc, char *argv[], |
40 optarg_t argList[], int argListN, | 38 optarg_t argList[], int argListN, |
41 BOOL (*handleOpt)(int, char *, char *), | 39 BOOL (*handleOpt)(int, char *, char *), |
42 BOOL (*handleFile)(char *), BOOL); | 40 BOOL (*handleFile)(char *), BOOL); |
43 | 41 |
44 void th_args_help(FILE *, optarg_t optList[], int optListN, | 42 void th_args_help(FILE *, optarg_t optList[], int optListN, char *, char *); |
45 char *, char *); | |
46 | 43 |
47 #ifdef __cplusplus | 44 #ifdef __cplusplus |
48 } | 45 } |
49 #endif | 46 #endif |
50 #endif /* _TH_ARGS */ | 47 #endif /* _TH_ARGS */ |