diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/cli/tap-exportobject.h | 2 | ||||
-rw-r--r-- | ui/clopts_common.h | 16 | ||||
-rw-r--r-- | ui/commandline.c | 11 | ||||
-rw-r--r-- | ui/dissect_opts.h | 21 |
4 files changed, 21 insertions, 29 deletions
diff --git a/ui/cli/tap-exportobject.h b/ui/cli/tap-exportobject.h index 83b117db54..180eca9f84 100644 --- a/ui/cli/tap-exportobject.h +++ b/ui/cli/tap-exportobject.h @@ -14,8 +14,6 @@ extern "C" { #endif /* __cplusplus */ -#define LONGOPT_EXPORT_OBJECTS 5001 - void eo_list_object_types(void); /* will be called by main each time a --export-objects option is found */ diff --git a/ui/clopts_common.h b/ui/clopts_common.h index 6b8a6504a2..cd9ff161d6 100644 --- a/ui/clopts_common.h +++ b/ui/clopts_common.h @@ -15,6 +15,22 @@ extern "C" { #endif /* __cplusplus */ +/* + * Long options. + * For long options with no corresponding short options, we define values + * outside the range of ASCII graphic characters, make that the last + * component of the entry for the long option, and have a case for that + * option in the switch statement. + */ +// Base value for capture related long options +#define LONGOPT_BASE_CAPTURE 1000 +// Base value for dissector related long options +#define LONGOPT_BASE_DISSECTOR 2000 +// Base value for application specific long options +#define LONGOPT_BASE_APPLICATION 3000 +// Base value for GUI specific long options +#define LONGOPT_BASE_GUI 4000 + extern int get_natural_int(const char *string, const char *name); diff --git a/ui/commandline.c b/ui/commandline.c index 39a192fc41..52bc33d681 100644 --- a/ui/commandline.c +++ b/ui/commandline.c @@ -188,16 +188,7 @@ commandline_print_usage(gboolean for_help_option) { #endif } -/* - * For long options with no corresponding short options, we define values - * outside the range of ASCII graphic characters, make that the last - * component of the entry for the long option, and have a case for that - * option in the switch statement. - * - * We also pick values >= 65536, so as to leave values from 128 to 65535 - * for capture and dissection options. - */ -#define LONGOPT_FULL_SCREEN 65536 +#define LONGOPT_FULL_SCREEN LONGOPT_BASE_GUI+1 #define OPTSTRING OPTSTRING_CAPTURE_COMMON OPTSTRING_DISSECT_COMMON "C:g:HhjJ:klm:o:P:r:R:Svw:X:Y:z:" static const struct option long_options[] = { diff --git a/ui/dissect_opts.h b/ui/dissect_opts.h index 0ad341beaf..4133799b61 100644 --- a/ui/dissect_opts.h +++ b/ui/dissect_opts.h @@ -26,25 +26,12 @@ extern "C" { * Long options. * We do not currently have long options corresponding to all short * options; we should probably pick appropriate option names for them. - * - * For long options with no corresponding short options, we define values - * outside the range of ASCII graphic characters, make that the last - * component of the entry for the long option, and have a case for that - * option in the switch statement. - * - * We also pick values >= 4096, so as not to collide with capture options, - * and <= 65535, so as to leave values > 65535 for options specific to a - * program. */ -/* - * Non-capture long-only options should start here, to avoid collision - * with capture options. - */ -#define LONGOPT_DISABLE_PROTOCOL 4096 -#define LONGOPT_ENABLE_HEURISTIC 4097 -#define LONGOPT_DISABLE_HEURISTIC 4098 -#define LONGOPT_ENABLE_PROTOCOL 4099 +#define LONGOPT_DISABLE_PROTOCOL LONGOPT_BASE_DISSECTOR+1 +#define LONGOPT_ENABLE_HEURISTIC LONGOPT_BASE_DISSECTOR+2 +#define LONGOPT_DISABLE_HEURISTIC LONGOPT_BASE_DISSECTOR+3 +#define LONGOPT_ENABLE_PROTOCOL LONGOPT_BASE_DISSECTOR+4 /* * Options for dissecting common to all dissecting programs. |