/** @@file @header_file_name@.@header_file_ext@ * @@brief The header file for the command line option parser * generated by GNU Gengetopt @generator_version@ * http://www.gnu.org/software/gengetopt. * DO NOT modify this file, since it can be overwritten * @@author GNU Gengetopt */ #ifndef @ifndefname@_H #define @ifndefname@_H /* If we use autoconf. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* for FILE */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifndef @package_var_name@ /** @@brief the program name (used for printing errors) */ #define @package_var_name@ @package_var_val@ #endif #ifndef @package_var_name@_NAME /** @@brief the complete program name (used for help and version) */ @IF@ package_var_val:string != "PACKAGE" @THEN@ #define @package_var_name@_NAME @package_var_val@ @ELSE@ #ifdef PACKAGE_NAME #define @package_var_name@_NAME PACKAGE_NAME #else #define @package_var_name@_NAME PACKAGE #endif @ENDIF@ #endif #ifndef @version_var_name@ /** @@brief the program version */ #define @version_var_name@ @version_var_val@ #endif @enum_types:method{iteration=true}@ /** @@brief Where the command line options are stored */ struct @args_info@ { @option_arg:method@ @option_given:method@ @group_counters:method{iteration=true}@ @mode_counters:method{iteration=true}@ } ; /** @@brief The additional parameters to pass to parser functions */ struct @parser_name@_params { int override; /**< @@brief whether to override possibly already present options (default 0) */ int initialize; /**< @@brief whether to initialize the option structure @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 @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 *@args_info@_purpose; /** @@brief the usage string of the program */ extern const char *@args_info@_usage; /** @@brief the description string of the program */ extern const char *@args_info@_description; /** @@brief all the lines making the help output */ extern const char *@args_info@_help[]; @IF@ has_hidden @THEN@ /** @@brief all the lines making the full help output (including hidden options) */ extern const char *@args_info@_full_help[]; @ENDIF@ @IF@ has_details @THEN@ /** @@brief all the lines making the detailed help output (including hidden options and details) */ extern const char *@args_info@_detailed_help[]; @ENDIF@ /** * 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 @parser_name@ (int argc, char **argv, struct @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 @parser_name@_ext() instead */ int @parser_name@2 (int argc, char **argv, struct @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 @parser_name@_ext (int argc, char **argv, struct @args_info@ *args_info, struct @parser_name@_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 @parser_name@_dump(FILE *outfile, struct @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 @parser_name@_file_save(const char *filename, struct @args_info@ *args_info); /** * Print the help */ void @parser_name@_print_help(void); @IF@ has_hidden @THEN@ /** * Print the full help (including hidden options) */ void @parser_name@_print_full_help(void); @ENDIF@ @IF@ has_details @THEN@ /** * Print the detailed help (including hidden options and details) */ void @parser_name@_print_detailed_help(void); @ENDIF@ /** * Print the version */ void @parser_name@_print_version(void); /** * Initializes all the fields a @parser_name@_params structure * to their default values * @@param params the structure to initialize */ void @parser_name@_params_init(struct @parser_name@_params *params); /** * Allocates dynamically a @parser_name@_params structure and initializes * all its fields to their default values * @@return the created and initialized @parser_name@_params structure */ struct @parser_name@_params *@parser_name@_params_create(void); /** * Initializes the passed @args_info@ structure's fields * (also set default values for options that have a default) * @@param args_info the structure to initialize */ void @parser_name@_init (struct @args_info@ *args_info); /** * Deallocates the string fields of the @args_info@ structure * (but does not deallocate the structure itself) * @@param args_info the structure to deallocate */ void @parser_name@_free (struct @args_info@ *args_info); @IF@ generate_config_parser @THEN@ /** * The config file parser (deprecated version) * @@param filename the name of the config file * @@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 @parser_name@_config_file() instead */ int @parser_name@_configfile (const char *filename, struct @args_info@ *args_info, int override, int initialize, int check_required); /** * The config file parser * @@param filename the name of the config file * @@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 @parser_name@_config_file (const char *filename, struct @args_info@ *args_info, struct @parser_name@_params *params); @ENDIF@ @IF@ generate_string_parser @THEN@ /** * The string parser (interprets the passed string as a command line) * @@param cmdline the command line stirng * @@param args_info the structure where option information will be stored * @@param prog_name the name of the program that will be used to print * possible errors * @@return 0 if everything went fine, NON 0 if an error took place */ int @parser_name@_string (const char *cmdline, struct @args_info@ *args_info, const char *prog_name); /** * The string parser (version with additional parameters - deprecated) * @@param cmdline the command line stirng * @@param args_info the structure where option information will be stored * @@param prog_name the name of the program that will be used to print * possible errors * @@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 @parser_name@_string_ext() instead */ int @parser_name@_string2 (const char *cmdline, struct @args_info@ *args_info, const char *prog_name, int override, int initialize, int check_required); /** * The string parser (version with additional parameters) * @@param cmdline the command line stirng * @@param args_info the structure where option information will be stored * @@param prog_name the name of the program that will be used to print * possible errors * @@param params additional parameters for the parser * @@return 0 if everything went fine, NON 0 if an error took place */ int @parser_name@_string_ext (const char *cmdline, struct @args_info@ *args_info, const char *prog_name, struct @parser_name@_params *params); @ENDIF@ /** * 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 @parser_name@_required (struct @args_info@ *args_info, const char *prog_name); @option_values_decl:method{iteration=true}@ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* @ifndefname@_H */