2 * @brief The header file for the command line option parser
3 * generated by GNU Gengetopt version 2.22.6
4 * http://www.gnu.org/software/gengetopt.
5 * DO NOT modify this file, since it can be overwritten
6 * @author GNU Gengetopt by Lorenzo Bettini */
11 /* If we use autoconf. */
16 #include <stdio.h> /* for FILE */
20 #endif /* __cplusplus */
22 #ifndef CMDLINE_PARSER_PACKAGE
23 /** @brief the program name (used for printing errors) */
24 #define CMDLINE_PARSER_PACKAGE "Jnet"
27 #ifndef CMDLINE_PARSER_PACKAGE_NAME
28 /** @brief the complete program name (used for help and version) */
29 #define CMDLINE_PARSER_PACKAGE_NAME "Jnet"
32 #ifndef CMDLINE_PARSER_VERSION
33 /** @brief the program version */
34 #define CMDLINE_PARSER_VERSION "2.2"
37 /** @brief Where the command line options are stored */
38 struct gengetopt_args_info
40 const char *help_help; /**< @brief Print help and exit help description. */
41 const char *version_help; /**< @brief Print version and exit help description. */
42 char * hmmer_arg; /**< @brief HMMER profile. */
43 char * hmmer_orig; /**< @brief HMMER profile original value given at command line. */
44 const char *hmmer_help; /**< @brief HMMER profile help description. */
45 char * pssm_arg; /**< @brief PSIBLAST PSSM. */
46 char * pssm_orig; /**< @brief PSIBLAST PSSM original value given at command line. */
47 const char *pssm_help; /**< @brief PSIBLAST PSSM help description. */
48 int test_flag; /**< @brief Flag for test style output (default=off). */
49 const char *test_help; /**< @brief Flag for test style output help description. */
50 const char *concise_help; /**< @brief concise output (default) help description. */
51 int human_arg; /**< @brief human readable output. Optionally, can take a width argument [default: 60]. */
52 char * human_orig; /**< @brief human readable output. Optionally, can take a width argument [default: 60] original value given at command line. */
53 const char *human_help; /**< @brief human readable output. Optionally, can take a width argument [default: 60] help description. */
55 unsigned int help_given ; /**< @brief Whether help was given. */
56 unsigned int version_given ; /**< @brief Whether version was given. */
57 unsigned int hmmer_given ; /**< @brief Whether hmmer was given. */
58 unsigned int pssm_given ; /**< @brief Whether pssm was given. */
59 unsigned int test_given ; /**< @brief Whether test was given. */
60 unsigned int concise_given ; /**< @brief Whether concise was given. */
61 unsigned int human_given ; /**< @brief Whether human was given. */
63 int output_group_counter; /**< @brief Counter for group output */
66 /** @brief The additional parameters to pass to parser functions */
67 struct cmdline_parser_params
69 int override; /**< @brief whether to override possibly already present options (default 0) */
70 int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
71 int check_required; /**< @brief whether to check that all required options were provided (default 1) */
72 int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
73 int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
76 /** @brief the purpose string of the program */
77 extern const char *gengetopt_args_info_purpose;
78 /** @brief the usage string of the program */
79 extern const char *gengetopt_args_info_usage;
80 /** @brief the description string of the program */
81 extern const char *gengetopt_args_info_description;
82 /** @brief all the lines making the help output */
83 extern const char *gengetopt_args_info_help[];
86 * The command line parser
87 * @param argc the number of command line options
88 * @param argv the command line options
89 * @param args_info the structure where option information will be stored
90 * @return 0 if everything went fine, NON 0 if an error took place
92 int cmdline_parser (int argc, char **argv,
93 struct gengetopt_args_info *args_info);
96 * The command line parser (version with additional parameters - deprecated)
97 * @param argc the number of command line options
98 * @param argv the command line options
99 * @param args_info the structure where option information will be stored
100 * @param override whether to override possibly already present options
101 * @param initialize whether to initialize the option structure my_args_info
102 * @param check_required whether to check that all required options were provided
103 * @return 0 if everything went fine, NON 0 if an error took place
104 * @deprecated use cmdline_parser_ext() instead
106 int cmdline_parser2 (int argc, char **argv,
107 struct gengetopt_args_info *args_info,
108 int override, int initialize, int check_required);
111 * The command line parser (version with additional parameters)
112 * @param argc the number of command line options
113 * @param argv the command line options
114 * @param args_info the structure where option information will be stored
115 * @param params additional parameters for the parser
116 * @return 0 if everything went fine, NON 0 if an error took place
118 int cmdline_parser_ext (int argc, char **argv,
119 struct gengetopt_args_info *args_info,
120 struct cmdline_parser_params *params);
123 * Save the contents of the option struct into an already open FILE stream.
124 * @param outfile the stream where to dump options
125 * @param args_info the option struct to dump
126 * @return 0 if everything went fine, NON 0 if an error took place
128 int cmdline_parser_dump(FILE *outfile,
129 struct gengetopt_args_info *args_info);
132 * Save the contents of the option struct into a (text) file.
133 * This file can be read by the config file parser (if generated by gengetopt)
134 * @param filename the file where to save
135 * @param args_info the option struct to save
136 * @return 0 if everything went fine, NON 0 if an error took place
138 int cmdline_parser_file_save(const char *filename,
139 struct gengetopt_args_info *args_info);
144 void cmdline_parser_print_help(void);
148 void cmdline_parser_print_version(void);
151 * Initializes all the fields a cmdline_parser_params structure
152 * to their default values
153 * @param params the structure to initialize
155 void cmdline_parser_params_init(struct cmdline_parser_params *params);
158 * Allocates dynamically a cmdline_parser_params structure and initializes
159 * all its fields to their default values
160 * @return the created and initialized cmdline_parser_params structure
162 struct cmdline_parser_params *cmdline_parser_params_create(void);
165 * Initializes the passed gengetopt_args_info structure's fields
166 * (also set default values for options that have a default)
167 * @param args_info the structure to initialize
169 void cmdline_parser_init (struct gengetopt_args_info *args_info);
171 * Deallocates the string fields of the gengetopt_args_info structure
172 * (but does not deallocate the structure itself)
173 * @param args_info the structure to deallocate
175 void cmdline_parser_free (struct gengetopt_args_info *args_info);
178 * Checks that all the required options were specified
179 * @param args_info the structure to check
180 * @param prog_name the name of the program that will be used to print
184 int cmdline_parser_required (struct gengetopt_args_info *args_info,
185 const char *prog_name);
190 #endif /* __cplusplus */
191 #endif /* CMDLINE_H */