| 9 #define LIBTU_OPTPARSER_H |
9 #define LIBTU_OPTPARSER_H |
| 10 |
10 |
| 11 #include "types.h" |
11 #include "types.h" |
| 12 |
12 |
| 13 |
13 |
| 14 #define OPT_ID(X) ((X)|0x10000) |
14 #define OPT_ID_NOSHORT_FLAG 0x10000 |
| 15 #define OPT_ID_RESERVED(X) ((X)|0x20000) |
15 #define OPT_ID_RESERVED_FLAG 0x20000 |
| |
16 |
| |
17 #define OPT_ID(X) ((X)|OPT_ID_NOSHORT_FLAG) |
| |
18 #define OPT_ID_RESERVED(X) ((X)|OPT_ID_RESERVED_FLAG) |
| 16 |
19 |
| 17 /* OPTP_CHAIN is the normal behavior, i.e. single-letter options can be |
20 /* OPTP_CHAIN is the normal behavior, i.e. single-letter options can be |
| 18 * "chained" together: 'lr -lR'. Use for normal command line programs. |
21 * "chained" together: 'lr -lR'. Use for normal command line programs. |
| 19 * OPTP_MIDLONG allows '-display foo' -like args but disables chaining |
22 * OPTP_MIDLONG allows '-display foo' -like args but disables chaining |
| 20 * of single-letter options. X programs should probably use this. |
23 * of single-letter options. X programs should probably use this. |
| 56 E_OPT_UNEXPECTED_ARGUMENT=-5 |
69 E_OPT_UNEXPECTED_ARGUMENT=-5 |
| 57 }; |
70 }; |
| 58 |
71 |
| 59 |
72 |
| 60 extern void optparser_init(int argc, char *const argv[], int mode, |
73 extern void optparser_init(int argc, char *const argv[], int mode, |
| 61 const OptParserOpt *opts); |
74 const OptParserOpt *opts, |
| |
75 const OptParserCommonInfo *cinfo); |
| |
76 |
| 62 extern int optparser_get_opt(); |
77 extern int optparser_get_opt(); |
| 63 extern const char* optparser_get_arg(); |
78 extern const char* optparser_get_arg(); |
| 64 extern void optparser_print_error(); |
79 extern void optparser_print_error(); |
| 65 |
80 |
| 66 #endif /* LIBTU_OPTPARSER_H */ |
81 #endif /* LIBTU_OPTPARSER_H */ |