/** @file test_all_opts_cmd.h * @brief The header file for the command line option parser * generated by GNU Gengetopt * http://www.gnu.org/software/gengetopt. * DO NOT modify this file, since it can be overwritten * @author GNU Gengetopt by Lorenzo Bettini */ #ifndef TEST_ALL_OPTS_CMD_H #define TEST_ALL_OPTS_CMD_H /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for FILE */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef TEST_ALL_OPTS_CMD_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ #define TEST_ALL_OPTS_CMD_PARSER_PACKAGE "test_all_opts" #endif #ifndef TEST_ALL_OPTS_CMD_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ #define TEST_ALL_OPTS_CMD_PARSER_PACKAGE_NAME "test_all_opts" #endif #ifndef TEST_ALL_OPTS_CMD_PARSER_VERSION /** @brief the program version */ #define TEST_ALL_OPTS_CMD_PARSER_VERSION "1.0" #endif /** @brief Where the command line options are stored */ struct gengetopt_args_info { const char *help_help; /**< @brief Print help and exit help description. */ const char *detailed_help_help; /**< @brief Print help, including all details and hidden options, and exit help description. */ const char *full_help_help; /**< @brief Print help, including hidden options, and exit help description. */ const char *version_help; /**< @brief Print version and exit help description. */ char * string_arg; /**< @brief string option. */ char * string_orig; /**< @brief string option original value given at command line. */ const char *string_help; /**< @brief string option help description. */ int int_arg; /**< @brief int option. */ char * int_orig; /**< @brief int option original value given at command line. */ const char *int_help; /**< @brief int option help description. */ short short_arg; /**< @brief short option. */ char * short_orig; /**< @brief short option original value given at command line. */ const char *short_help; /**< @brief short option help description. */ long long_arg; /**< @brief long option. */ char * long_orig; /**< @brief long option original value given at command line. */ const char *long_help; /**< @brief long option help description. */ float float_arg; /**< @brief float option. */ char * float_orig; /**< @brief float option original value given at command line. */ const char *float_help; /**< @brief float option help description. */ double double_arg; /**< @brief double option. */ char * double_orig; /**< @brief double option original value given at command line. */ const char *double_help; /**< @brief double option help description. */ long double longdouble_arg; /**< @brief longdouble option. */ char * longdouble_orig; /**< @brief longdouble option original value given at command line. */ const char *longdouble_help; /**< @brief longdouble option help description. */ #if defined(HAVE_LONG_LONG) || defined(HAVE_LONG_LONG_INT) long long int longlong_arg; /**< @brief longlong option. */ #else long longlong_arg; /**< @brief longlong option. */ #endif char * longlong_orig; /**< @brief longlong option original value given at command line. */ const char *longlong_help; /**< @brief longlong option help description. */ int flag_flag; /**< @brief flag option (default=on). */ const char *flag_help; /**< @brief flag option help description. */ const char *function_help; /**< @brief function option help description. */ const char *no_short_help; /**< @brief no short option help description. */ char * opt_arg_arg; /**< @brief option with optional arg. */ char * opt_arg_orig; /**< @brief option with optional arg original value given at command line. */ const char *opt_arg_help; /**< @brief option with optional arg help description. */ char * opt_arg_short_arg; /**< @brief option with optional arg (short). */ char * opt_arg_short_orig; /**< @brief option with optional arg (short) original value given at command line. */ const char *opt_arg_short_help; /**< @brief option with optional arg (short) help description. */ char * required_arg; /**< @brief required option. */ char * required_orig; /**< @brief required option original value given at command line. */ const char *required_help; /**< @brief required option help description. */ int hidden_arg; /**< @brief hidden option. */ char * hidden_orig; /**< @brief hidden option original value given at command line. */ const char *hidden_help; /**< @brief hidden option help description. */ char * dependant_arg; /**< @brief option that depends on opt-arg. */ char * dependant_orig; /**< @brief option that depends on opt-arg original value given at command line. */ const char *dependant_help; /**< @brief option that depends on opt-arg help description. */ char * very_very_long_option_arg; /**< @brief the name of this option is long enough to make this description begin on a new line. */ char * very_very_long_option_orig; /**< @brief the name of this option is long enough to make this description begin on a new line original value given at command line. */ const char *very_very_long_option_help; /**< @brief the name of this option is long enough to make this description begin on a new line help description. */ const char *assume_multimeth_virtual_help; /**< @brief the name of this option is just as long as the maximum allowed, so this description begin on a new line help description. */ char * file_save_arg; /**< @brief save the passed options into a file. */ char * file_save_orig; /**< @brief save the passed options into a file original value given at command line. */ const char *file_save_help; /**< @brief save the passed options into a file help description. */ unsigned int help_given ; /**< @brief Whether help was given. */ unsigned int detailed_help_given ; /**< @brief Whether detailed-help was given. */ unsigned int full_help_given ; /**< @brief Whether full-help was given. */ unsigned int version_given ; /**< @brief Whether version was given. */ unsigned int string_given ; /**< @brief Whether string was given. */ unsigned int int_given ; /**< @brief Whether int was given. */ unsigned int short_given ; /**< @brief Whether short was given. */ unsigned int long_given ; /**< @brief Whether long was given. */ unsigned int float_given ; /**< @brief Whether float was given. */ unsigned int double_given ; /**< @brief Whether double was given. */ unsigned int longdouble_given ; /**< @brief Whether longdouble was given. */ unsigned int longlong_given ; /**< @brief Whether longlong was given. */ unsigned int flag_given ; /**< @brief Whether flag was given. */ unsigned int function_given ; /**< @brief Whether function was given. */ unsigned int no_short_given ; /**< @brief Whether no-short was given. */ unsigned int opt_arg_given ; /**< @brief Whether opt-arg was given. */ unsigned int opt_arg_short_given ; /**< @brief Whether opt-arg-short was given. */ unsigned int required_given ; /**< @brief Whether required was given. */ unsigned int hidden_given ; /**< @brief Whether hidden was given. */ unsigned int dependant_given ; /**< @brief Whether dependant was given. */ unsigned int very_very_long_option_given ; /**< @brief Whether very-very-long-option was given. */ unsigned int assume_multimeth_virtual_given ; /**< @brief Whether assume-multimeth-virtual was given. */ unsigned int file_save_given ; /**< @brief Whether file-save was given. */ char **inputs ; /**< @brief unamed options (options without names) */ unsigned inputs_num ; /**< @brief unamed options number */ } ; /** @brief The additional parameters to pass to parser functions */ struct test_all_opts_cmd_parser_params { int override; /**< @brief whether to override possibly already present options (default 0) */ int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */ int check_required; /**< @brief whether to check that all required options were provided (default 1) */ int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */ int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */ } ; /** @brief the purpose string of the program */ extern const char *gengetopt_args_info_purpose; /** @brief the usage string of the program */ extern const char *gengetopt_args_info_usage; /** @brief the description string of the program */ extern const char *gengetopt_args_info_description; /** @brief all the lines making the help output */ extern const char *gengetopt_args_info_help[]; /** @brief all the lines making the full help output (including hidden options) */ extern const char *gengetopt_args_info_full_help[]; /** @brief all the lines making the detailed help output (including hidden options and details) */ extern const char *gengetopt_args_info_detailed_help[]; /** * The command line parser * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @return 0 if everything went fine, NON 0 if an error took place */ int test_all_opts_cmd_parser (int argc, char **argv, struct gengetopt_args_info *args_info); /** * The command line parser (version with additional parameters - deprecated) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param override whether to override possibly already present options * @param initialize whether to initialize the option structure my_args_info * @param check_required whether to check that all required options were provided * @return 0 if everything went fine, NON 0 if an error took place * @deprecated use test_all_opts_cmd_parser_ext() instead */ int test_all_opts_cmd_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required); /** * The command line parser (version with additional parameters) * @param argc the number of command line options * @param argv the command line options * @param args_info the structure where option information will be stored * @param params additional parameters for the parser * @return 0 if everything went fine, NON 0 if an error took place */ int test_all_opts_cmd_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct test_all_opts_cmd_parser_params *params); /** * Save the contents of the option struct into an already open FILE stream. * @param outfile the stream where to dump options * @param args_info the option struct to dump * @return 0 if everything went fine, NON 0 if an error took place */ int test_all_opts_cmd_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info); /** * Save the contents of the option struct into a (text) file. * This file can be read by the config file parser (if generated by gengetopt) * @param filename the file where to save * @param args_info the option struct to save * @return 0 if everything went fine, NON 0 if an error took place */ int test_all_opts_cmd_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); /** * Print the help */ void test_all_opts_cmd_parser_print_help(void); /** * Print the full help (including hidden options) */ void test_all_opts_cmd_parser_print_full_help(void); /** * Print the detailed help (including hidden options and details) */ void test_all_opts_cmd_parser_print_detailed_help(void); /** * Print the version */ void test_all_opts_cmd_parser_print_version(void); /** * Initializes all the fields a test_all_opts_cmd_parser_params structure * to their default values * @param params the structure to initialize */ void test_all_opts_cmd_parser_params_init(struct test_all_opts_cmd_parser_params *params); /** * Allocates dynamically a test_all_opts_cmd_parser_params structure and initializes * all its fields to their default values * @return the created and initialized test_all_opts_cmd_parser_params structure */ struct test_all_opts_cmd_parser_params *test_all_opts_cmd_parser_params_create(void); /** * Initializes the passed gengetopt_args_info structure's fields * (also set default values for options that have a default) * @param args_info the structure to initialize */ void test_all_opts_cmd_parser_init (struct gengetopt_args_info *args_info); /** * Deallocates the string fields of the gengetopt_args_info structure * (but does not deallocate the structure itself) * @param args_info the structure to deallocate */ void test_all_opts_cmd_parser_free (struct gengetopt_args_info *args_info); /** * Checks that all the required options were specified * @param args_info the structure to check * @param prog_name the name of the program that will be used to print * possible errors * @return */ int test_all_opts_cmd_parser_required (struct gengetopt_args_info *args_info, const char *prog_name); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* TEST_ALL_OPTS_CMD_H */