summaryrefslogtreecommitdiff
path: root/src/idn_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/idn_cmd.c')
-rw-r--r--src/idn_cmd.c44
1 files changed, 29 insertions, 15 deletions
diff --git a/src/idn_cmd.c b/src/idn_cmd.c
index 86dcb48..877743c 100644
--- a/src/idn_cmd.c
+++ b/src/idn_cmd.c
@@ -1,5 +1,5 @@
/*
- File autogenerated by gengetopt version 2.22.1
+ File autogenerated by gengetopt version 2.22.4
generated with the following command:
gengetopt --unamed-opts --no-handle-version --no-handle-help --set-package=idn --input idn.ggo --file-name idn_cmd Makefile.am
@@ -17,7 +17,11 @@
#include <stdlib.h>
#include <string.h>
-#include "getopt.h"
+#ifndef FIX_UNUSED
+#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
+#endif
+
+#include <getopt.h>
#include "idn_cmd.h"
@@ -84,7 +88,7 @@ static
void clear_args (struct gengetopt_args_info *args_info);
static int
-cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
struct cmdline_parser_params *params, const char *additional_error);
@@ -116,6 +120,7 @@ void clear_given (struct gengetopt_args_info *args_info)
static
void clear_args (struct gengetopt_args_info *args_info)
{
+ FIX_UNUSED (args_info);
args_info->allow_unassigned_flag = 0;
args_info->usestd3asciirules_flag = 0;
args_info->tld_flag = 1;
@@ -155,7 +160,9 @@ void init_args_info(struct gengetopt_args_info *args_info)
void
cmdline_parser_print_version (void)
{
- printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
+ printf ("%s %s\n",
+ (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
+ CMDLINE_PARSER_VERSION);
}
static void print_help_common(void) {
@@ -198,7 +205,7 @@ cmdline_parser_init (struct gengetopt_args_info *args_info)
clear_args (args_info);
init_args_info (args_info);
- args_info->inputs = NULL;
+ args_info->inputs = 0;
args_info->inputs_num = 0;
}
@@ -254,8 +261,9 @@ cmdline_parser_release (struct gengetopt_args_info *args_info)
static void
-write_into_file(FILE *outfile, const char *opt, const char *arg, char *values[])
+write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
{
+ FIX_UNUSED (values);
if (arg) {
fprintf(outfile, "%s=\"%s\"\n", opt, arg);
} else {
@@ -345,7 +353,7 @@ cmdline_parser_free (struct gengetopt_args_info *args_info)
char *
gengetopt_strdup (const char *s)
{
- char *result = NULL;
+ char *result = 0;
if (!s)
return result;
@@ -357,17 +365,17 @@ gengetopt_strdup (const char *s)
}
int
-cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info)
+cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
{
return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
}
int
-cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
struct cmdline_parser_params *params)
{
int result;
- result = cmdline_parser_internal (argc, argv, args_info, params, NULL);
+ result = cmdline_parser_internal (argc, argv, args_info, params, 0);
if (result == EXIT_FAILURE)
{
@@ -379,7 +387,7 @@ cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *ar
}
int
-cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
{
int result;
struct cmdline_parser_params params;
@@ -390,7 +398,7 @@ cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_
params.check_ambiguity = 0;
params.print_errors = 1;
- result = cmdline_parser_internal (argc, argv, args_info, &params, NULL);
+ result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
if (result == EXIT_FAILURE)
{
@@ -404,6 +412,8 @@ cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_
int
cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
{
+ FIX_UNUSED (args_info);
+ FIX_UNUSED (prog_name);
return EXIT_SUCCESS;
}
@@ -431,7 +441,8 @@ static char *package_name = 0;
static
int update_arg(void *field, char **orig_field,
unsigned int *field_given, unsigned int *prev_given,
- char *value, char *possible_values[], const char *default_value,
+ char *value, const char *possible_values[],
+ const char *default_value,
cmdline_parser_arg_type arg_type,
int check_ambiguity, int override,
int no_free, int multiple_option,
@@ -442,6 +453,7 @@ int update_arg(void *field, char **orig_field,
const char *val = value;
int found;
char **string_field;
+ FIX_UNUSED (field);
stop_char = 0;
found = 0;
@@ -459,6 +471,7 @@ int update_arg(void *field, char **orig_field,
return 1; /* failure */
}
+ FIX_UNUSED (default_value);
if (field_given && *field_given && ! override)
return 0;
@@ -508,7 +521,8 @@ int update_arg(void *field, char **orig_field,
int
-cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
+cmdline_parser_internal (
+ int argc, char **argv, struct gengetopt_args_info *args_info,
struct cmdline_parser_params *params, const char *additional_error)
{
int c; /* Character of the parsed option. */
@@ -560,7 +574,7 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf
{ "profile", 1, NULL, 'p' },
{ "debug", 0, NULL, 0 },
{ "quiet", 0, NULL, 0 },
- { NULL, 0, NULL, 0 }
+ { 0, 0, 0, 0 }
};
c = getopt_long (argc, argv, "hVsdeautnkp:", long_options, &option_index);