Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include
File: argp.h
/* Hierarchial argument parsing, layered over getopt.
[0] Fix | Delete
Copyright (C) 1995-2018 Free Software Foundation, Inc.
[1] Fix | Delete
This file is part of the GNU C Library.
[2] Fix | Delete
Written by Miles Bader <miles@gnu.ai.mit.edu>.
[3] Fix | Delete
[4] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[5] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[6] Fix | Delete
License as published by the Free Software Foundation; either
[7] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[8] Fix | Delete
[9] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[10] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[11] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[12] Fix | Delete
Lesser General Public License for more details.
[13] Fix | Delete
[14] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[15] Fix | Delete
License along with the GNU C Library; if not, see
[16] Fix | Delete
<http://www.gnu.org/licenses/>. */
[17] Fix | Delete
[18] Fix | Delete
#ifndef _ARGP_H
[19] Fix | Delete
#define _ARGP_H
[20] Fix | Delete
[21] Fix | Delete
#include <stdio.h>
[22] Fix | Delete
#include <ctype.h>
[23] Fix | Delete
#include <getopt.h>
[24] Fix | Delete
#include <limits.h>
[25] Fix | Delete
#include <errno.h>
[26] Fix | Delete
[27] Fix | Delete
__BEGIN_DECLS
[28] Fix | Delete
[29] Fix | Delete
/* error_t may or may not be available from errno.h, depending on the
[30] Fix | Delete
operating system. */
[31] Fix | Delete
#ifndef __error_t_defined
[32] Fix | Delete
# define __error_t_defined 1
[33] Fix | Delete
typedef int error_t;
[34] Fix | Delete
#endif
[35] Fix | Delete
[36] Fix | Delete
/* A description of a particular option. A pointer to an array of
[37] Fix | Delete
these is passed in the OPTIONS field of an argp structure. Each option
[38] Fix | Delete
entry can correspond to one long option and/or one short option; more
[39] Fix | Delete
names for the same option can be added by following an entry in an option
[40] Fix | Delete
array with options having the OPTION_ALIAS flag set. */
[41] Fix | Delete
struct argp_option
[42] Fix | Delete
{
[43] Fix | Delete
/* The long option name. For more than one name for the same option, you
[44] Fix | Delete
can use following options with the OPTION_ALIAS flag set. */
[45] Fix | Delete
const char *name;
[46] Fix | Delete
[47] Fix | Delete
/* What key is returned for this option. If > 0 and printable, then it's
[48] Fix | Delete
also accepted as a short option. */
[49] Fix | Delete
int key;
[50] Fix | Delete
[51] Fix | Delete
/* If non-NULL, this is the name of the argument associated with this
[52] Fix | Delete
option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
[53] Fix | Delete
const char *arg;
[54] Fix | Delete
[55] Fix | Delete
/* OPTION_ flags. */
[56] Fix | Delete
int flags;
[57] Fix | Delete
[58] Fix | Delete
/* The doc string for this option. If both NAME and KEY are 0, This string
[59] Fix | Delete
will be printed outdented from the normal option column, making it
[60] Fix | Delete
useful as a group header (it will be the first thing printed in its
[61] Fix | Delete
group); in this usage, it's conventional to end the string with a `:'. */
[62] Fix | Delete
const char *doc;
[63] Fix | Delete
[64] Fix | Delete
/* The group this option is in. In a long help message, options are sorted
[65] Fix | Delete
alphabetically within each group, and the groups presented in the order
[66] Fix | Delete
0, 1, 2, ..., n, -m, ..., -2, -1. Every entry in an options array with
[67] Fix | Delete
if this field 0 will inherit the group number of the previous entry, or
[68] Fix | Delete
zero if it's the first one, unless its a group header (NAME and KEY both
[69] Fix | Delete
0), in which case, the previous entry + 1 is the default. Automagic
[70] Fix | Delete
options such as --help are put into group -1. */
[71] Fix | Delete
int group;
[72] Fix | Delete
};
[73] Fix | Delete
[74] Fix | Delete
/* The argument associated with this option is optional. */
[75] Fix | Delete
#define OPTION_ARG_OPTIONAL 0x1
[76] Fix | Delete
[77] Fix | Delete
/* This option isn't displayed in any help messages. */
[78] Fix | Delete
#define OPTION_HIDDEN 0x2
[79] Fix | Delete
[80] Fix | Delete
/* This option is an alias for the closest previous non-alias option. This
[81] Fix | Delete
means that it will be displayed in the same help entry, and will inherit
[82] Fix | Delete
fields other than NAME and KEY from the aliased option. */
[83] Fix | Delete
#define OPTION_ALIAS 0x4
[84] Fix | Delete
[85] Fix | Delete
/* This option isn't actually an option (and so should be ignored by the
[86] Fix | Delete
actual option parser), but rather an arbitrary piece of documentation that
[87] Fix | Delete
should be displayed in much the same manner as the options. If this flag
[88] Fix | Delete
is set, then the option NAME field is displayed unmodified (e.g., no `--'
[89] Fix | Delete
prefix is added) at the left-margin (where a *short* option would normally
[90] Fix | Delete
be displayed), and the documentation string in the normal place. For
[91] Fix | Delete
purposes of sorting, any leading whitespace and punctuation is ignored,
[92] Fix | Delete
except that if the first non-whitespace character is not `-', this entry
[93] Fix | Delete
is displayed after all options (and OPTION_DOC entries with a leading `-')
[94] Fix | Delete
in the same group. */
[95] Fix | Delete
#define OPTION_DOC 0x8
[96] Fix | Delete
[97] Fix | Delete
/* This option shouldn't be included in `long' usage messages (but is still
[98] Fix | Delete
included in help messages). This is mainly intended for options that are
[99] Fix | Delete
completely documented in an argp's ARGS_DOC field, in which case including
[100] Fix | Delete
the option in the generic usage list would be redundant. For instance,
[101] Fix | Delete
if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to
[102] Fix | Delete
distinguish these two cases, -x should probably be marked
[103] Fix | Delete
OPTION_NO_USAGE. */
[104] Fix | Delete
#define OPTION_NO_USAGE 0x10
[105] Fix | Delete
[106] Fix | Delete
struct argp; /* fwd declare this type */
[107] Fix | Delete
struct argp_state; /* " */
[108] Fix | Delete
struct argp_child; /* " */
[109] Fix | Delete
[110] Fix | Delete
/* The type of a pointer to an argp parsing function. */
[111] Fix | Delete
typedef error_t (*argp_parser_t) (int __key, char *__arg,
[112] Fix | Delete
struct argp_state *__state);
[113] Fix | Delete
[114] Fix | Delete
/* What to return for unrecognized keys. For special ARGP_KEY_ keys, such
[115] Fix | Delete
returns will simply be ignored. For user keys, this error will be turned
[116] Fix | Delete
into EINVAL (if the call to argp_parse is such that errors are propagated
[117] Fix | Delete
back to the user instead of exiting); returning EINVAL itself would result
[118] Fix | Delete
in an immediate stop to parsing in *all* cases. */
[119] Fix | Delete
#define ARGP_ERR_UNKNOWN E2BIG /* Hurd should never need E2BIG. XXX */
[120] Fix | Delete
[121] Fix | Delete
/* Special values for the KEY argument to an argument parsing function.
[122] Fix | Delete
ARGP_ERR_UNKNOWN should be returned if they aren't understood.
[123] Fix | Delete
[124] Fix | Delete
The sequence of keys to a parsing function is either (where each
[125] Fix | Delete
uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key):
[126] Fix | Delete
[127] Fix | Delete
INIT opt... NO_ARGS END SUCCESS -- No non-option arguments at all
[128] Fix | Delete
or INIT (opt | ARG)... END SUCCESS -- All non-option args parsed
[129] Fix | Delete
or INIT (opt | ARG)... SUCCESS -- Some non-option arg unrecognized
[130] Fix | Delete
[131] Fix | Delete
The third case is where every parser returned ARGP_KEY_UNKNOWN for an
[132] Fix | Delete
argument, in which case parsing stops at that argument (returning the
[133] Fix | Delete
unparsed arguments to the caller of argp_parse if requested, or stopping
[134] Fix | Delete
with an error message if not).
[135] Fix | Delete
[136] Fix | Delete
If an error occurs (either detected by argp, or because the parsing
[137] Fix | Delete
function returned an error value), then the parser is called with
[138] Fix | Delete
ARGP_KEY_ERROR, and no further calls are made. */
[139] Fix | Delete
[140] Fix | Delete
/* This is not an option at all, but rather a command line argument. If a
[141] Fix | Delete
parser receiving this key returns success, the fact is recorded, and the
[142] Fix | Delete
ARGP_KEY_NO_ARGS case won't be used. HOWEVER, if while processing the
[143] Fix | Delete
argument, a parser function decrements the NEXT field of the state it's
[144] Fix | Delete
passed, the option won't be considered processed; this is to allow you to
[145] Fix | Delete
actually modify the argument (perhaps into an option), and have it
[146] Fix | Delete
processed again. */
[147] Fix | Delete
#define ARGP_KEY_ARG 0
[148] Fix | Delete
/* There are remaining arguments not parsed by any parser, which may be found
[149] Fix | Delete
starting at (STATE->argv + STATE->next). If success is returned, but
[150] Fix | Delete
STATE->next left untouched, it's assumed that all arguments were consume,
[151] Fix | Delete
otherwise, the parser should adjust STATE->next to reflect any arguments
[152] Fix | Delete
consumed. */
[153] Fix | Delete
#define ARGP_KEY_ARGS 0x1000006
[154] Fix | Delete
/* There are no more command line arguments at all. */
[155] Fix | Delete
#define ARGP_KEY_END 0x1000001
[156] Fix | Delete
/* Because it's common to want to do some special processing if there aren't
[157] Fix | Delete
any non-option args, user parsers are called with this key if they didn't
[158] Fix | Delete
successfully process any non-option arguments. Called just before
[159] Fix | Delete
ARGP_KEY_END (where more general validity checks on previously parsed
[160] Fix | Delete
arguments can take place). */
[161] Fix | Delete
#define ARGP_KEY_NO_ARGS 0x1000002
[162] Fix | Delete
/* Passed in before any parsing is done. Afterwards, the values of each
[163] Fix | Delete
element of the CHILD_INPUT field, if any, in the state structure is
[164] Fix | Delete
copied to each child's state to be the initial value of the INPUT field. */
[165] Fix | Delete
#define ARGP_KEY_INIT 0x1000003
[166] Fix | Delete
/* Use after all other keys, including SUCCESS & END. */
[167] Fix | Delete
#define ARGP_KEY_FINI 0x1000007
[168] Fix | Delete
/* Passed in when parsing has successfully been completed (even if there are
[169] Fix | Delete
still arguments remaining). */
[170] Fix | Delete
#define ARGP_KEY_SUCCESS 0x1000004
[171] Fix | Delete
/* Passed in if an error occurs. */
[172] Fix | Delete
#define ARGP_KEY_ERROR 0x1000005
[173] Fix | Delete
[174] Fix | Delete
/* An argp structure contains a set of options declarations, a function to
[175] Fix | Delete
deal with parsing one, documentation string, a possible vector of child
[176] Fix | Delete
argp's, and perhaps a function to filter help output. When actually
[177] Fix | Delete
parsing options, getopt is called with the union of all the argp
[178] Fix | Delete
structures chained together through their CHILD pointers, with conflicts
[179] Fix | Delete
being resolved in favor of the first occurrence in the chain. */
[180] Fix | Delete
struct argp
[181] Fix | Delete
{
[182] Fix | Delete
/* An array of argp_option structures, terminated by an entry with both
[183] Fix | Delete
NAME and KEY having a value of 0. */
[184] Fix | Delete
const struct argp_option *options;
[185] Fix | Delete
[186] Fix | Delete
/* What to do with an option from this structure. KEY is the key
[187] Fix | Delete
associated with the option, and ARG is any associated argument (NULL if
[188] Fix | Delete
none was supplied). If KEY isn't understood, ARGP_ERR_UNKNOWN should be
[189] Fix | Delete
returned. If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
[190] Fix | Delete
parsing is stopped immediately, and that value is returned from
[191] Fix | Delete
argp_parse(). For special (non-user-supplied) values of KEY, see the
[192] Fix | Delete
ARGP_KEY_ definitions below. */
[193] Fix | Delete
argp_parser_t parser;
[194] Fix | Delete
[195] Fix | Delete
/* A string describing what other arguments are wanted by this program. It
[196] Fix | Delete
is only used by argp_usage to print the `Usage:' message. If it
[197] Fix | Delete
contains newlines, the strings separated by them are considered
[198] Fix | Delete
alternative usage patterns, and printed on separate lines (lines after
[199] Fix | Delete
the first are prefix by ` or: ' instead of `Usage:'). */
[200] Fix | Delete
const char *args_doc;
[201] Fix | Delete
[202] Fix | Delete
/* If non-NULL, a string containing extra text to be printed before and
[203] Fix | Delete
after the options in a long help message (separated by a vertical tab
[204] Fix | Delete
`\v' character). */
[205] Fix | Delete
const char *doc;
[206] Fix | Delete
[207] Fix | Delete
/* A vector of argp_children structures, terminated by a member with a 0
[208] Fix | Delete
argp field, pointing to child argps should be parsed with this one. Any
[209] Fix | Delete
conflicts are resolved in favor of this argp, or early argps in the
[210] Fix | Delete
CHILDREN list. This field is useful if you use libraries that supply
[211] Fix | Delete
their own argp structure, which you want to use in conjunction with your
[212] Fix | Delete
own. */
[213] Fix | Delete
const struct argp_child *children;
[214] Fix | Delete
[215] Fix | Delete
/* If non-zero, this should be a function to filter the output of help
[216] Fix | Delete
messages. KEY is either a key from an option, in which case TEXT is
[217] Fix | Delete
that option's help text, or a special key from the ARGP_KEY_HELP_
[218] Fix | Delete
defines, below, describing which other help text TEXT is. The function
[219] Fix | Delete
should return either TEXT, if it should be used as-is, a replacement
[220] Fix | Delete
string, which should be malloced, and will be freed by argp, or NULL,
[221] Fix | Delete
meaning `print nothing'. The value for TEXT is *after* any translation
[222] Fix | Delete
has been done, so if any of the replacement text also needs translation,
[223] Fix | Delete
that should be done by the filter function. INPUT is either the input
[224] Fix | Delete
supplied to argp_parse, or NULL, if argp_help was called directly. */
[225] Fix | Delete
char *(*help_filter) (int __key, const char *__text, void *__input);
[226] Fix | Delete
[227] Fix | Delete
/* If non-zero the strings used in the argp library are translated using
[228] Fix | Delete
the domain described by this string. Otherwise the currently installed
[229] Fix | Delete
default domain is used. */
[230] Fix | Delete
const char *argp_domain;
[231] Fix | Delete
};
[232] Fix | Delete
[233] Fix | Delete
/* Possible KEY arguments to a help filter function. */
[234] Fix | Delete
#define ARGP_KEY_HELP_PRE_DOC 0x2000001 /* Help text preceeding options. */
[235] Fix | Delete
#define ARGP_KEY_HELP_POST_DOC 0x2000002 /* Help text following options. */
[236] Fix | Delete
#define ARGP_KEY_HELP_HEADER 0x2000003 /* Option header string. */
[237] Fix | Delete
#define ARGP_KEY_HELP_EXTRA 0x2000004 /* After all other documentation;
[238] Fix | Delete
TEXT is NULL for this key. */
[239] Fix | Delete
/* Explanatory note emitted when duplicate option arguments have been
[240] Fix | Delete
suppressed. */
[241] Fix | Delete
#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
[242] Fix | Delete
#define ARGP_KEY_HELP_ARGS_DOC 0x2000006 /* Argument doc string. */
[243] Fix | Delete
[244] Fix | Delete
/* When an argp has a non-zero CHILDREN field, it should point to a vector of
[245] Fix | Delete
argp_child structures, each of which describes a subsidiary argp. */
[246] Fix | Delete
struct argp_child
[247] Fix | Delete
{
[248] Fix | Delete
/* The child parser. */
[249] Fix | Delete
const struct argp *argp;
[250] Fix | Delete
[251] Fix | Delete
/* Flags for this child. */
[252] Fix | Delete
int flags;
[253] Fix | Delete
[254] Fix | Delete
/* If non-zero, an optional header to be printed in help output before the
[255] Fix | Delete
child options. As a side-effect, a non-zero value forces the child
[256] Fix | Delete
options to be grouped together; to achieve this effect without actually
[257] Fix | Delete
printing a header string, use a value of "". */
[258] Fix | Delete
const char *header;
[259] Fix | Delete
[260] Fix | Delete
/* Where to group the child options relative to the other (`consolidated')
[261] Fix | Delete
options in the parent argp; the values are the same as the GROUP field
[262] Fix | Delete
in argp_option structs, but all child-groupings follow parent options at
[263] Fix | Delete
a particular group level. If both this field and HEADER are zero, then
[264] Fix | Delete
they aren't grouped at all, but rather merged with the parent options
[265] Fix | Delete
(merging the child's grouping levels with the parents). */
[266] Fix | Delete
int group;
[267] Fix | Delete
};
[268] Fix | Delete
[269] Fix | Delete
/* Parsing state. This is provided to parsing functions called by argp,
[270] Fix | Delete
which may examine and, as noted, modify fields. */
[271] Fix | Delete
struct argp_state
[272] Fix | Delete
{
[273] Fix | Delete
/* The top level ARGP being parsed. */
[274] Fix | Delete
const struct argp *root_argp;
[275] Fix | Delete
[276] Fix | Delete
/* The argument vector being parsed. May be modified. */
[277] Fix | Delete
int argc;
[278] Fix | Delete
char **argv;
[279] Fix | Delete
[280] Fix | Delete
/* The index in ARGV of the next arg that to be parsed. May be modified. */
[281] Fix | Delete
int next;
[282] Fix | Delete
[283] Fix | Delete
/* The flags supplied to argp_parse. May be modified. */
[284] Fix | Delete
unsigned flags;
[285] Fix | Delete
[286] Fix | Delete
/* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
[287] Fix | Delete
number of the current arg, starting at zero, and incremented after each
[288] Fix | Delete
such call returns. At all other times, this is the number of such
[289] Fix | Delete
arguments that have been processed. */
[290] Fix | Delete
unsigned arg_num;
[291] Fix | Delete
[292] Fix | Delete
/* If non-zero, the index in ARGV of the first argument following a special
[293] Fix | Delete
`--' argument (which prevents anything following being interpreted as an
[294] Fix | Delete
option). Only set once argument parsing has proceeded past this point. */
[295] Fix | Delete
int quoted;
[296] Fix | Delete
[297] Fix | Delete
/* An arbitrary pointer passed in from the user. */
[298] Fix | Delete
void *input;
[299] Fix | Delete
/* Values to pass to child parsers. This vector will be the same length as
[300] Fix | Delete
the number of children for the current parser. */
[301] Fix | Delete
void **child_inputs;
[302] Fix | Delete
[303] Fix | Delete
/* For the parser's use. Initialized to 0. */
[304] Fix | Delete
void *hook;
[305] Fix | Delete
[306] Fix | Delete
/* The name used when printing messages. This is initialized to ARGV[0],
[307] Fix | Delete
or PROGRAM_INVOCATION_NAME if that is unavailable. */
[308] Fix | Delete
char *name;
[309] Fix | Delete
[310] Fix | Delete
/* Streams used when argp prints something. */
[311] Fix | Delete
FILE *err_stream; /* For errors; initialized to stderr. */
[312] Fix | Delete
FILE *out_stream; /* For information; initialized to stdout. */
[313] Fix | Delete
[314] Fix | Delete
void *pstate; /* Private, for use by argp. */
[315] Fix | Delete
};
[316] Fix | Delete
[317] Fix | Delete
/* Flags for argp_parse (note that the defaults are those that are
[318] Fix | Delete
convenient for program command line parsing): */
[319] Fix | Delete
[320] Fix | Delete
/* Don't ignore the first element of ARGV. Normally (and always unless
[321] Fix | Delete
ARGP_NO_ERRS is set) the first element of the argument vector is
[322] Fix | Delete
skipped for option parsing purposes, as it corresponds to the program name
[323] Fix | Delete
in a command line. */
[324] Fix | Delete
#define ARGP_PARSE_ARGV0 0x01
[325] Fix | Delete
[326] Fix | Delete
/* Don't print error messages for unknown options to stderr; unless this flag
[327] Fix | Delete
is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
[328] Fix | Delete
name in the error messages. This flag implies ARGP_NO_EXIT (on the
[329] Fix | Delete
assumption that silent exiting upon errors is bad behaviour). */
[330] Fix | Delete
#define ARGP_NO_ERRS 0x02
[331] Fix | Delete
[332] Fix | Delete
/* Don't parse any non-option args. Normally non-option args are parsed by
[333] Fix | Delete
calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
[334] Fix | Delete
as the value. Since it's impossible to know which parse function wants to
[335] Fix | Delete
handle it, each one is called in turn, until one returns 0 or an error
[336] Fix | Delete
other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
[337] Fix | Delete
argp_parse returns prematurely (but with a return value of 0). If all
[338] Fix | Delete
args have been parsed without error, all parsing functions are called one
[339] Fix | Delete
last time with a key of ARGP_KEY_END. This flag needn't normally be set,
[340] Fix | Delete
as the normal behavior is to stop parsing as soon as some argument can't
[341] Fix | Delete
be handled. */
[342] Fix | Delete
#define ARGP_NO_ARGS 0x04
[343] Fix | Delete
[344] Fix | Delete
/* Parse options and arguments in the same order they occur on the command
[345] Fix | Delete
line -- normally they're rearranged so that all options come first. */
[346] Fix | Delete
#define ARGP_IN_ORDER 0x08
[347] Fix | Delete
[348] Fix | Delete
/* Don't provide the standard long option --help, which causes usage and
[349] Fix | Delete
option help information to be output to stdout, and exit (0) called. */
[350] Fix | Delete
#define ARGP_NO_HELP 0x10
[351] Fix | Delete
[352] Fix | Delete
/* Don't exit on errors (they may still result in error messages). */
[353] Fix | Delete
#define ARGP_NO_EXIT 0x20
[354] Fix | Delete
[355] Fix | Delete
/* Use the gnu getopt `long-only' rules for parsing arguments. */
[356] Fix | Delete
#define ARGP_LONG_ONLY 0x40
[357] Fix | Delete
[358] Fix | Delete
/* Turns off any message-printing/exiting options. */
[359] Fix | Delete
#define ARGP_SILENT (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
[360] Fix | Delete
[361] Fix | Delete
/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
[362] Fix | Delete
FLAGS is one of the ARGP_ flags above. If ARG_INDEX is non-NULL, the
[363] Fix | Delete
index in ARGV of the first unparsed option is returned in it. If an
[364] Fix | Delete
unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
[365] Fix | Delete
routine returned a non-zero value, it is returned; otherwise 0 is
[366] Fix | Delete
returned. This function may also call exit unless the ARGP_NO_HELP flag
[367] Fix | Delete
is set. INPUT is a pointer to a value to be passed in to the parser. */
[368] Fix | Delete
extern error_t argp_parse (const struct argp *__restrict __argp,
[369] Fix | Delete
int __argc, char **__restrict __argv,
[370] Fix | Delete
unsigned __flags, int *__restrict __arg_index,
[371] Fix | Delete
void *__restrict __input);
[372] Fix | Delete
extern error_t __argp_parse (const struct argp *__restrict __argp,
[373] Fix | Delete
int __argc, char **__restrict __argv,
[374] Fix | Delete
unsigned __flags, int *__restrict __arg_index,
[375] Fix | Delete
void *__restrict __input);
[376] Fix | Delete
[377] Fix | Delete
/* Global variables. */
[378] Fix | Delete
[379] Fix | Delete
/* If defined or set by the user program to a non-zero value, then a default
[380] Fix | Delete
option --version is added (unless the ARGP_NO_HELP flag is used), which
[381] Fix | Delete
will print this string followed by a newline and exit (unless the
[382] Fix | Delete
ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
[383] Fix | Delete
extern const char *argp_program_version;
[384] Fix | Delete
[385] Fix | Delete
/* If defined or set by the user program to a non-zero value, then a default
[386] Fix | Delete
option --version is added (unless the ARGP_NO_HELP flag is used), which
[387] Fix | Delete
calls this function with a stream to print the version to and a pointer to
[388] Fix | Delete
the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
[389] Fix | Delete
used). This variable takes precedent over ARGP_PROGRAM_VERSION. */
[390] Fix | Delete
extern void (*argp_program_version_hook) (FILE *__restrict __stream,
[391] Fix | Delete
struct argp_state *__restrict
[392] Fix | Delete
__state);
[393] Fix | Delete
[394] Fix | Delete
/* If defined or set by the user program, it should point to string that is
[395] Fix | Delete
the bug-reporting address for the program. It will be printed by
[396] Fix | Delete
argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
[397] Fix | Delete
standard help messages), embedded in a sentence that says something like
[398] Fix | Delete
`Report bugs to ADDR.'. */
[399] Fix | Delete
extern const char *argp_program_bug_address;
[400] Fix | Delete
[401] Fix | Delete
/* The exit status that argp will use when exiting due to a parsing error.
[402] Fix | Delete
If not defined or set by the user program, this defaults to EX_USAGE from
[403] Fix | Delete
<sysexits.h>. */
[404] Fix | Delete
extern error_t argp_err_exit_status;
[405] Fix | Delete
[406] Fix | Delete
/* Flags for argp_help. */
[407] Fix | Delete
#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
[408] Fix | Delete
#define ARGP_HELP_SHORT_USAGE 0x02 /* " but don't actually print options. */
[409] Fix | Delete
#define ARGP_HELP_SEE 0x04 /* a `Try ... for more help' message. */
[410] Fix | Delete
#define ARGP_HELP_LONG 0x08 /* a long help message. */
[411] Fix | Delete
#define ARGP_HELP_PRE_DOC 0x10 /* doc string preceding long help. */
[412] Fix | Delete
#define ARGP_HELP_POST_DOC 0x20 /* doc string following long help. */
[413] Fix | Delete
#define ARGP_HELP_DOC (ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
[414] Fix | Delete
#define ARGP_HELP_BUG_ADDR 0x40 /* bug report address */
[415] Fix | Delete
#define ARGP_HELP_LONG_ONLY 0x80 /* modify output appropriately to
[416] Fix | Delete
reflect ARGP_LONG_ONLY mode. */
[417] Fix | Delete
[418] Fix | Delete
/* These ARGP_HELP flags are only understood by argp_state_help. */
[419] Fix | Delete
#define ARGP_HELP_EXIT_ERR 0x100 /* Call exit(1) instead of returning. */
[420] Fix | Delete
#define ARGP_HELP_EXIT_OK 0x200 /* Call exit(0) instead of returning. */
[421] Fix | Delete
[422] Fix | Delete
/* The standard thing to do after a program command line parsing error, if an
[423] Fix | Delete
error message has already been printed. */
[424] Fix | Delete
#define ARGP_HELP_STD_ERR \
[425] Fix | Delete
(ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
[426] Fix | Delete
/* The standard thing to do after a program command line parsing error, if no
[427] Fix | Delete
more specific error message has been printed. */
[428] Fix | Delete
#define ARGP_HELP_STD_USAGE \
[429] Fix | Delete
(ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
[430] Fix | Delete
/* The standard thing to do in response to a --help option. */
[431] Fix | Delete
#define ARGP_HELP_STD_HELP \
[432] Fix | Delete
(ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
[433] Fix | Delete
| ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
[434] Fix | Delete
[435] Fix | Delete
/* Output a usage message for ARGP to STREAM. FLAGS are from the set
[436] Fix | Delete
ARGP_HELP_*. */
[437] Fix | Delete
extern void argp_help (const struct argp *__restrict __argp,
[438] Fix | Delete
FILE *__restrict __stream,
[439] Fix | Delete
unsigned __flags, char *__restrict __name);
[440] Fix | Delete
extern void __argp_help (const struct argp *__restrict __argp,
[441] Fix | Delete
FILE *__restrict __stream, unsigned __flags,
[442] Fix | Delete
char *__name);
[443] Fix | Delete
[444] Fix | Delete
/* The following routines are intended to be called from within an argp
[445] Fix | Delete
parsing routine (thus taking an argp_state structure as the first
[446] Fix | Delete
argument). They may or may not print an error message and exit, depending
[447] Fix | Delete
on the flags in STATE -- in any case, the caller should be prepared for
[448] Fix | Delete
them *not* to exit, and should return an appropiate error after calling
[449] Fix | Delete
them. [argp_usage & argp_error should probably be called argp_state_...,
[450] Fix | Delete
but they're used often enough that they should be short] */
[451] Fix | Delete
[452] Fix | Delete
/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
[453] Fix | Delete
from the set ARGP_HELP_*. */
[454] Fix | Delete
extern void argp_state_help (const struct argp_state *__restrict __state,
[455] Fix | Delete
FILE *__restrict __stream,
[456] Fix | Delete
unsigned int __flags);
[457] Fix | Delete
extern void __argp_state_help (const struct argp_state *__restrict __state,
[458] Fix | Delete
FILE *__restrict __stream,
[459] Fix | Delete
unsigned int __flags);
[460] Fix | Delete
[461] Fix | Delete
/* Possibly output the standard usage message for ARGP to stderr and exit. */
[462] Fix | Delete
extern void argp_usage (const struct argp_state *__state);
[463] Fix | Delete
extern void __argp_usage (const struct argp_state *__state);
[464] Fix | Delete
[465] Fix | Delete
/* If appropriate, print the printf string FMT and following args, preceded
[466] Fix | Delete
by the program name and `:', to stderr, and followed by a `Try ... --help'
[467] Fix | Delete
message, then exit (1). */
[468] Fix | Delete
extern void argp_error (const struct argp_state *__restrict __state,
[469] Fix | Delete
const char *__restrict __fmt, ...)
[470] Fix | Delete
__attribute__ ((__format__ (__printf__, 2, 3)));
[471] Fix | Delete
extern void __argp_error (const struct argp_state *__restrict __state,
[472] Fix | Delete
const char *__restrict __fmt, ...)
[473] Fix | Delete
__attribute__ ((__format__ (__printf__, 2, 3)));
[474] Fix | Delete
[475] Fix | Delete
/* Similar to the standard gnu error-reporting function error(), but will
[476] Fix | Delete
respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
[477] Fix | Delete
to STATE->err_stream. This is useful for argument parsing code that is
[478] Fix | Delete
shared between program startup (when exiting is desired) and runtime
[479] Fix | Delete
option parsing (when typically an error code is returned instead). The
[480] Fix | Delete
difference between this function and argp_error is that the latter is for
[481] Fix | Delete
*parsing errors*, and the former is for other problems that occur during
[482] Fix | Delete
parsing but don't reflect a (syntactic) problem with the input. */
[483] Fix | Delete
extern void argp_failure (const struct argp_state *__restrict __state,
[484] Fix | Delete
int __status, int __errnum,
[485] Fix | Delete
const char *__restrict __fmt, ...)
[486] Fix | Delete
__attribute__ ((__format__ (__printf__, 4, 5)));
[487] Fix | Delete
extern void __argp_failure (const struct argp_state *__restrict __state,
[488] Fix | Delete
int __status, int __errnum,
[489] Fix | Delete
const char *__restrict __fmt, ...)
[490] Fix | Delete
__attribute__ ((__format__ (__printf__, 4, 5)));
[491] Fix | Delete
[492] Fix | Delete
/* Returns true if the option OPT is a valid short option. */
[493] Fix | Delete
extern int _option_is_short (const struct argp_option *__opt) __THROW;
[494] Fix | Delete
extern int __option_is_short (const struct argp_option *__opt) __THROW;
[495] Fix | Delete
[496] Fix | Delete
/* Returns true if the option OPT is in fact the last (unused) entry in an
[497] Fix | Delete
options array. */
[498] Fix | Delete
extern int _option_is_end (const struct argp_option *__opt) __THROW;
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function