/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* Hierarchial argument parsing, layered over getopt
- Copyright (C) 1995-2000, 2002-2004, 2009-2011 Free Software Foundation, Inc.
+/* Hierarchical argument parsing, layered over getopt
+ Copyright (C) 1995-2000, 2002-2004, 2009-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
#endif
#include <alloca.h>
+#include <stdalign.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include "argp.h"
#include "argp-namefrob.h"
-#define alignof(type) offsetof (struct { char c; type x; }, x)
#define alignto(n, d) ((((n) + (d) - 1) / (d)) * (d))
/* Getopt return values. */
else if (argp_program_version)
fprintf (state->out_stream, "%s\n", argp_program_version);
else
- __argp_error (state, dgettext (state->root_argp->argp_domain,
- "(PROGRAM ERROR) No version known!?"));
+ __argp_error (state, "%s",
+ dgettext (state->root_argp->argp_domain,
+ "(PROGRAM ERROR) No version known!?"));
if (! (state->flags & ARGP_NO_EXIT))
exit (0);
break;
}
\f
-/* The state of a `group' during parsing. Each group corresponds to a
+/* The state of a "group" during parsing. Each group corresponds to a
particular argp structure from the tree of such descending from the top
level argp passed to argp_parse. */
struct group
particular short options is from. */
char *short_end;
- /* The number of non-option args sucessfully handled by this parser. */
+ /* The number of non-option args successfully handled by this parser. */
unsigned args_processed;
/* This group's parser's parent's group. */
struct group *groups;
/* The end of the GROUPS array. */
struct group *egroup;
- /* An vector containing storage for the CHILD_INPUTS field in all groups. */
+ /* A vector containing storage for the CHILD_INPUTS field in all groups. */
void **child_inputs;
/* True if we think using getopt is still useful; if false, then
return group;
}
-/* Find the merged set of getopt options, with keys appropiately prefixed. */
+/* Find the merged set of getopt options, with keys appropriately prefixed. */
static void
parser_convert (struct parser *parser, const struct argp *argp, int flags)
{
int num_opts = 0;
while (!__option_is_end (opt++))
num_opts++;
- szs->short_len += num_opts * 3; /* opt + up to 2 `:'s */
+ szs->short_len += num_opts * 3; /* opt + up to 2 ':'s */
szs->long_len += num_opts;
}
}
if (parser->state.quoted && parser->state.next < parser->state.quoted)
/* The next argument pointer has been moved to before the quoted
- region, so pretend we never saw the quoting `--', and give getopt
+ region, so pretend we never saw the quoting "--", and give getopt
another chance. If the user hasn't removed it, getopt will just
process it again. */
parser->state.quoted = 0;
&& strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
== 0)
/* Not only is this the end of the options, but it's a
- `quoted' region, which may have args that *look* like
+ "quoted" region, which may have args that *look* like
options, so we definitely shouldn't try to use getopt past
here, whatever happens. */
parser->state.quoted = parser->state.next;
#ifndef _LIBC
if (!(flags & ARGP_PARSE_ARGV0))
{
-#ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
+#if HAVE_DECL_PROGRAM_INVOCATION_NAME
if (!program_invocation_name)
program_invocation_name = argv[0];
#endif
-#ifdef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
if (!program_invocation_short_name)
program_invocation_short_name = __argp_base_name (argv[0]);
#endif