LibOFX
|
00001 00008 #ifndef CMDLINE_H 00009 #define CMDLINE_H 00010 00011 /* If we use autoconf. */ 00012 #ifdef HAVE_CONFIG_H 00013 #include "config.h" 00014 #endif 00015 00016 #include <stdio.h> /* for FILE */ 00017 00018 #ifdef __cplusplus 00019 extern "C" { 00020 #endif /* __cplusplus */ 00021 00022 #ifndef CMDLINE_PARSER_PACKAGE 00023 00024 #define CMDLINE_PARSER_PACKAGE PACKAGE 00025 #endif 00026 00027 #ifndef CMDLINE_PARSER_PACKAGE_NAME 00028 00029 #ifdef PACKAGE_NAME 00030 #define CMDLINE_PARSER_PACKAGE_NAME PACKAGE_NAME 00031 #else 00032 #define CMDLINE_PARSER_PACKAGE_NAME PACKAGE 00033 #endif 00034 #endif 00035 00036 #ifndef CMDLINE_PARSER_VERSION 00037 00038 #define CMDLINE_PARSER_VERSION VERSION 00039 #endif 00040 00042 struct gengetopt_args_info 00043 { 00044 const char *help_help; 00045 const char *version_help; 00046 char * import_format_arg; 00047 char * import_format_orig; 00048 const char *import_format_help; 00049 const char *list_import_formats_help; 00050 int msg_parser_flag; 00051 const char *msg_parser_help; 00052 int msg_debug_flag; 00053 const char *msg_debug_help; 00054 int msg_warning_flag; 00055 const char *msg_warning_help; 00056 int msg_error_flag; 00057 const char *msg_error_help; 00058 int msg_info_flag; 00059 const char *msg_info_help; 00060 int msg_status_flag; 00061 const char *msg_status_help; 00063 unsigned int help_given ; 00064 unsigned int version_given ; 00065 unsigned int import_format_given ; 00066 unsigned int list_import_formats_given ; 00067 unsigned int msg_parser_given ; 00068 unsigned int msg_debug_given ; 00069 unsigned int msg_warning_given ; 00070 unsigned int msg_error_given ; 00071 unsigned int msg_info_given ; 00072 unsigned int msg_status_given ; 00074 char **inputs ; 00075 unsigned inputs_num ; 00076 } ; 00077 00079 struct cmdline_parser_params 00080 { 00081 int override; 00082 int initialize; 00083 int check_required; 00084 int check_ambiguity; 00085 int print_errors; 00086 } ; 00087 00089 extern const char *gengetopt_args_info_purpose; 00091 extern const char *gengetopt_args_info_usage; 00093 extern const char *gengetopt_args_info_help[]; 00094 00102 int cmdline_parser (int argc, char **argv, 00103 struct gengetopt_args_info *args_info); 00104 00116 int cmdline_parser2 (int argc, char **argv, 00117 struct gengetopt_args_info *args_info, 00118 int override, int initialize, int check_required); 00119 00128 int cmdline_parser_ext (int argc, char **argv, 00129 struct gengetopt_args_info *args_info, 00130 struct cmdline_parser_params *params); 00131 00138 int cmdline_parser_dump(FILE *outfile, 00139 struct gengetopt_args_info *args_info); 00140 00148 int cmdline_parser_file_save(const char *filename, 00149 struct gengetopt_args_info *args_info); 00150 00154 void cmdline_parser_print_help(void); 00158 void cmdline_parser_print_version(void); 00159 00165 void cmdline_parser_params_init(struct cmdline_parser_params *params); 00166 00172 struct cmdline_parser_params *cmdline_parser_params_create(void); 00173 00179 void cmdline_parser_init (struct gengetopt_args_info *args_info); 00185 void cmdline_parser_free (struct gengetopt_args_info *args_info); 00186 00194 int cmdline_parser_required (struct gengetopt_args_info *args_info, 00195 const char *prog_name); 00196 00197 00198 #ifdef __cplusplus 00199 } 00200 #endif /* __cplusplus */ 00201 #endif /* CMDLINE_H */