- Set LIBS instead of LDFLAGS (LIBS are appended while LDFLAGS are prepended
[gliv.git] / src / include / cmdline.h
blobc6539ad406f7b0ac11c3e4642baa16cb4055a82c
1 /** @file cmdline.h
2 * @brief The header file for the command line option parser
3 * generated by GNU Gengetopt version 2.22.4
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 */
8 #ifndef CMDLINE_H
9 #define CMDLINE_H
11 /* If we use autoconf. */
12 #ifdef HAVE_CONFIG_H
13 #include "config.h"
14 #endif
16 #include <stdio.h> /* for FILE */
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
22 #ifndef CMDLINE_PARSER_PACKAGE
23 /** @brief the program name (used for printing errors) */
24 #define CMDLINE_PARSER_PACKAGE PACKAGE
25 #endif
27 #ifndef CMDLINE_PARSER_PACKAGE_NAME
28 /** @brief the complete program name (used for help and version) */
29 #ifdef PACKAGE_NAME
30 #define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME
31 #else
32 #define CMDLINE_PARSER_PACKAGE_NAME PACKAGE
33 #endif
34 #endif
36 #ifndef CMDLINE_PARSER_VERSION
37 /** @brief the program version */
38 #define CMDLINE_PARSER_VERSION VERSION
39 #endif
41 /** @brief Where the command line options are stored */
42 struct gengetopt_args_info
44 const char *help_help; /**< @brief Print help and exit help description. */
45 const char *version_help; /**< @brief Print version and exit help description. */
46 char * add_all_arg; /**< @brief Add all files in the directory. */
47 char * add_all_orig; /**< @brief Add all files in the directory original value given at command line. */
48 const char *add_all_help; /**< @brief Add all files in the directory help description. */
49 char * recursive_arg; /**< @brief Recursive directory traversal. */
50 char * recursive_orig; /**< @brief Recursive directory traversal original value given at command line. */
51 const char *recursive_help; /**< @brief Recursive directory traversal help description. */
52 char * sort_arg; /**< @brief Show images in sorted order. */
53 char * sort_orig; /**< @brief Show images in sorted order original value given at command line. */
54 const char *sort_help; /**< @brief Show images in sorted order help description. */
55 char * shuffle_arg; /**< @brief Show images in random order. */
56 char * shuffle_orig; /**< @brief Show images in random order original value given at command line. */
57 const char *shuffle_help; /**< @brief Show images in random order help description. */
58 char * force_load_arg; /**< @brief Try to load every file. */
59 char * force_load_orig; /**< @brief Try to load every file original value given at command line. */
60 const char *force_load_help; /**< @brief Try to load every file help description. */
61 char * client_arg; /**< @brief Connect to a running gliv, appending to the list. */
62 char * client_orig; /**< @brief Connect to a running gliv, appending to the list original value given at command line. */
63 const char *client_help; /**< @brief Connect to a running gliv, appending to the list help description. */
64 char * client_clear_arg; /**< @brief Connect to a running gliv, replacing the list. */
65 char * client_clear_orig; /**< @brief Connect to a running gliv, replacing the list original value given at command line. */
66 const char *client_clear_help; /**< @brief Connect to a running gliv, replacing the list help description. */
67 char * build_menus_arg; /**< @brief No images menu at startup. */
68 char * build_menus_orig; /**< @brief No images menu at startup original value given at command line. */
69 const char *build_menus_help; /**< @brief No images menu at startup help description. */
70 char * glivrc_arg; /**< @brief Use this configuration file or none. */
71 char * glivrc_orig; /**< @brief Use this configuration file or none original value given at command line. */
72 const char *glivrc_help; /**< @brief Use this configuration file or none help description. */
73 char * slide_show_arg; /**< @brief Start the slide show immediately. */
74 char * slide_show_orig; /**< @brief Start the slide show immediately original value given at command line. */
75 const char *slide_show_help; /**< @brief Start the slide show immediately help description. */
76 char * null_arg; /**< @brief Read null-terminated filenames. */
77 char * null_orig; /**< @brief Read null-terminated filenames original value given at command line. */
78 const char *null_help; /**< @brief Read null-terminated filenames help description. */
79 char * collection_arg; /**< @brief Output a collection. */
80 char * collection_orig; /**< @brief Output a collection original value given at command line. */
81 const char *collection_help; /**< @brief Output a collection help description. */
82 char * geometry_arg; /**< @brief Initial window geometry. */
83 char * geometry_orig; /**< @brief Initial window geometry original value given at command line. */
84 const char *geometry_help; /**< @brief Initial window geometry help description. */
86 unsigned int help_given ; /**< @brief Whether help was given. */
87 unsigned int version_given ; /**< @brief Whether version was given. */
88 unsigned int add_all_given ; /**< @brief Whether add-all was given. */
89 unsigned int recursive_given ; /**< @brief Whether recursive was given. */
90 unsigned int sort_given ; /**< @brief Whether sort was given. */
91 unsigned int shuffle_given ; /**< @brief Whether shuffle was given. */
92 unsigned int force_load_given ; /**< @brief Whether force-load was given. */
93 unsigned int client_given ; /**< @brief Whether client was given. */
94 unsigned int client_clear_given ; /**< @brief Whether client-clear was given. */
95 unsigned int build_menus_given ; /**< @brief Whether build-menus was given. */
96 unsigned int glivrc_given ; /**< @brief Whether glivrc was given. */
97 unsigned int slide_show_given ; /**< @brief Whether slide-show was given. */
98 unsigned int null_given ; /**< @brief Whether null was given. */
99 unsigned int collection_given ; /**< @brief Whether collection was given. */
100 unsigned int geometry_given ; /**< @brief Whether geometry was given. */
102 char **inputs ; /**< @brief unamed options (options without names) */
103 unsigned inputs_num ; /**< @brief unamed options number */
106 /** @brief The additional parameters to pass to parser functions */
107 struct cmdline_parser_params
109 int override; /**< @brief whether to override possibly already present options (default 0) */
110 int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
111 int check_required; /**< @brief whether to check that all required options were provided (default 1) */
112 int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
113 int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
116 /** @brief the purpose string of the program */
117 extern const char *gengetopt_args_info_purpose;
118 /** @brief the usage string of the program */
119 extern const char *gengetopt_args_info_usage;
120 /** @brief all the lines making the help output */
121 extern const char *gengetopt_args_info_help[];
124 * The command line parser
125 * @param argc the number of command line options
126 * @param argv the command line options
127 * @param args_info the structure where option information will be stored
128 * @return 0 if everything went fine, NON 0 if an error took place
130 int cmdline_parser (int argc, char **argv,
131 struct gengetopt_args_info *args_info);
134 * The command line parser (version with additional parameters - deprecated)
135 * @param argc the number of command line options
136 * @param argv the command line options
137 * @param args_info the structure where option information will be stored
138 * @param override whether to override possibly already present options
139 * @param initialize whether to initialize the option structure my_args_info
140 * @param check_required whether to check that all required options were provided
141 * @return 0 if everything went fine, NON 0 if an error took place
142 * @deprecated use cmdline_parser_ext() instead
144 int cmdline_parser2 (int argc, char **argv,
145 struct gengetopt_args_info *args_info,
146 int override, int initialize, int check_required);
149 * The command line parser (version with additional parameters)
150 * @param argc the number of command line options
151 * @param argv the command line options
152 * @param args_info the structure where option information will be stored
153 * @param params additional parameters for the parser
154 * @return 0 if everything went fine, NON 0 if an error took place
156 int cmdline_parser_ext (int argc, char **argv,
157 struct gengetopt_args_info *args_info,
158 struct cmdline_parser_params *params);
161 * Save the contents of the option struct into an already open FILE stream.
162 * @param outfile the stream where to dump options
163 * @param args_info the option struct to dump
164 * @return 0 if everything went fine, NON 0 if an error took place
166 int cmdline_parser_dump(FILE *outfile,
167 struct gengetopt_args_info *args_info);
170 * Save the contents of the option struct into a (text) file.
171 * This file can be read by the config file parser (if generated by gengetopt)
172 * @param filename the file where to save
173 * @param args_info the option struct to save
174 * @return 0 if everything went fine, NON 0 if an error took place
176 int cmdline_parser_file_save(const char *filename,
177 struct gengetopt_args_info *args_info);
180 * Print the help
182 void cmdline_parser_print_help(void);
184 * Print the version
186 void cmdline_parser_print_version(void);
189 * Initializes all the fields a cmdline_parser_params structure
190 * to their default values
191 * @param params the structure to initialize
193 void cmdline_parser_params_init(struct cmdline_parser_params *params);
196 * Allocates dynamically a cmdline_parser_params structure and initializes
197 * all its fields to their default values
198 * @return the created and initialized cmdline_parser_params structure
200 struct cmdline_parser_params *cmdline_parser_params_create(void);
203 * Initializes the passed gengetopt_args_info structure's fields
204 * (also set default values for options that have a default)
205 * @param args_info the structure to initialize
207 void cmdline_parser_init (struct gengetopt_args_info *args_info);
209 * Deallocates the string fields of the gengetopt_args_info structure
210 * (but does not deallocate the structure itself)
211 * @param args_info the structure to deallocate
213 void cmdline_parser_free (struct gengetopt_args_info *args_info);
216 * Checks that all the required options were specified
217 * @param args_info the structure to check
218 * @param prog_name the name of the program that will be used to print
219 * possible errors
220 * @return
222 int cmdline_parser_required (struct gengetopt_args_info *args_info,
223 const char *prog_name);
226 #ifdef __cplusplus
228 #endif /* __cplusplus */
229 #endif /* CMDLINE_H */