Ren Yong
Ren Yong

Reputation: 46

Where can I find the source to the function argp_parse?

I need the GNU Linux Code of the function

    error_t argp_parse(const struct argp *__restrict __argp,int,char **__restrict,unsigned     __flags,int * __arg_index,void *__restrict input)

If someone know where to get or have it ,please send it to me. Thanks very much !!

Upvotes: 2

Views: 1789

Answers (1)

ckhan
ckhan

Reputation: 4791

Part of glibc, so easily found following the links at gnu.org:

From http://sourceware.org/git/?p=glibc.git;a=blob_plain;f=argp/argp-parse.c;hb=e07bb02a4f9e7d98f79f428a661c5b982286869d:

/* Parse the options strings in ARGC & ARGV according to the argp in ARGP.
   FLAGS is one of the ARGP_ flags above.  If END_INDEX is non-NULL, the
   index in ARGV of the first unparsed option is returned in it.  If an
   unknown option is present, EINVAL is returned; if some parser routine
   returned a non-zero value, it is returned; otherwise 0 is returned.  */
error_t
__argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
      int *end_index, void *input)
{
  error_t err;
  struct parser parser;
…

Upvotes: 3

Related Questions