/** @file test_values_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_VALUES_CMD_H #define TEST_VALUES_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_VALUES_CMD_PARSER_PACKAGE /** @brief the program name (used for printing errors) */ #define TEST_VALUES_CMD_PARSER_PACKAGE "test_values" #endif #ifndef TEST_VALUES_CMD_PARSER_PACKAGE_NAME /** @brief the complete program name (used for help and version) */ #define TEST_VALUES_CMD_PARSER_PACKAGE_NAME "test_values" #endif #ifndef TEST_VALUES_CMD_PARSER_VERSION /** @brief the program version */ #define TEST_VALUES_CMD_PARSER_VERSION "1.0" #endif enum enum_values_first_enums { values_first_enums__NULL = -1, values_first_enums_arg_FOO = 0, values_first_enums_arg_BAR, values_first_enums_arg_ANOTHER, values_first_enums_arg_SOMETHING }; enum enum_values_first_enums_plus { values_first_enums_plus__NULL = -1, values_first_enums_plus_arg_PLUS_foo = 0, values_first_enums_plus_arg_PLUS_bar, values_first_enums_plus_arg_MINUS_foo, values_first_enums_plus_arg_MINUS_bar, values_first_enums_plus_arg_all }; enum enum_values_second_enums { values_second_enums__NULL = -1, values_second_enums_arg_90 = 0, values_second_enums_arg_180, values_second_enums_arg_270, values_second_enums_arg_360 }; enum enum_values_multiple_enums { values_multiple_enums__NULL = -1, values_multiple_enums_arg_FIRST = 0, values_multiple_enums_arg_SECOND, values_multiple_enums_arg_THIRD, values_multiple_enums_arg_FOURTH }; enum enum_values_unspecified_enums { values_unspecified_enums__NULL = -1, values_unspecified_enums_arg_FOO = 0, values_unspecified_enums_arg_BAR, values_unspecified_enums_arg_ANOTHER, values_unspecified_enums_arg_SOMETHING }; /** @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 *version_help; /**< @brief Print version and exit help description. */ char * string_values_arg; /**< @brief string option with values. */ char * string_values_orig; /**< @brief string option with values original value given at command line. */ const char *string_values_help; /**< @brief string option with values help description. */ char * string_values_plus_arg; /**< @brief string option with values containing + and -. */ char * string_values_plus_orig; /**< @brief string option with values containing + and - original value given at command line. */ const char *string_values_plus_help; /**< @brief string option with values containing + and - help description. */ char * string_values_def_arg; /**< @brief string option with values and default (default='bar'). */ char * string_values_def_orig; /**< @brief string option with values and default original value given at command line. */ const char *string_values_def_help; /**< @brief string option with values and default help description. */ char * string_values_def_argopt_arg; /**< @brief string option with values and default and optional argument (default='foobar'). */ char * string_values_def_argopt_orig; /**< @brief string option with values and default and optional argument original value given at command line. */ const char *string_values_def_argopt_help; /**< @brief string option with values and default and optional argument help description. */ char * string_values_no_short_arg; /**< @brief string option with values no short. */ char * string_values_no_short_orig; /**< @brief string option with values no short original value given at command line. */ const char *string_values_no_short_help; /**< @brief string option with values no short help description. */ char ** multistring_values_arg; /**< @brief multiple string option with values. */ char ** multistring_values_orig; /**< @brief multiple string option with values original value given at command line. */ unsigned int multistring_values_min; /**< @brief multiple string option with values's minimum occurreces */ unsigned int multistring_values_max; /**< @brief multiple string option with values's maximum occurreces */ const char *multistring_values_help; /**< @brief multiple string option with values help description. */ char ** multistring_values_def_arg; /**< @brief multiple string option with values and default (default='foo'). */ char ** multistring_values_def_orig; /**< @brief multiple string option with values and default original value given at command line. */ unsigned int multistring_values_def_min; /**< @brief multiple string option with values and default's minimum occurreces */ unsigned int multistring_values_def_max; /**< @brief multiple string option with values and default's maximum occurreces */ const char *multistring_values_def_help; /**< @brief multiple string option with values and default help description. */ char ** multistring_values_no_short_arg; /**< @brief multiple string option with values no-short. */ char ** multistring_values_no_short_orig; /**< @brief multiple string option with values no-short original value given at command line. */ unsigned int multistring_values_no_short_min; /**< @brief multiple string option with values no-short's minimum occurreces */ unsigned int multistring_values_no_short_max; /**< @brief multiple string option with values no-short's maximum occurreces */ const char *multistring_values_no_short_help; /**< @brief multiple string option with values no-short help description. */ char * string_values_group_arg; /**< @brief group string option with values and default (default='bar'). */ char * string_values_group_orig; /**< @brief group string option with values and default original value given at command line. */ const char *string_values_group_help; /**< @brief group string option with values and default help description. */ int int_values_arg; /**< @brief int option with values. */ char * int_values_orig; /**< @brief int option with values original value given at command line. */ const char *int_values_help; /**< @brief int option with values help description. */ int* int_values_m_arg; /**< @brief multiple int option with values. */ char ** int_values_m_orig; /**< @brief multiple int option with values original value given at command line. */ unsigned int int_values_m_min; /**< @brief multiple int option with values's minimum occurreces */ unsigned int int_values_m_max; /**< @brief multiple int option with values's maximum occurreces */ const char *int_values_m_help; /**< @brief multiple int option with values help description. */ int int_values_def_arg; /**< @brief int option with values and default (default='180'). */ char * int_values_def_orig; /**< @brief int option with values and default original value given at command line. */ const char *int_values_def_help; /**< @brief int option with values and default help description. */ enum enum_values_first_enums values_first_enums_arg; /**< @brief option with values and enums 1. */ char * values_first_enums_orig; /**< @brief option with values and enums 1 original value given at command line. */ const char *values_first_enums_help; /**< @brief option with values and enums 1 help description. */ enum enum_values_first_enums_plus values_first_enums_plus_arg; /**< @brief option with values and enums with plus and minus 1. */ char * values_first_enums_plus_orig; /**< @brief option with values and enums with plus and minus 1 original value given at command line. */ const char *values_first_enums_plus_help; /**< @brief option with values and enums with plus and minus 1 help description. */ enum enum_values_second_enums values_second_enums_arg; /**< @brief option with values and enums 2 with default (default='180'). */ char * values_second_enums_orig; /**< @brief option with values and enums 2 with default original value given at command line. */ const char *values_second_enums_help; /**< @brief option with values and enums 2 with default help description. */ enum enum_values_multiple_enums *values_multiple_enums_arg; /**< @brief multiple option with values and enums (default='FOURTH'). */ char ** values_multiple_enums_orig; /**< @brief multiple option with values and enums original value given at command line. */ unsigned int values_multiple_enums_min; /**< @brief multiple option with values and enums's minimum occurreces */ unsigned int values_multiple_enums_max; /**< @brief multiple option with values and enums's maximum occurreces */ const char *values_multiple_enums_help; /**< @brief multiple option with values and enums help description. */ enum enum_values_unspecified_enums values_unspecified_enums_arg; /**< @brief option with values that will not be specified on the command line. */ char * values_unspecified_enums_orig; /**< @brief option with values that will not be specified on the command line original value given at command line. */ const char *values_unspecified_enums_help; /**< @brief option with values that will not be specified on the command 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 version_given ; /**< @brief Whether version was given. */ unsigned int string_values_given ; /**< @brief Whether string-values was given. */ unsigned int string_values_plus_given ; /**< @brief Whether string-values-plus was given. */ unsigned int string_values_def_given ; /**< @brief Whether string-values-def was given. */ unsigned int string_values_def_argopt_given ; /**< @brief Whether string-values-def-argopt was given. */ unsigned int string_values_no_short_given ; /**< @brief Whether string-values-no-short was given. */ unsigned int multistring_values_given ; /**< @brief Whether multistring-values was given. */ unsigned int multistring_values_def_given ; /**< @brief Whether multistring-values-def was given. */ unsigned int multistring_values_no_short_given ; /**< @brief Whether multistring-values-no-short was given. */ unsigned int string_values_group_given ; /**< @brief Whether string-values-group was given. */ unsigned int int_values_given ; /**< @brief Whether int-values was given. */ unsigned int int_values_m_given ; /**< @brief Whether int-values-m was given. */ unsigned int int_values_def_given ; /**< @brief Whether int-values-def was given. */ unsigned int values_first_enums_given ; /**< @brief Whether values-first-enums was given. */ unsigned int values_first_enums_plus_given ; /**< @brief Whether values-first-enums-plus was given. */ unsigned int values_second_enums_given ; /**< @brief Whether values-second-enums was given. */ unsigned int values_multiple_enums_given ; /**< @brief Whether values-multiple-enums was given. */ unsigned int values_unspecified_enums_given ; /**< @brief Whether values-unspecified-enums 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 */ int group1_group_counter; /**< @brief Counter for group group1 */ } ; /** @brief The additional parameters to pass to parser functions */ struct test_values_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[]; /** * 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_values_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_values_cmd_parser_ext() instead */ int test_values_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_values_cmd_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct test_values_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_values_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_values_cmd_parser_file_save(const char *filename, struct gengetopt_args_info *args_info); /** * Print the help */ void test_values_cmd_parser_print_help(void); /** * Print the version */ void test_values_cmd_parser_print_version(void); /** * Initializes all the fields a test_values_cmd_parser_params structure * to their default values * @param params the structure to initialize */ void test_values_cmd_parser_params_init(struct test_values_cmd_parser_params *params); /** * Allocates dynamically a test_values_cmd_parser_params structure and initializes * all its fields to their default values * @return the created and initialized test_values_cmd_parser_params structure */ struct test_values_cmd_parser_params *test_values_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_values_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_values_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_values_cmd_parser_required (struct gengetopt_args_info *args_info, const char *prog_name); extern const char *test_values_cmd_parser_string_values_values[]; /**< @brief Possible values for string-values. */ extern const char *test_values_cmd_parser_string_values_plus_values[]; /**< @brief Possible values for string-values-plus. */ extern const char *test_values_cmd_parser_string_values_def_values[]; /**< @brief Possible values for string-values-def. */ extern const char *test_values_cmd_parser_string_values_def_argopt_values[]; /**< @brief Possible values for string-values-def-argopt. */ extern const char *test_values_cmd_parser_string_values_no_short_values[]; /**< @brief Possible values for string-values-no-short. */ extern const char *test_values_cmd_parser_multistring_values_values[]; /**< @brief Possible values for multistring-values. */ extern const char *test_values_cmd_parser_multistring_values_def_values[]; /**< @brief Possible values for multistring-values-def. */ extern const char *test_values_cmd_parser_multistring_values_no_short_values[]; /**< @brief Possible values for multistring-values-no-short. */ extern const char *test_values_cmd_parser_string_values_group_values[]; /**< @brief Possible values for string-values-group. */ extern const char *test_values_cmd_parser_int_values_values[]; /**< @brief Possible values for int-values. */ extern const char *test_values_cmd_parser_int_values_m_values[]; /**< @brief Possible values for int-values-m. */ extern const char *test_values_cmd_parser_int_values_def_values[]; /**< @brief Possible values for int-values-def. */ extern const char *test_values_cmd_parser_values_first_enums_values[]; /**< @brief Possible values for values-first-enums. */ extern const char *test_values_cmd_parser_values_first_enums_plus_values[]; /**< @brief Possible values for values-first-enums-plus. */ extern const char *test_values_cmd_parser_values_second_enums_values[]; /**< @brief Possible values for values-second-enums. */ extern const char *test_values_cmd_parser_values_multiple_enums_values[]; /**< @brief Possible values for values-multiple-enums. */ extern const char *test_values_cmd_parser_values_unspecified_enums_values[]; /**< @brief Possible values for values-unspecified-enums. */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* TEST_VALUES_CMD_H */