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

Function add_members

common/test/run-param.c:410–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410static void add_members(struct param **params,
411 char **obj,
412 char **arr, unsigned int **ints)
413{
414 for (int i = 0; i < tal_count(ints); ++i) {
415 const char *name = tal_fmt(*params, "%i", i);
416 if (i != 0) {
417 tal_append_fmt(obj, ", ");
418 tal_append_fmt(arr, ", ");
419 }
420 tal_append_fmt(obj, "\"%i\" : %i", i, i);
421 tal_append_fmt(arr, "%i", i);
422 param_add(params, name, true, NULL, NULL,
423 typesafe_cb_preargs(struct command_result *, void **,
424 param_number,
425 &ints[i],
426 struct command *,
427 const char *,
428 const char *,
429 const jsmntok_t *),
430 &ints[i]);
431 }
432}
433
434/*
435 * A roundabout way of initializing an array of ints to:

Callers 1

five_hundred_paramsFunction · 0.85

Calls 2

tal_append_fmtFunction · 0.85
param_addFunction · 0.85

Tested by

no test coverage detected