PageRenderTime 46ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/tools/BNTester/cmdline.h

https://bitbucket.org/libsleipnir/sleipnir/
C Header | 216 lines | 107 code | 23 blank | 86 comment | 0 complexity | 31883f228e8dc0421918035d3e2928d7 MD5 | raw file
Possible License(s): CC-BY-3.0
  1. /** @file cmdline.h
  2. * @brief The header file for the command line option parser
  3. * generated by GNU Gengetopt version 2.22
  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 */
  7. #ifndef CMDLINE_H
  8. #define CMDLINE_H
  9. /* If we use autoconf. */
  10. #ifdef HAVE_CONFIG_H
  11. #include "config.h"
  12. #endif
  13. #include <stdio.h> /* for FILE */
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif /* __cplusplus */
  17. #ifndef CMDLINE_PARSER_PACKAGE
  18. /** @brief the program name */
  19. #define CMDLINE_PARSER_PACKAGE "BNTester"
  20. #endif
  21. #ifndef CMDLINE_PARSER_VERSION
  22. /** @brief the program version */
  23. #define CMDLINE_PARSER_VERSION "1.0"
  24. #endif
  25. /** @brief Where the command line options are stored */
  26. struct gengetopt_args_info
  27. {
  28. const char *help_help; /**< @brief Print help and exit help description. */
  29. const char *version_help; /**< @brief Print version and exit help description. */
  30. char * datadir_arg; /**< @brief Data directory. */
  31. char * datadir_orig; /**< @brief Data directory original value given at command line. */
  32. const char *datadir_help; /**< @brief Data directory help description. */
  33. char * dataset_arg; /**< @brief Dataset DAD file. */
  34. char * dataset_orig; /**< @brief Dataset DAD file original value given at command line. */
  35. const char *dataset_help; /**< @brief Dataset DAD file help description. */
  36. char * input_arg; /**< @brief Input (X)DSL file. */
  37. char * input_orig; /**< @brief Input (X)DSL file original value given at command line. */
  38. const char *input_help; /**< @brief Input (X)DSL file help description. */
  39. char * output_arg; /**< @brief Output DAB file. */
  40. char * output_orig; /**< @brief Output DAB file original value given at command line. */
  41. const char *output_help; /**< @brief Output DAB file help description. */
  42. int everything_flag; /**< @brief Evaluate pairs without an answer (default=off). */
  43. const char *everything_help; /**< @brief Evaluate pairs without an answer help description. */
  44. char * genes_arg; /**< @brief Gene inclusion file. */
  45. char * genes_orig; /**< @brief Gene inclusion file original value given at command line. */
  46. const char *genes_help; /**< @brief Gene inclusion file help description. */
  47. char * genex_arg; /**< @brief Gene exclusion file. */
  48. char * genex_orig; /**< @brief Gene exclusion file original value given at command line. */
  49. const char *genex_help; /**< @brief Gene exclusion file help description. */
  50. char * genee_arg; /**< @brief Term inclusion file. */
  51. char * genee_orig; /**< @brief Term inclusion file original value given at command line. */
  52. const char *genee_help; /**< @brief Term inclusion file help description. */
  53. int zero_flag; /**< @brief Zero missing values (default=off). */
  54. const char *zero_help; /**< @brief Zero missing values help description. */
  55. int pnl_flag; /**< @brief Use PNL library (default=off). */
  56. const char *pnl_help; /**< @brief Use PNL library help description. */
  57. int function_flag; /**< @brief Use function-fitting networks (default=off). */
  58. const char *function_help; /**< @brief Use function-fitting networks help description. */
  59. int group_flag; /**< @brief Group identical inputs (default=on). */
  60. const char *group_help; /**< @brief Group identical inputs help description. */
  61. int verbosity_arg; /**< @brief Message verbosity (default='5'). */
  62. char * verbosity_orig; /**< @brief Message verbosity original value given at command line. */
  63. const char *verbosity_help; /**< @brief Message verbosity help description. */
  64. unsigned int help_given ; /**< @brief Whether help was given. */
  65. unsigned int version_given ; /**< @brief Whether version was given. */
  66. unsigned int datadir_given ; /**< @brief Whether datadir was given. */
  67. unsigned int dataset_given ; /**< @brief Whether dataset was given. */
  68. unsigned int input_given ; /**< @brief Whether input was given. */
  69. unsigned int output_given ; /**< @brief Whether output was given. */
  70. unsigned int everything_given ; /**< @brief Whether everything was given. */
  71. unsigned int genes_given ; /**< @brief Whether genes was given. */
  72. unsigned int genex_given ; /**< @brief Whether genex was given. */
  73. unsigned int genee_given ; /**< @brief Whether genee was given. */
  74. unsigned int zero_given ; /**< @brief Whether zero was given. */
  75. unsigned int pnl_given ; /**< @brief Whether pnl was given. */
  76. unsigned int function_given ; /**< @brief Whether function was given. */
  77. unsigned int group_given ; /**< @brief Whether group was given. */
  78. unsigned int verbosity_given ; /**< @brief Whether verbosity was given. */
  79. char **inputs ; /**< @brief unamed options (options without names) */
  80. unsigned inputs_num ; /**< @brief unamed options number */
  81. int Data_group_counter; /**< @brief Counter for group Data */
  82. } ;
  83. /** @brief The additional parameters to pass to parser functions */
  84. struct cmdline_parser_params
  85. {
  86. int override; /**< @brief whether to override possibly already present options (default 0) */
  87. int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
  88. int check_required; /**< @brief whether to check that all required options were provided (default 1) */
  89. int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
  90. int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
  91. } ;
  92. /** @brief the purpose string of the program */
  93. extern const char *gengetopt_args_info_purpose;
  94. /** @brief the usage string of the program */
  95. extern const char *gengetopt_args_info_usage;
  96. /** @brief all the lines making the help output */
  97. extern const char *gengetopt_args_info_help[];
  98. /**
  99. * The command line parser
  100. * @param argc the number of command line options
  101. * @param argv the command line options
  102. * @param args_info the structure where option information will be stored
  103. * @return 0 if everything went fine, NON 0 if an error took place
  104. */
  105. int cmdline_parser (int argc, char * const *argv,
  106. struct gengetopt_args_info *args_info);
  107. /**
  108. * The command line parser (version with additional parameters - deprecated)
  109. * @param argc the number of command line options
  110. * @param argv the command line options
  111. * @param args_info the structure where option information will be stored
  112. * @param override whether to override possibly already present options
  113. * @param initialize whether to initialize the option structure my_args_info
  114. * @param check_required whether to check that all required options were provided
  115. * @return 0 if everything went fine, NON 0 if an error took place
  116. * @deprecated use cmdline_parser_ext() instead
  117. */
  118. int cmdline_parser2 (int argc, char * const *argv,
  119. struct gengetopt_args_info *args_info,
  120. int override, int initialize, int check_required);
  121. /**
  122. * The command line parser (version with additional parameters)
  123. * @param argc the number of command line options
  124. * @param argv the command line options
  125. * @param args_info the structure where option information will be stored
  126. * @param params additional parameters for the parser
  127. * @return 0 if everything went fine, NON 0 if an error took place
  128. */
  129. int cmdline_parser_ext (int argc, char * const *argv,
  130. struct gengetopt_args_info *args_info,
  131. struct cmdline_parser_params *params);
  132. /**
  133. * Save the contents of the option struct into an already open FILE stream.
  134. * @param outfile the stream where to dump options
  135. * @param args_info the option struct to dump
  136. * @return 0 if everything went fine, NON 0 if an error took place
  137. */
  138. int cmdline_parser_dump(FILE *outfile,
  139. struct gengetopt_args_info *args_info);
  140. /**
  141. * Save the contents of the option struct into a (text) file.
  142. * This file can be read by the config file parser (if generated by gengetopt)
  143. * @param filename the file where to save
  144. * @param args_info the option struct to save
  145. * @return 0 if everything went fine, NON 0 if an error took place
  146. */
  147. int cmdline_parser_file_save(const char *filename,
  148. struct gengetopt_args_info *args_info);
  149. /**
  150. * Print the help
  151. */
  152. void cmdline_parser_print_help(void);
  153. /**
  154. * Print the version
  155. */
  156. void cmdline_parser_print_version(void);
  157. /**
  158. * Initializes all the fields a cmdline_parser_params structure
  159. * to their default values
  160. * @param params the structure to initialize
  161. */
  162. void cmdline_parser_params_init(struct cmdline_parser_params *params);
  163. /**
  164. * Allocates dynamically a cmdline_parser_params structure and initializes
  165. * all its fields to their default values
  166. * @return the created and initialized cmdline_parser_params structure
  167. */
  168. struct cmdline_parser_params *cmdline_parser_params_create(void);
  169. /**
  170. * Initializes the passed gengetopt_args_info structure's fields
  171. * (also set default values for options that have a default)
  172. * @param args_info the structure to initialize
  173. */
  174. void cmdline_parser_init (struct gengetopt_args_info *args_info);
  175. /**
  176. * Deallocates the string fields of the gengetopt_args_info structure
  177. * (but does not deallocate the structure itself)
  178. * @param args_info the structure to deallocate
  179. */
  180. void cmdline_parser_free (struct gengetopt_args_info *args_info);
  181. /**
  182. * Checks that all the required options were specified
  183. * @param args_info the structure to check
  184. * @param prog_name the name of the program that will be used to print
  185. * possible errors
  186. * @return
  187. */
  188. int cmdline_parser_required (struct gengetopt_args_info *args_info,
  189. const char *prog_name);
  190. #ifdef __cplusplus
  191. }
  192. #endif /* __cplusplus */
  193. #endif /* CMDLINE_H */