summaryrefslogtreecommitdiffstats
path: root/src/progs/ingen/cmdline.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/progs/ingen/cmdline.h')
-rw-r--r--src/progs/ingen/cmdline.h53
1 files changed, 36 insertions, 17 deletions
diff --git a/src/progs/ingen/cmdline.h b/src/progs/ingen/cmdline.h
index 9caa9529..80358089 100644
--- a/src/progs/ingen/cmdline.h
+++ b/src/progs/ingen/cmdline.h
@@ -1,6 +1,6 @@
/** @file cmdline.h
* @brief The header file for the command line option parser
- * generated by GNU Gengetopt version 2.21
+ * 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 */
@@ -13,6 +13,8 @@
#include "config.h"
#endif
+#include <stdio.h> /* for FILE */
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -58,17 +60,17 @@ struct gengetopt_args_info
char * parallelism_orig; /**< @brief Number of concurrent process threads original value given at command line. */
const char *parallelism_help; /**< @brief Number of concurrent process threads help description. */
- int help_given ; /**< @brief Whether help was given. */
- int version_given ; /**< @brief Whether version was given. */
- int engine_given ; /**< @brief Whether engine was given. */
- int engine_port_given ; /**< @brief Whether engine-port was given. */
- int connect_given ; /**< @brief Whether connect was given. */
- int gui_given ; /**< @brief Whether gui was given. */
- int client_port_given ; /**< @brief Whether client-port was given. */
- int load_given ; /**< @brief Whether load was given. */
- int path_given ; /**< @brief Whether path was given. */
- int run_given ; /**< @brief Whether run was given. */
- int parallelism_given ; /**< @brief Whether parallelism was given. */
+ unsigned int help_given ; /**< @brief Whether help was given. */
+ unsigned int version_given ; /**< @brief Whether version was given. */
+ unsigned int engine_given ; /**< @brief Whether engine was given. */
+ unsigned int engine_port_given ; /**< @brief Whether engine-port was given. */
+ unsigned int connect_given ; /**< @brief Whether connect was given. */
+ unsigned int gui_given ; /**< @brief Whether gui was given. */
+ unsigned int client_port_given ; /**< @brief Whether client-port was given. */
+ unsigned int load_given ; /**< @brief Whether load was given. */
+ unsigned int path_given ; /**< @brief Whether path was given. */
+ unsigned int run_given ; /**< @brief Whether run was given. */
+ unsigned int parallelism_given ; /**< @brief Whether parallelism was given. */
} ;
@@ -76,9 +78,10 @@ struct gengetopt_args_info
struct cmdline_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 0) */
- int check_required; /**< @brief whether to check that all required options were provided (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 */
@@ -126,6 +129,15 @@ int cmdline_parser_ext (int argc, char * const *argv,
struct cmdline_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 cmdline_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
@@ -145,11 +157,18 @@ void cmdline_parser_print_help(void);
void cmdline_parser_print_version(void);
/**
+ * Initializes all the fields a cmdline_parser_params structure
+ * to their default values
+ * @param params the structure to initialize
+ */
+void cmdline_parser_params_init(struct cmdline_parser_params *params);
+
+/**
* Allocates dynamically a cmdline_parser_params structure and initializes
- * all its fields to 0
- * @return the initialized cmdline_parser_params structure
+ * all its fields to their default values
+ * @return the created and initialized cmdline_parser_params structure
*/
-struct cmdline_parser_params *cmdline_parser_params_init();
+struct cmdline_parser_params *cmdline_parser_params_create(void);
/**
* Initializes the passed gengetopt_args_info structure's fields