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

Function parse_early_args_incomplete

ccan/ccan/opt/test/utils.c:106–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106bool parse_early_args_incomplete(int *argc, char ***argv, ...)
107{
108 char **a;
109 va_list ap;
110
111 va_start(ap, argv);
112 *argc = 1;
113 a = malloc(sizeof(*a) * (*argc + 1));
114 a[0] = (*argv)[0];
115 while ((a[*argc] = va_arg(ap, char *)) != NULL) {
116 (*argc)++;
117 a = realloc(a, sizeof(*a) * (*argc + 1));
118 }
119
120 if (allocated)
121 free(*argv);
122
123 *argv = a;
124 allocated = true;
125
126 return opt_early_parse_incomplete(*argc, *argv, save_err_output);
127}
128
129struct opt_table short_table[] = {
130 /* Short opts, different args. */

Callers 1

mainFunction · 0.85

Calls 1

Tested by

no test coverage detected