New Linux binaries for ViennaRNA
[jabaws.git] / binaries / src / ViennaRNA / Progs / RNAplot_cmdl.h
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 */
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 *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
43   
44  (default='1').  */
45   char * layout_type_orig;      /**< @brief Choose the layout algorithm. Simple radial layout if 0, or naview if 1
46   
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
49   
50  help description.  */
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.
52   
53  (default='ps').  */
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.
55   
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.
58   
59  help description.  */
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.
61   
62 .  */
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.
64   
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.
67   
68  help description.  */
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\"
70   
71 .  */
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\"
73   
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\"
76   
77  help description.  */
78   
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.  */
85
86 } ;
87
88 /** @brief The additional parameters to pass to parser functions */
89 struct RNAplot_cmdline_parser_params
90 {
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) */
96 } ;
97
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[];
104
105 /**
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
111  */
112 int RNAplot_cmdline_parser (int argc, char **argv,
113   struct RNAplot_args_info *args_info);
114
115 /**
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
125  */
126 int RNAplot_cmdline_parser2 (int argc, char **argv,
127   struct RNAplot_args_info *args_info,
128   int override, int initialize, int check_required);
129
130 /**
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
137  */
138 int RNAplot_cmdline_parser_ext (int argc, char **argv,
139   struct RNAplot_args_info *args_info,
140   struct RNAplot_cmdline_parser_params *params);
141
142 /**
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
147  */
148 int RNAplot_cmdline_parser_dump(FILE *outfile,
149   struct RNAplot_args_info *args_info);
150
151 /**
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
157  */
158 int RNAplot_cmdline_parser_file_save(const char *filename,
159   struct RNAplot_args_info *args_info);
160
161 /**
162  * Print the help
163  */
164 void RNAplot_cmdline_parser_print_help(void);
165 /**
166  * Print the version
167  */
168 void RNAplot_cmdline_parser_print_version(void);
169
170 /**
171  * Initializes all the fields a RNAplot_cmdline_parser_params structure 
172  * to their default values
173  * @param params the structure to initialize
174  */
175 void RNAplot_cmdline_parser_params_init(struct RNAplot_cmdline_parser_params *params);
176
177 /**
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
181  */
182 struct RNAplot_cmdline_parser_params *RNAplot_cmdline_parser_params_create(void);
183
184 /**
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
188  */
189 void RNAplot_cmdline_parser_init (struct RNAplot_args_info *args_info);
190 /**
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
194  */
195 void RNAplot_cmdline_parser_free (struct RNAplot_args_info *args_info);
196
197 /**
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
201  *   possible errors
202  * @return
203  */
204 int RNAplot_cmdline_parser_required (struct RNAplot_args_info *args_info,
205   const char *prog_name);
206
207
208 #ifdef __cplusplus
209 }
210 #endif /* __cplusplus */
211 #endif /* RNAPLOT_CMDL_H */