| 408 | } |
| 409 | |
| 410 | static 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: |
no test coverage detected