1 /** @file RNAplot_cmdl.h
2 * @brief The header file for the command line option parser
3 * generated by GNU Gengetopt version 2.22.5
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 */
11 /* If we use autoconf. */
16 #include <stdio.h> /* for FILE */
20 #endif /* __cplusplus */
22 #ifndef RNAPLOT_CMDLINE_PARSER_PACKAGE
23 /** @brief the program name (used for printing errors) */
24 #define RNAPLOT_CMDLINE_PARSER_PACKAGE "RNAplot"
27 #ifndef RNAPLOT_CMDLINE_PARSER_PACKAGE_NAME
28 /** @brief the complete program name (used for help and version) */
29 #define RNAPLOT_CMDLINE_PARSER_PACKAGE_NAME "RNAplot"
32 #ifndef RNAPLOT_CMDLINE_PARSER_VERSION
33 /** @brief the program version */
34 #define RNAPLOT_CMDLINE_PARSER_VERSION VERSION
37 /** @brief Where the command line options are stored */
38 struct RNAplot_args_info
40 const char *help_help; /**< @brief Print help and exit help description. */
41 const char *version_help; /**< @brief Print version and exit help description. */
42 int layout_type_arg; /**< @brief Choose the layout algorithm. Simple radial layout if 0, or naview if 1
45 char * layout_type_orig; /**< @brief Choose the layout algorithm. Simple radial layout if 0, or naview if 1
47 original value given at command line. */
48 const char *layout_type_help; /**< @brief Choose the layout algorithm. Simple radial layout if 0, or naview if 1
51 char * output_format_arg; /**< @brief Specify output format. Available formats are: PostScript (ps), Graph Meta Language (gml), Scalable Vector Graphics (svg), and XRNA save file (xrna). Output filenames will end in \".ps\" \".gml\" \".svg\" \".ss\", respectively.
54 char * output_format_orig; /**< @brief Specify output format. Available formats are: PostScript (ps), Graph Meta Language (gml), Scalable Vector Graphics (svg), and XRNA save file (xrna). Output filenames will end in \".ps\" \".gml\" \".svg\" \".ss\", respectively.
56 original value given at command line. */
57 const char *output_format_help; /**< @brief Specify output format. Available formats are: PostScript (ps), Graph Meta Language (gml), Scalable Vector Graphics (svg), and XRNA save file (xrna). Output filenames will end in \".ps\" \".gml\" \".svg\" \".ss\", respectively.
60 char * pre_arg; /**< @brief Add annotation macros to postscript file, and add the postscript code in \"string\" just before the code to draw the structure. This is an easy way to add annotation.
63 char * pre_orig; /**< @brief Add annotation macros to postscript file, and add the postscript code in \"string\" just before the code to draw the structure. This is an easy way to add annotation.
65 original value given at command line. */
66 const char *pre_help; /**< @brief Add annotation macros to postscript file, and add the postscript code in \"string\" just before the code to draw the structure. This is an easy way to add annotation.
69 char * post_arg; /**< @brief Same as --pre but in contrast to adding the annotation macros. E.g to mark position 15 with circle use --post \"15 cmark\"
72 char * post_orig; /**< @brief Same as --pre but in contrast to adding the annotation macros. E.g to mark position 15 with circle use --post \"15 cmark\"
74 original value given at command line. */
75 const char *post_help; /**< @brief Same as --pre but in contrast to adding the annotation macros. E.g to mark position 15 with circle use --post \"15 cmark\"
79 unsigned int help_given ; /**< @brief Whether help was given. */
80 unsigned int version_given ; /**< @brief Whether version was given. */
81 unsigned int layout_type_given ; /**< @brief Whether layout-type was given. */
82 unsigned int output_format_given ; /**< @brief Whether output-format was given. */
83 unsigned int pre_given ; /**< @brief Whether pre was given. */
84 unsigned int post_given ; /**< @brief Whether post was given. */
88 /** @brief The additional parameters to pass to parser functions */
89 struct RNAplot_cmdline_parser_params
91 int override; /**< @brief whether to override possibly already present options (default 0) */
92 int initialize; /**< @brief whether to initialize the option structure RNAplot_args_info (default 1) */
93 int check_required; /**< @brief whether to check that all required options were provided (default 1) */
94 int check_ambiguity; /**< @brief whether to check for options already specified in the option structure RNAplot_args_info (default 0) */
95 int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
98 /** @brief the purpose string of the program */
99 extern const char *RNAplot_args_info_purpose;
100 /** @brief the usage string of the program */
101 extern const char *RNAplot_args_info_usage;
102 /** @brief all the lines making the help output */
103 extern const char *RNAplot_args_info_help[];
106 * The command line parser
107 * @param argc the number of command line options
108 * @param argv the command line options
109 * @param args_info the structure where option information will be stored
110 * @return 0 if everything went fine, NON 0 if an error took place
112 int RNAplot_cmdline_parser (int argc, char **argv,
113 struct RNAplot_args_info *args_info);
116 * The command line parser (version with additional parameters - deprecated)
117 * @param argc the number of command line options
118 * @param argv the command line options
119 * @param args_info the structure where option information will be stored
120 * @param override whether to override possibly already present options
121 * @param initialize whether to initialize the option structure my_args_info
122 * @param check_required whether to check that all required options were provided
123 * @return 0 if everything went fine, NON 0 if an error took place
124 * @deprecated use RNAplot_cmdline_parser_ext() instead
126 int RNAplot_cmdline_parser2 (int argc, char **argv,
127 struct RNAplot_args_info *args_info,
128 int override, int initialize, int check_required);
131 * The command line parser (version with additional parameters)
132 * @param argc the number of command line options
133 * @param argv the command line options
134 * @param args_info the structure where option information will be stored
135 * @param params additional parameters for the parser
136 * @return 0 if everything went fine, NON 0 if an error took place
138 int RNAplot_cmdline_parser_ext (int argc, char **argv,
139 struct RNAplot_args_info *args_info,
140 struct RNAplot_cmdline_parser_params *params);
143 * Save the contents of the option struct into an already open FILE stream.
144 * @param outfile the stream where to dump options
145 * @param args_info the option struct to dump
146 * @return 0 if everything went fine, NON 0 if an error took place
148 int RNAplot_cmdline_parser_dump(FILE *outfile,
149 struct RNAplot_args_info *args_info);
152 * Save the contents of the option struct into a (text) file.
153 * This file can be read by the config file parser (if generated by gengetopt)
154 * @param filename the file where to save
155 * @param args_info the option struct to save
156 * @return 0 if everything went fine, NON 0 if an error took place
158 int RNAplot_cmdline_parser_file_save(const char *filename,
159 struct RNAplot_args_info *args_info);
164 void RNAplot_cmdline_parser_print_help(void);
168 void RNAplot_cmdline_parser_print_version(void);
171 * Initializes all the fields a RNAplot_cmdline_parser_params structure
172 * to their default values
173 * @param params the structure to initialize
175 void RNAplot_cmdline_parser_params_init(struct RNAplot_cmdline_parser_params *params);
178 * Allocates dynamically a RNAplot_cmdline_parser_params structure and initializes
179 * all its fields to their default values
180 * @return the created and initialized RNAplot_cmdline_parser_params structure
182 struct RNAplot_cmdline_parser_params *RNAplot_cmdline_parser_params_create(void);
185 * Initializes the passed RNAplot_args_info structure's fields
186 * (also set default values for options that have a default)
187 * @param args_info the structure to initialize
189 void RNAplot_cmdline_parser_init (struct RNAplot_args_info *args_info);
191 * Deallocates the string fields of the RNAplot_args_info structure
192 * (but does not deallocate the structure itself)
193 * @param args_info the structure to deallocate
195 void RNAplot_cmdline_parser_free (struct RNAplot_args_info *args_info);
198 * Checks that all the required options were specified
199 * @param args_info the structure to check
200 * @param prog_name the name of the program that will be used to print
204 int RNAplot_cmdline_parser_required (struct RNAplot_args_info *args_info,
205 const char *prog_name);
210 #endif /* __cplusplus */
211 #endif /* RNAPLOT_CMDL_H */