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

Function early_parse

ccan/ccan/opt/opt.c:234–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234static bool early_parse(int argc, char *argv[],
235 void (*errlog)(const char *fmt, ...),
236 bool ignore_unknown)
237{
238 int ret;
239 unsigned off = 0;
240 char **tmpargv = opt_alloc.alloc(sizeof(argv[0]) * (argc + 1));
241
242 /* We could avoid a copy and skip instead, but this is simple. */
243 memcpy(tmpargv, argv, sizeof(argv[0]) * (argc + 1));
244
245 /* This helps opt_usage. */
246 opt_argv0 = argv[0];
247
248 while ((ret = parse_one(&argc, tmpargv, OPT_EARLY, &off, errlog, ignore_unknown)) == 1);
249
250 opt_alloc.free(tmpargv);
251
252 /* parse_one returns 0 on finish, -1 on error */
253 return (ret == 0);
254}
255
256bool opt_early_parse(int argc, char *argv[],
257 void (*errlog)(const char *fmt, ...))

Callers 2

opt_early_parseFunction · 0.85

Calls 1

parse_oneFunction · 0.85

Tested by

no test coverage detected