Source

sleipnir / tools / BNServer / cmdline.h

Full commit
/** @file cmdline.h
 *  @brief The header file for the command line option parser
 *  generated by GNU Gengetopt version 2.22.6
 *  http://www.gnu.org/software/gengetopt.
 *  DO NOT modify this file, since it can be overwritten
 *  @author GNU Gengetopt by Lorenzo Bettini */

#ifndef CMDLINE_H
#define CMDLINE_H

/* If we use autoconf.  */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h> /* for FILE */

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#ifndef CMDLINE_PARSER_PACKAGE
/** @brief the program name (used for printing errors) */
#define CMDLINE_PARSER_PACKAGE "BNServer"
#endif

#ifndef CMDLINE_PARSER_PACKAGE_NAME
/** @brief the complete program name (used for help and version) */
#define CMDLINE_PARSER_PACKAGE_NAME "BNServer"
#endif

#ifndef CMDLINE_PARSER_VERSION
/** @brief the program version */
#define CMDLINE_PARSER_VERSION "1.0"
#endif

/** @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 * database_arg;	/**< @brief Database directory (default='.').  */
  char * database_orig;	/**< @brief Database directory original value given at command line.  */
  const char *database_help; /**< @brief Database directory help description.  */
  char * input_arg;	/**< @brief Context IDs and names.  */
  char * input_orig;	/**< @brief Context IDs and names original value given at command line.  */
  const char *input_help; /**< @brief Context IDs and names help description.  */
  char * contexts_arg;	/**< @brief Context/gene mapping.  */
  char * contexts_orig;	/**< @brief Context/gene mapping original value given at command line.  */
  const char *contexts_help; /**< @brief Context/gene mapping help description.  */
  char * diseases_arg;	/**< @brief Disease/gene mapping.  */
  char * diseases_orig;	/**< @brief Disease/gene mapping original value given at command line.  */
  const char *diseases_help; /**< @brief Disease/gene mapping help description.  */
  int is_nibble_flag;	/**< @brief Specify whether the database is nibble type (default=on).  */
  const char *is_nibble_help; /**< @brief Specify whether the database is nibble type help description.  */
  char * global_standard_arg;	/**< @brief Global gold standard dab file.  */
  char * global_standard_orig;	/**< @brief Global gold standard dab file original value given at command line.  */
  const char *global_standard_help; /**< @brief Global gold standard dab file help description.  */
  char * datasets_arg;	/**< @brief File dataset names and number of bins.  */
  char * datasets_orig;	/**< @brief File dataset names and number of bins original value given at command line.  */
  const char *datasets_help; /**< @brief File dataset names and number of bins help description.  */
  char * networks_arg;	/**< @brief Bayes net directory (default='.').  */
  char * networks_orig;	/**< @brief Bayes net directory original value given at command line.  */
  const char *networks_help; /**< @brief Bayes net directory help description.  */
  char * default_arg;	/**< @brief Bayes net for no context.  */
  char * default_orig;	/**< @brief Bayes net for no context original value given at command line.  */
  const char *default_help; /**< @brief Bayes net for no context help description.  */
  int xdsl_flag;	/**< @brief Use XDSL files instead of DSL (default=on).  */
  const char *xdsl_help; /**< @brief Use XDSL files instead of DSL help description.  */
  int minimal_in_flag;	/**< @brief Read stored contexts and minimal Bayes nets (default=off).  */
  const char *minimal_in_help; /**< @brief Read stored contexts and minimal Bayes nets help description.  */
  char * minimal_out_arg;	/**< @brief Store contexts and minimal Bayes nets.  */
  char * minimal_out_orig;	/**< @brief Store contexts and minimal Bayes nets original value given at command line.  */
  const char *minimal_out_help; /**< @brief Store contexts and minimal Bayes nets help description.  */
  char * global_arg;	/**< @brief Parameter file for global context p-values.  */
  char * global_orig;	/**< @brief Parameter file for global context p-values original value given at command line.  */
  const char *global_help; /**< @brief Parameter file for global context p-values help description.  */
  char * within_c_arg;	/**< @brief Within sets matrix for contexts.  */
  char * within_c_orig;	/**< @brief Within sets matrix for contexts original value given at command line.  */
  const char *within_c_help; /**< @brief Within sets matrix for contexts help description.  */
  char * within_d_arg;	/**< @brief Within sets matrix for diseases.  */
  char * within_d_orig;	/**< @brief Within sets matrix for diseases original value given at command line.  */
  const char *within_d_help; /**< @brief Within sets matrix for diseases help description.  */
  char * between_cc_arg;	/**< @brief Between sets matrix for contexts.  */
  char * between_cc_orig;	/**< @brief Between sets matrix for contexts original value given at command line.  */
  const char *between_cc_help; /**< @brief Between sets matrix for contexts help description.  */
  char * between_dd_arg;	/**< @brief Between sets matrix for diseases.  */
  char * between_dd_orig;	/**< @brief Between sets matrix for diseases original value given at command line.  */
  const char *between_dd_help; /**< @brief Between sets matrix for diseases help description.  */
  char * between_dc_arg;	/**< @brief Between sets matrix for diseases to contexts.  */
  char * between_dc_orig;	/**< @brief Between sets matrix for diseases to contexts original value given at command line.  */
  const char *between_dc_help; /**< @brief Between sets matrix for diseases to contexts help description.  */
  char * backgrounds_arg;	/**< @brief Background connectivities for all genes.  */
  char * backgrounds_orig;	/**< @brief Background connectivities for all genes original value given at command line.  */
  const char *backgrounds_help; /**< @brief Background connectivities for all genes help description.  */
  char * go_onto_arg;	/**< @brief GO ontology.  */
  char * go_onto_orig;	/**< @brief GO ontology original value given at command line.  */
  const char *go_onto_help; /**< @brief GO ontology help description.  */
  char * go_anno_arg;	/**< @brief GO annotations.  */
  char * go_anno_orig;	/**< @brief GO annotations original value given at command line.  */
  const char *go_anno_help; /**< @brief GO annotations help description.  */
  char * kegg_arg;	/**< @brief KEGG ontology.  */
  char * kegg_orig;	/**< @brief KEGG ontology original value given at command line.  */
  const char *kegg_help; /**< @brief KEGG ontology help description.  */
  char * kegg_org_arg;	/**< @brief KEGG organism (default='HSA').  */
  char * kegg_org_orig;	/**< @brief KEGG organism original value given at command line.  */
  const char *kegg_org_help; /**< @brief KEGG organism help description.  */
  int port_arg;	/**< @brief Server port (default='1234').  */
  char * port_orig;	/**< @brief Server port original value given at command line.  */
  const char *port_help; /**< @brief Server port help description.  */
  int timeout_arg;	/**< @brief Server timeout (default='100').  */
  char * timeout_orig;	/**< @brief Server timeout original value given at command line.  */
  const char *timeout_help; /**< @brief Server timeout help description.  */
  int networklets_flag;	/**< @brief Generate mini-network icons (default=off).  */
  const char *networklets_help; /**< @brief Generate mini-network icons help description.  */
  char * assoc_diseases_arg;	/**< @brief Disease names to generate disease/process associations.  */
  char * assoc_diseases_orig;	/**< @brief Disease names to generate disease/process associations original value given at command line.  */
  const char *assoc_diseases_help; /**< @brief Disease names to generate disease/process associations help description.  */
  int assoc_context_arg;	/**< @brief Context in which associations are computed (default='0').  */
  char * assoc_context_orig;	/**< @brief Context in which associations are computed original value given at command line.  */
  const char *assoc_context_help; /**< @brief Context in which associations are computed help description.  */
  int limit_arg;	/**< @brief Maximum genes to process per set (default='500').  */
  char * limit_orig;	/**< @brief Maximum genes to process per set original value given at command line.  */
  const char *limit_help; /**< @brief Maximum genes to process per set help description.  */
  char * files_arg;	/**< @brief File directory (default='.').  */
  char * files_orig;	/**< @brief File directory original value given at command line.  */
  const char *files_help; /**< @brief File directory help description.  */
  char * graphviz_arg;	/**< @brief Graphviz executable path (default='fdp').  */
  char * graphviz_orig;	/**< @brief Graphviz executable path original value given at command line.  */
  const char *graphviz_help; /**< @brief Graphviz executable path help description.  */
  char * config_arg;	/**< @brief Command line config file (default='BNServer.ini').  */
  char * config_orig;	/**< @brief Command line config file original value given at command line.  */
  const char *config_help; /**< @brief Command line config file help description.  */
  int verbosity_arg;	/**< @brief Message verbosity (default='5').  */
  char * verbosity_orig;	/**< @brief Message verbosity original value given at command line.  */
  const char *verbosity_help; /**< @brief Message verbosity help description.  */
  
  unsigned int help_given ;	/**< @brief Whether help was given.  */
  unsigned int version_given ;	/**< @brief Whether version was given.  */
  unsigned int database_given ;	/**< @brief Whether database was given.  */
  unsigned int input_given ;	/**< @brief Whether input was given.  */
  unsigned int contexts_given ;	/**< @brief Whether contexts was given.  */
  unsigned int diseases_given ;	/**< @brief Whether diseases was given.  */
  unsigned int is_nibble_given ;	/**< @brief Whether is_nibble was given.  */
  unsigned int global_standard_given ;	/**< @brief Whether global_standard was given.  */
  unsigned int datasets_given ;	/**< @brief Whether datasets was given.  */
  unsigned int networks_given ;	/**< @brief Whether networks was given.  */
  unsigned int default_given ;	/**< @brief Whether default was given.  */
  unsigned int xdsl_given ;	/**< @brief Whether xdsl was given.  */
  unsigned int minimal_in_given ;	/**< @brief Whether minimal_in was given.  */
  unsigned int minimal_out_given ;	/**< @brief Whether minimal_out was given.  */
  unsigned int global_given ;	/**< @brief Whether global was given.  */
  unsigned int within_c_given ;	/**< @brief Whether within_c was given.  */
  unsigned int within_d_given ;	/**< @brief Whether within_d was given.  */
  unsigned int between_cc_given ;	/**< @brief Whether between_cc was given.  */
  unsigned int between_dd_given ;	/**< @brief Whether between_dd was given.  */
  unsigned int between_dc_given ;	/**< @brief Whether between_dc was given.  */
  unsigned int backgrounds_given ;	/**< @brief Whether backgrounds was given.  */
  unsigned int go_onto_given ;	/**< @brief Whether go_onto was given.  */
  unsigned int go_anno_given ;	/**< @brief Whether go_anno was given.  */
  unsigned int kegg_given ;	/**< @brief Whether kegg was given.  */
  unsigned int kegg_org_given ;	/**< @brief Whether kegg_org was given.  */
  unsigned int port_given ;	/**< @brief Whether port was given.  */
  unsigned int timeout_given ;	/**< @brief Whether timeout was given.  */
  unsigned int networklets_given ;	/**< @brief Whether networklets was given.  */
  unsigned int assoc_diseases_given ;	/**< @brief Whether assoc_diseases was given.  */
  unsigned int assoc_context_given ;	/**< @brief Whether assoc_context was given.  */
  unsigned int limit_given ;	/**< @brief Whether limit was given.  */
  unsigned int files_given ;	/**< @brief Whether files was given.  */
  unsigned int graphviz_given ;	/**< @brief Whether graphviz was given.  */
  unsigned int config_given ;	/**< @brief Whether config was given.  */
  unsigned int verbosity_given ;	/**< @brief Whether verbosity was given.  */

} ;

/** @brief The additional parameters to pass to parser functions */
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 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 cmdline_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 cmdline_parser_ext() instead
 */
int cmdline_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 cmdline_parser_ext (int argc, char **argv,
  struct gengetopt_args_info *args_info,
  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
 * @param args_info the option struct to save
 * @return 0 if everything went fine, NON 0 if an error took place
 */
int cmdline_parser_file_save(const char *filename,
  struct gengetopt_args_info *args_info);

/**
 * Print the help
 */
void cmdline_parser_print_help(void);
/**
 * Print the version
 */
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 their default values
 * @return the created and initialized cmdline_parser_params structure
 */
struct cmdline_parser_params *cmdline_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 cmdline_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 cmdline_parser_free (struct gengetopt_args_info *args_info);

/**
 * 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 cmdline_parser_config_file() instead
 */
int cmdline_parser_configfile (const char *filename,
  struct gengetopt_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 cmdline_parser_config_file (const char *filename,
  struct gengetopt_args_info *args_info,
  struct cmdline_parser_params *params);

/**
 * 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 cmdline_parser_required (struct gengetopt_args_info *args_info,
  const char *prog_name);


#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CMDLINE_H */