Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
ws_getopt.h
Go to the documentation of this file.
1
29#ifndef _WS_GETOPT_H_
30#define _WS_GETOPT_H_
31
32#include <ws_symbol_export.h>
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
49WS_DLL_PUBLIC int ws_getopt(int argc, char * const argv[], const char *optstring);
50WS_DLL_PUBLIC char *ws_optarg;
51WS_DLL_PUBLIC int ws_optind, ws_opterr, ws_optopt, ws_optpos, ws_optreset;
52
64struct ws_option {
65 const char *name;
66 int has_arg;
67 int *flag;
68 int val;
69};
70
85WS_DLL_PUBLIC int ws_getopt_long(int argc, char *const *argv, const char *optstring, const struct ws_option *longopts, int *idx);
86
100WS_DLL_PUBLIC int ws_getopt_long_only(int argc, char *const *argv, const char *optstring, const struct ws_option *longopts, int *idx);
101
102#define ws_no_argument 0
103#define ws_required_argument 1
104#define ws_optional_argument 2
105
106#ifdef __cplusplus
107}
108#endif
109
110#endif
Structure representing a long-form command-line option.
Definition ws_getopt.h:64
WS_DLL_PUBLIC int ws_getopt_long(int argc, char *const *argv, const char *optstring, const struct ws_option *longopts, int *idx)
Parse command-line options, supporting both short and long forms.
Definition ws_getopt.c:265
WS_DLL_PUBLIC int ws_getopt_long_only(int argc, char *const *argv, const char *optstring, const struct ws_option *longopts, int *idx)
Parse command-line options, treating all options as long unless prefixed with '+'.
Definition ws_getopt.c:270
WS_DLL_PUBLIC int ws_getopt(int argc, char *const argv[], const char *optstring)
Parse command-line options.
Definition ws_getopt.c:66