1 /** @file RNAplot_cmdl.h
2  *  @brief The header file for the command line option parser
3  *  generated by GNU Gengetopt version 2.23
4  *  http://www.gnu.org/software/gengetopt.
5  *  DO NOT modify this file, since it can be overwritten
6  *  @author GNU Gengetopt */
7 
8 #ifndef RNAPLOT_CMDL_H
9 #define RNAPLOT_CMDL_H
10 
11 /* If we use autoconf.  */
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
15 
16 #include <stdio.h> /* for FILE */
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
22 #ifndef RNAPLOT_CMDLINE_PARSER_PACKAGE
23 /** @brief the program name (used for printing errors) */
24 #define RNAPLOT_CMDLINE_PARSER_PACKAGE "RNAplot"
25 #endif
26 
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"
30 #endif
31 
32 #ifndef RNAPLOT_CMDLINE_PARSER_VERSION
33 /** @brief the program version */
34 #define RNAPLOT_CMDLINE_PARSER_VERSION VERSION
35 #endif
36 
37 /** @brief Where the command line options are stored */
38 struct RNAplot_args_info
39 {
40   const char *help_help; /**< @brief Print help and exit help description.  */
41   const char *detailed_help_help; /**< @brief Print help, including all details and hidden options, and exit help description.  */
42   const char *full_help_help; /**< @brief Print help, including hidden options, and exit help description.  */
43   const char *version_help; /**< @brief Print version and exit help description.  */
44   int jobs_arg;	/**< @brief Split batch input into jobs and start processing in parallel using multiple threads. (default='0').  */
45   char * jobs_orig;	/**< @brief Split batch input into jobs and start processing in parallel using multiple threads. original value given at command line.  */
46   const char *jobs_help; /**< @brief Split batch input into jobs and start processing in parallel using multiple threads. help description.  */
47   char ** infile_arg;	/**< @brief Read a file instead of reading from stdin..  */
48   char ** infile_orig;	/**< @brief Read a file instead of reading from stdin. original value given at command line.  */
49   unsigned int infile_min; /**< @brief Read a file instead of reading from stdin.'s minimum occurreces */
50   unsigned int infile_max; /**< @brief Read a file instead of reading from stdin.'s maximum occurreces */
51   const char *infile_help; /**< @brief Read a file instead of reading from stdin. help description.  */
52   int msa_flag;	/**< @brief Input is multiple sequence alignment in Stockholm 1.0 format. (default=off).  */
53   const char *msa_help; /**< @brief Input is multiple sequence alignment in Stockholm 1.0 format. help description.  */
54   int mis_flag;	/**< @brief Output \"most informative sequence\" instead of simple consensus (default=off).  */
55   const char *mis_help; /**< @brief Output \"most informative sequence\" instead of simple consensus help description.  */
56   int covar_flag;	/**< @brief Annotate covariance of base pairs in consensus structure. (default=off).  */
57   const char *covar_help; /**< @brief Annotate covariance of base pairs in consensus structure. help description.  */
58   int aln_flag;	/**< @brief Produce a colored and structure annotated alignment in PostScript format in the file \"aln.ps\" in the current directory. (default=off).  */
59   const char *aln_help; /**< @brief Produce a colored and structure annotated alignment in PostScript format in the file \"aln.ps\" in the current directory. help description.  */
60   int aln_EPS_cols_arg;	/**< @brief Number of columns in colored EPS alignment output. (default='60').  */
61   char * aln_EPS_cols_orig;	/**< @brief Number of columns in colored EPS alignment output. original value given at command line.  */
62   const char *aln_EPS_cols_help; /**< @brief Number of columns in colored EPS alignment output. help description.  */
63   int layout_type_arg;	/**< @brief Choose the plotting layout algorithm. (default='1').  */
64   char * layout_type_orig;	/**< @brief Choose the plotting layout algorithm. original value given at command line.  */
65   const char *layout_type_help; /**< @brief Choose the plotting layout algorithm. help description.  */
66   int noOptimization_flag;	/**< @brief Disable the drawing space optimization of RNApuzzler. (default=off).  */
67   const char *noOptimization_help; /**< @brief Disable the drawing space optimization of RNApuzzler. help description.  */
68   int ignoreExteriorIntersections_flag;	/**< @brief Ignore intersections with the exterior loop within the RNA-tree. (default=off).  */
69   const char *ignoreExteriorIntersections_help; /**< @brief Ignore intersections with the exterior loop within the RNA-tree. help description.  */
70   int ignoreAncestorIntersections_flag;	/**< @brief Ignore ancestor intersections within the RNA-tree. (default=off).  */
71   const char *ignoreAncestorIntersections_help; /**< @brief Ignore ancestor intersections within the RNA-tree. help description.  */
72   int ignoreSiblingIntersections_flag;	/**< @brief Ignore sibling intersections within the RNA-tree (default=off).  */
73   const char *ignoreSiblingIntersections_help; /**< @brief Ignore sibling intersections within the RNA-tree help description.  */
74   int allowFlipping_flag;	/**< @brief Allow flipping of exterior loop branches to resolve exterior branch intersections. (default=off).  */
75   const char *allowFlipping_help; /**< @brief Allow flipping of exterior loop branches to resolve exterior branch intersections. help description.  */
76   char * output_format_arg;	/**< @brief Specify output format. (default='ps').  */
77   char * output_format_orig;	/**< @brief Specify output format. original value given at command line.  */
78   const char *output_format_help; /**< @brief Specify output format. help description.  */
79   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..  */
80   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. original value given at command line.  */
81   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. help description.  */
82   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\"..  */
83   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\". original value given at command line.  */
84   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\". help description.  */
85   int auto_id_flag;	/**< @brief Automatically generate an ID for each sequence. (default=off).  */
86   const char *auto_id_help; /**< @brief Automatically generate an ID for each sequence. help description.  */
87   char * id_prefix_arg;	/**< @brief Prefix for automatically generated IDs (as used in output file names). (default='sequence').  */
88   char * id_prefix_orig;	/**< @brief Prefix for automatically generated IDs (as used in output file names). original value given at command line.  */
89   const char *id_prefix_help; /**< @brief Prefix for automatically generated IDs (as used in output file names). help description.  */
90   char * id_delim_arg;	/**< @brief Change the delimiter between prefix and increasing number for automatically generated IDs (as used in output file names). (default='_').  */
91   char * id_delim_orig;	/**< @brief Change the delimiter between prefix and increasing number for automatically generated IDs (as used in output file names). original value given at command line.  */
92   const char *id_delim_help; /**< @brief Change the delimiter between prefix and increasing number for automatically generated IDs (as used in output file names). help description.  */
93   int id_digits_arg;	/**< @brief Specify the number of digits of the counter in automatically generated alignment IDs. (default='4').  */
94   char * id_digits_orig;	/**< @brief Specify the number of digits of the counter in automatically generated alignment IDs. original value given at command line.  */
95   const char *id_digits_help; /**< @brief Specify the number of digits of the counter in automatically generated alignment IDs. help description.  */
96   long id_start_arg;	/**< @brief Specify the first number in automatically generated alignment IDs. (default='1').  */
97   char * id_start_orig;	/**< @brief Specify the first number in automatically generated alignment IDs. original value given at command line.  */
98   const char *id_start_help; /**< @brief Specify the first number in automatically generated alignment IDs. help description.  */
99   char * filename_delim_arg;	/**< @brief Change the delimiting character that is used for sanitized filenames
100  (default='ID-delimiter').  */
101   char * filename_delim_orig;	/**< @brief Change the delimiting character that is used for sanitized filenames
102  original value given at command line.  */
103   const char *filename_delim_help; /**< @brief Change the delimiting character that is used for sanitized filenames
104  help description.  */
105   int filename_full_flag;	/**< @brief Use full FASTA header to create filenames. (default=off).  */
106   const char *filename_full_help; /**< @brief Use full FASTA header to create filenames. help description.  */
107 
108   unsigned int help_given ;	/**< @brief Whether help was given.  */
109   unsigned int detailed_help_given ;	/**< @brief Whether detailed-help was given.  */
110   unsigned int full_help_given ;	/**< @brief Whether full-help was given.  */
111   unsigned int version_given ;	/**< @brief Whether version was given.  */
112   unsigned int jobs_given ;	/**< @brief Whether jobs was given.  */
113   unsigned int infile_given ;	/**< @brief Whether infile was given.  */
114   unsigned int msa_given ;	/**< @brief Whether msa was given.  */
115   unsigned int mis_given ;	/**< @brief Whether mis was given.  */
116   unsigned int covar_given ;	/**< @brief Whether covar was given.  */
117   unsigned int aln_given ;	/**< @brief Whether aln was given.  */
118   unsigned int aln_EPS_cols_given ;	/**< @brief Whether aln-EPS-cols was given.  */
119   unsigned int layout_type_given ;	/**< @brief Whether layout-type was given.  */
120   unsigned int noOptimization_given ;	/**< @brief Whether noOptimization was given.  */
121   unsigned int ignoreExteriorIntersections_given ;	/**< @brief Whether ignoreExteriorIntersections was given.  */
122   unsigned int ignoreAncestorIntersections_given ;	/**< @brief Whether ignoreAncestorIntersections was given.  */
123   unsigned int ignoreSiblingIntersections_given ;	/**< @brief Whether ignoreSiblingIntersections was given.  */
124   unsigned int allowFlipping_given ;	/**< @brief Whether allowFlipping was given.  */
125   unsigned int output_format_given ;	/**< @brief Whether output-format was given.  */
126   unsigned int pre_given ;	/**< @brief Whether pre was given.  */
127   unsigned int post_given ;	/**< @brief Whether post was given.  */
128   unsigned int auto_id_given ;	/**< @brief Whether auto-id was given.  */
129   unsigned int id_prefix_given ;	/**< @brief Whether id-prefix was given.  */
130   unsigned int id_delim_given ;	/**< @brief Whether id-delim was given.  */
131   unsigned int id_digits_given ;	/**< @brief Whether id-digits was given.  */
132   unsigned int id_start_given ;	/**< @brief Whether id-start was given.  */
133   unsigned int filename_delim_given ;	/**< @brief Whether filename-delim was given.  */
134   unsigned int filename_full_given ;	/**< @brief Whether filename-full was given.  */
135 
136   char **inputs ; /**< @brief unnamed options (options without names) */
137   unsigned inputs_num ; /**< @brief unnamed options number */
138 } ;
139 
140 /** @brief The additional parameters to pass to parser functions */
141 struct RNAplot_cmdline_parser_params
142 {
143   int override; /**< @brief whether to override possibly already present options (default 0) */
144   int initialize; /**< @brief whether to initialize the option structure RNAplot_args_info (default 1) */
145   int check_required; /**< @brief whether to check that all required options were provided (default 1) */
146   int check_ambiguity; /**< @brief whether to check for options already specified in the option structure RNAplot_args_info (default 0) */
147   int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
148 } ;
149 
150 /** @brief the purpose string of the program */
151 extern const char *RNAplot_args_info_purpose;
152 /** @brief the usage string of the program */
153 extern const char *RNAplot_args_info_usage;
154 /** @brief the description string of the program */
155 extern const char *RNAplot_args_info_description;
156 /** @brief all the lines making the help output */
157 extern const char *RNAplot_args_info_help[];
158 /** @brief all the lines making the full help output (including hidden options) */
159 extern const char *RNAplot_args_info_full_help[];
160 /** @brief all the lines making the detailed help output (including hidden options and details) */
161 extern const char *RNAplot_args_info_detailed_help[];
162 
163 /**
164  * The command line parser
165  * @param argc the number of command line options
166  * @param argv the command line options
167  * @param args_info the structure where option information will be stored
168  * @return 0 if everything went fine, NON 0 if an error took place
169  */
170 int RNAplot_cmdline_parser (int argc, char **argv,
171   struct RNAplot_args_info *args_info);
172 
173 /**
174  * The command line parser (version with additional parameters - deprecated)
175  * @param argc the number of command line options
176  * @param argv the command line options
177  * @param args_info the structure where option information will be stored
178  * @param override whether to override possibly already present options
179  * @param initialize whether to initialize the option structure my_args_info
180  * @param check_required whether to check that all required options were provided
181  * @return 0 if everything went fine, NON 0 if an error took place
182  * @deprecated use RNAplot_cmdline_parser_ext() instead
183  */
184 int RNAplot_cmdline_parser2 (int argc, char **argv,
185   struct RNAplot_args_info *args_info,
186   int override, int initialize, int check_required);
187 
188 /**
189  * The command line parser (version with additional parameters)
190  * @param argc the number of command line options
191  * @param argv the command line options
192  * @param args_info the structure where option information will be stored
193  * @param params additional parameters for the parser
194  * @return 0 if everything went fine, NON 0 if an error took place
195  */
196 int RNAplot_cmdline_parser_ext (int argc, char **argv,
197   struct RNAplot_args_info *args_info,
198   struct RNAplot_cmdline_parser_params *params);
199 
200 /**
201  * Save the contents of the option struct into an already open FILE stream.
202  * @param outfile the stream where to dump options
203  * @param args_info the option struct to dump
204  * @return 0 if everything went fine, NON 0 if an error took place
205  */
206 int RNAplot_cmdline_parser_dump(FILE *outfile,
207   struct RNAplot_args_info *args_info);
208 
209 /**
210  * Save the contents of the option struct into a (text) file.
211  * This file can be read by the config file parser (if generated by gengetopt)
212  * @param filename the file where to save
213  * @param args_info the option struct to save
214  * @return 0 if everything went fine, NON 0 if an error took place
215  */
216 int RNAplot_cmdline_parser_file_save(const char *filename,
217   struct RNAplot_args_info *args_info);
218 
219 /**
220  * Print the help
221  */
222 void RNAplot_cmdline_parser_print_help(void);
223 /**
224  * Print the full help (including hidden options)
225  */
226 void RNAplot_cmdline_parser_print_full_help(void);
227 /**
228  * Print the detailed help (including hidden options and details)
229  */
230 void RNAplot_cmdline_parser_print_detailed_help(void);
231 /**
232  * Print the version
233  */
234 void RNAplot_cmdline_parser_print_version(void);
235 
236 /**
237  * Initializes all the fields a RNAplot_cmdline_parser_params structure
238  * to their default values
239  * @param params the structure to initialize
240  */
241 void RNAplot_cmdline_parser_params_init(struct RNAplot_cmdline_parser_params *params);
242 
243 /**
244  * Allocates dynamically a RNAplot_cmdline_parser_params structure and initializes
245  * all its fields to their default values
246  * @return the created and initialized RNAplot_cmdline_parser_params structure
247  */
248 struct RNAplot_cmdline_parser_params *RNAplot_cmdline_parser_params_create(void);
249 
250 /**
251  * Initializes the passed RNAplot_args_info structure's fields
252  * (also set default values for options that have a default)
253  * @param args_info the structure to initialize
254  */
255 void RNAplot_cmdline_parser_init (struct RNAplot_args_info *args_info);
256 /**
257  * Deallocates the string fields of the RNAplot_args_info structure
258  * (but does not deallocate the structure itself)
259  * @param args_info the structure to deallocate
260  */
261 void RNAplot_cmdline_parser_free (struct RNAplot_args_info *args_info);
262 
263 /**
264  * Checks that all the required options were specified
265  * @param args_info the structure to check
266  * @param prog_name the name of the program that will be used to print
267  *   possible errors
268  * @return
269  */
270 int RNAplot_cmdline_parser_required (struct RNAplot_args_info *args_info,
271   const char *prog_name);
272 
273 
274 #ifdef __cplusplus
275 }
276 #endif /* __cplusplus */
277 #endif /* RNAPLOT_CMDL_H */
278