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

Function add_members

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

Source from the content-addressed store, hash-verified

360#endif
361
362static void add_members(struct param **params,
363 char **obj,
364 char **arr, unsigned int **ints)
365{
366 for (int i = 0; i < tal_count(ints); ++i) {
367 const char *name = tal_fmt(*params, "%i", i);
368 if (i != 0) {
369 tal_append_fmt(obj, ", ");
370 tal_append_fmt(arr, ", ");
371 }
372 tal_append_fmt(obj, "\"%i\" : %i", i, i);
373 tal_append_fmt(arr, "%i", i);
374 param_add(params, name, true,
375 typesafe_cb_preargs(struct command_result *, void **,
376 param_number,
377 &ints[i],
378 struct command *,
379 const char *,
380 const char *,
381 const jsmntok_t *),
382 &ints[i]);
383 }
384}
385
386/*
387 * 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