p2m-cmdline.h
Go to the documentation of this file.
1 
8 #ifndef P2M_CMDLINE_H
9 #define P2M_CMDLINE_H
10 
11 /* If we use autoconf. */
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
15 
16 #include <stdio.h> /* for FILE */
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
22 #ifndef CMDLINE_PARSER_PACKAGE
24 #define CMDLINE_PARSER_PACKAGE "pcap2mjr"
25 #endif
26 
27 #ifndef CMDLINE_PARSER_PACKAGE_NAME
29 #define CMDLINE_PARSER_PACKAGE_NAME "pcap2mjr"
30 #endif
31 
32 #ifndef CMDLINE_PARSER_VERSION
34 #define CMDLINE_PARSER_VERSION "1.0.0"
35 #endif
36 
39 {
40  const char *help_help;
41  const char *version_help;
42  char * codec_arg;
43  char * codec_orig;
44  const char *codec_help;
45  int ssrc_arg;
46  char * ssrc_orig;
47  const char *ssrc_help;
49  const char *warnings_help;
51  unsigned int help_given ;
52  unsigned int version_given ;
53  unsigned int codec_given ;
54  unsigned int ssrc_given ;
55  unsigned int warnings_given ;
57 } ;
58 
61 {
62  int override;
63  int initialize;
64  int check_required;
65  int check_ambiguity;
66  int print_errors;
67 } ;
68 
70 extern const char *gengetopt_args_info_purpose;
72 extern const char *gengetopt_args_info_usage;
74 extern const char *gengetopt_args_info_description;
76 extern const char *gengetopt_args_info_help[];
77 
85 int cmdline_parser (int argc, char **argv,
86  struct gengetopt_args_info *args_info);
87 
99 int cmdline_parser2 (int argc, char **argv,
100  struct gengetopt_args_info *args_info,
101  int override, int initialize, int check_required);
102 
111 int cmdline_parser_ext (int argc, char **argv,
112  struct gengetopt_args_info *args_info,
113  struct cmdline_parser_params *params);
114 
121 int cmdline_parser_dump(FILE *outfile,
122  struct gengetopt_args_info *args_info);
123 
131 int cmdline_parser_file_save(const char *filename,
132  struct gengetopt_args_info *args_info);
133 
137 void cmdline_parser_print_help(void);
142 
149 
156 
162 void cmdline_parser_init (struct gengetopt_args_info *args_info);
168 void cmdline_parser_free (struct gengetopt_args_info *args_info);
169 
177 int cmdline_parser_required (struct gengetopt_args_info *args_info,
178  const char *prog_name);
179 
180 
181 #ifdef __cplusplus
182 }
183 #endif /* __cplusplus */
184 #endif /* P2M_CMDLINE_H */
Configuration files parsing (headers)
int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
Definition: cmdline.c:416
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
Definition: cmdline.c:560
int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
Definition: cmdline.c:519
const char * gengetopt_args_info_purpose
the purpose string of the program
Definition: cmdline.c:28
const char * gengetopt_args_info_help[]
all the lines making the help output
Definition: cmdline.c:36
int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
Definition: cmdline.c:582
int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name)
Definition: cmdline.c:605
void cmdline_parser_print_version(void)
Definition: cmdline.c:268
const char * gengetopt_args_info_usage
the usage string of the program
Definition: cmdline.c:30
int cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
Definition: cmdline.c:566
void cmdline_parser_init(struct gengetopt_args_info *args_info)
Definition: cmdline.c:309
const char * gengetopt_args_info_description
the description string of the program
Definition: cmdline.c:34
void cmdline_parser_print_help(void)
Definition: cmdline.c:300
void cmdline_parser_free(struct gengetopt_args_info *args_info)
Definition: cmdline.c:539
void cmdline_parser_params_init(struct cmdline_parser_params *params)
Definition: cmdline.c:317
struct cmdline_parser_params * cmdline_parser_params_create(void)
Definition: cmdline.c:330
The additional parameters to pass to parser functions.
Definition: cmdline.h:198
int print_errors
whether getopt_long should print an error message for a bad option (default 1)
Definition: cmdline.h:203
int check_required
whether to check that all required options were provided (default 1)
Definition: cmdline.h:201
int check_ambiguity
whether to check for options already specified in the option structure gengetopt_args_info (default 0...
Definition: cmdline.h:202
int initialize
whether to initialize the option structure gengetopt_args_info (default 1)
Definition: cmdline.h:200
Where the command line options are stored.
Definition: cmdline.h:39
int ssrc_arg
SSRC of the packets in the pcap file to save (pass 0 to autodetect).
Definition: p2m-cmdline.h:45
const char * ssrc_help
SSRC of the packets in the pcap file to save (pass 0 to autodetect) help description.
Definition: p2m-cmdline.h:47
char * codec_orig
Codec the recording will contain (e.g., opus, vp8, etc.) original value given at command line.
Definition: p2m-cmdline.h:43
const char * help_help
Print help and exit help description.
Definition: cmdline.h:40
char * codec_arg
Codec the recording will contain (e.g., opus, vp8, etc.).
Definition: p2m-cmdline.h:42
const char * codec_help
Codec the recording will contain (e.g., opus, vp8, etc.) help description.
Definition: p2m-cmdline.h:44
unsigned int warnings_given
Whether warnings was given.
Definition: p2m-cmdline.h:55
unsigned int ssrc_given
Whether ssrc was given.
Definition: p2m-cmdline.h:54
unsigned int codec_given
Whether codec was given.
Definition: p2m-cmdline.h:53
unsigned int help_given
Whether help was given.
Definition: cmdline.h:150
const char * warnings_help
Show warnings for skipped packets (e.g., not RTP or wrong SSRC) help description.
Definition: p2m-cmdline.h:49
unsigned int version_given
Whether version was given.
Definition: cmdline.h:151
const char * version_help
Print version and exit help description.
Definition: cmdline.h:41
char * ssrc_orig
SSRC of the packets in the pcap file to save (pass 0 to autodetect) original value given at command l...
Definition: p2m-cmdline.h:46
int warnings_flag
Show warnings for skipped packets (e.g., not RTP or wrong SSRC) (default=off).
Definition: p2m-cmdline.h:48