PageRenderTime 83ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/tools/KNNImputer/cmdline.h

https://bitbucket.org/libsleipnir/sleipnir/
C Header | 213 lines | 103 code | 24 blank | 86 comment | 0 complexity | 106f4d0e0395ad6a7fed7c58e4f84324 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 "KNNImputer"
  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 * input_arg; /**< @brief Input PCL file. */
  31. char * input_orig; /**< @brief Input PCL file original value given at command line. */
  32. const char *input_help; /**< @brief Input PCL file help description. */
  33. char * output_arg; /**< @brief Output PCL file. */
  34. char * output_orig; /**< @brief Output PCL file original value given at command line. */
  35. const char *output_help; /**< @brief Output PCL file help description. */
  36. int neighbors_arg; /**< @brief Nearest neighbors to use (default='10'). */
  37. char * neighbors_orig; /**< @brief Nearest neighbors to use original value given at command line. */
  38. const char *neighbors_help; /**< @brief Nearest neighbors to use help description. */
  39. char * distance_arg; /**< @brief Similarity measure (default='euclidean'). */
  40. char * distance_orig; /**< @brief Similarity measure original value given at command line. */
  41. const char *distance_help; /**< @brief Similarity measure help description. */
  42. double missing_arg; /**< @brief Fraction of conditions which must be present (default='0.7'). */
  43. char * missing_orig; /**< @brief Fraction of conditions which must be present original value given at command line. */
  44. const char *missing_help; /**< @brief Fraction of conditions which must be present help description. */
  45. char * genes_arg; /**< @brief Gene inclusion file. */
  46. char * genes_orig; /**< @brief Gene inclusion file original value given at command line. */
  47. const char *genes_help; /**< @brief Gene inclusion file help description. */
  48. char * weights_arg; /**< @brief Input weights file. */
  49. char * weights_orig; /**< @brief Input weights file original value given at command line. */
  50. const char *weights_help; /**< @brief Input weights file help description. */
  51. int autocorrelate_flag; /**< @brief Autocorrelate distances (default=off). */
  52. const char *autocorrelate_help; /**< @brief Autocorrelate distances help description. */
  53. int skip_arg; /**< @brief Columns to skip in input PCL (default='2'). */
  54. char * skip_orig; /**< @brief Columns to skip in input PCL original value given at command line. */
  55. const char *skip_help; /**< @brief Columns to skip in input PCL help description. */
  56. int limit_arg; /**< @brief Gene count limit for caching (default='-1'). */
  57. char * limit_orig; /**< @brief Gene count limit for caching original value given at command line. */
  58. const char *limit_help; /**< @brief Gene count limit for caching help description. */
  59. int verbosity_arg; /**< @brief Message verbosity (default='5'). */
  60. char * verbosity_orig; /**< @brief Message verbosity original value given at command line. */
  61. const char *verbosity_help; /**< @brief Message verbosity help description. */
  62. unsigned int help_given ; /**< @brief Whether help was given. */
  63. unsigned int version_given ; /**< @brief Whether version was given. */
  64. unsigned int input_given ; /**< @brief Whether input was given. */
  65. unsigned int output_given ; /**< @brief Whether output was given. */
  66. unsigned int neighbors_given ; /**< @brief Whether neighbors was given. */
  67. unsigned int distance_given ; /**< @brief Whether distance was given. */
  68. unsigned int missing_given ; /**< @brief Whether missing was given. */
  69. unsigned int genes_given ; /**< @brief Whether genes was given. */
  70. unsigned int weights_given ; /**< @brief Whether weights was given. */
  71. unsigned int autocorrelate_given ; /**< @brief Whether autocorrelate was given. */
  72. unsigned int skip_given ; /**< @brief Whether skip was given. */
  73. unsigned int limit_given ; /**< @brief Whether limit was given. */
  74. unsigned int verbosity_given ; /**< @brief Whether verbosity was given. */
  75. char **inputs ; /**< @brief unamed options (options without names) */
  76. unsigned inputs_num ; /**< @brief unamed options number */
  77. } ;
  78. /** @brief The additional parameters to pass to parser functions */
  79. struct cmdline_parser_params
  80. {
  81. int override; /**< @brief whether to override possibly already present options (default 0) */
  82. int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
  83. int check_required; /**< @brief whether to check that all required options were provided (default 1) */
  84. int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
  85. int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
  86. } ;
  87. /** @brief the purpose string of the program */
  88. extern const char *gengetopt_args_info_purpose;
  89. /** @brief the usage string of the program */
  90. extern const char *gengetopt_args_info_usage;
  91. /** @brief all the lines making the help output */
  92. extern const char *gengetopt_args_info_help[];
  93. /**
  94. * The command line parser
  95. * @param argc the number of command line options
  96. * @param argv the command line options
  97. * @param args_info the structure where option information will be stored
  98. * @return 0 if everything went fine, NON 0 if an error took place
  99. */
  100. int cmdline_parser (int argc, char * const *argv,
  101. struct gengetopt_args_info *args_info);
  102. /**
  103. * The command line parser (version with additional parameters - deprecated)
  104. * @param argc the number of command line options
  105. * @param argv the command line options
  106. * @param args_info the structure where option information will be stored
  107. * @param override whether to override possibly already present options
  108. * @param initialize whether to initialize the option structure my_args_info
  109. * @param check_required whether to check that all required options were provided
  110. * @return 0 if everything went fine, NON 0 if an error took place
  111. * @deprecated use cmdline_parser_ext() instead
  112. */
  113. int cmdline_parser2 (int argc, char * const *argv,
  114. struct gengetopt_args_info *args_info,
  115. int override, int initialize, int check_required);
  116. /**
  117. * The command line parser (version with additional parameters)
  118. * @param argc the number of command line options
  119. * @param argv the command line options
  120. * @param args_info the structure where option information will be stored
  121. * @param params additional parameters for the parser
  122. * @return 0 if everything went fine, NON 0 if an error took place
  123. */
  124. int cmdline_parser_ext (int argc, char * const *argv,
  125. struct gengetopt_args_info *args_info,
  126. struct cmdline_parser_params *params);
  127. /**
  128. * Save the contents of the option struct into an already open FILE stream.
  129. * @param outfile the stream where to dump options
  130. * @param args_info the option struct to dump
  131. * @return 0 if everything went fine, NON 0 if an error took place
  132. */
  133. int cmdline_parser_dump(FILE *outfile,
  134. struct gengetopt_args_info *args_info);
  135. /**
  136. * Save the contents of the option struct into a (text) file.
  137. * This file can be read by the config file parser (if generated by gengetopt)
  138. * @param filename the file where to save
  139. * @param args_info the option struct to save
  140. * @return 0 if everything went fine, NON 0 if an error took place
  141. */
  142. int cmdline_parser_file_save(const char *filename,
  143. struct gengetopt_args_info *args_info);
  144. /**
  145. * Print the help
  146. */
  147. void cmdline_parser_print_help(void);
  148. /**
  149. * Print the version
  150. */
  151. void cmdline_parser_print_version(void);
  152. /**
  153. * Initializes all the fields a cmdline_parser_params structure
  154. * to their default values
  155. * @param params the structure to initialize
  156. */
  157. void cmdline_parser_params_init(struct cmdline_parser_params *params);
  158. /**
  159. * Allocates dynamically a cmdline_parser_params structure and initializes
  160. * all its fields to their default values
  161. * @return the created and initialized cmdline_parser_params structure
  162. */
  163. struct cmdline_parser_params *cmdline_parser_params_create(void);
  164. /**
  165. * Initializes the passed gengetopt_args_info structure's fields
  166. * (also set default values for options that have a default)
  167. * @param args_info the structure to initialize
  168. */
  169. void cmdline_parser_init (struct gengetopt_args_info *args_info);
  170. /**
  171. * Deallocates the string fields of the gengetopt_args_info structure
  172. * (but does not deallocate the structure itself)
  173. * @param args_info the structure to deallocate
  174. */
  175. void cmdline_parser_free (struct gengetopt_args_info *args_info);
  176. /**
  177. * Checks that all the required options were specified
  178. * @param args_info the structure to check
  179. * @param prog_name the name of the program that will be used to print
  180. * possible errors
  181. * @return
  182. */
  183. int cmdline_parser_required (struct gengetopt_args_info *args_info,
  184. const char *prog_name);
  185. extern char *cmdline_parser_distance_values[] ; /**< @brief Possible values for distance. */
  186. #ifdef __cplusplus
  187. }
  188. #endif /* __cplusplus */
  189. #endif /* CMDLINE_H */