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

Function early_parse

ccan/ccan/opt/opt.c:235–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

opt_early_parseFunction · 0.85

Calls 1

parse_oneFunction · 0.85

Tested by

no test coverage detected