MCPcopy Create free account
hub / github.com/ElementsProject/lightning / opt_find_long_extra

Function opt_find_long_extra

ccan/ccan/opt/parse.c:34–55  ·  view source on GitHub ↗

This sets the len and o to indicate how far it is into the * opt_table's names field. */

Source from the content-addressed store, hash-verified

32/* This sets the len and o to indicate how far it is into the
33 * opt_table's names field. */
34static struct opt_table *opt_find_long_extra(const char *arg,
35 const char **optarg,
36 unsigned int *len,
37 const char **o)
38{
39 unsigned i;
40
41 *optarg = NULL;
42 for (*o = first_lopt(&i, len);
43 *o;
44 *o = next_lopt(*o, &i, len)) {
45 if (strncmp(arg, *o, *len) != 0)
46 continue;
47 if (arg[*len] == '=')
48 *optarg = arg + *len + 1;
49 else if (arg[*len] != '\0')
50 continue;
51 return &opt_table[i];
52
53 }
54 return NULL;
55}
56
57struct opt_table *opt_find_long(const char *arg, const char **optarg)
58{

Callers 2

opt_find_longFunction · 0.85
parse_oneFunction · 0.85

Calls 2

first_loptFunction · 0.85
next_loptFunction · 0.85

Tested by

no test coverage detected