Process top-level JSON result object. * If update is true, ignore entries > td->last_created_index, and * delete before insert. * Put the maximum processed created_index in *last_created_index. * Put the number of entries in *num_entries, if not NULL; */
| 924 | * Put the number of entries in *num_entries, if not NULL; |
| 925 | */ |
| 926 | static struct command_result *process_json_result(struct command *cmd, |
| 927 | const char *buf, |
| 928 | const jsmntok_t *result, |
| 929 | const struct table_desc *td, |
| 930 | bool update, |
| 931 | u64 *last_created_index, |
| 932 | u64 *last_updated_index, |
| 933 | size_t *num_entries) |
| 934 | { |
| 935 | const jsmntok_t *arr; |
| 936 | struct timerel so_far = timemono_since(td->refresh_start); |
| 937 | plugin_log(cmd->plugin, LOG_DBG, |
| 938 | "Time to call %s%s: %"PRIu64".%09"PRIu64" seconds", |
| 939 | td->cmdname, update ? " (updates)" : "", |
| 940 | (u64)so_far.ts.tv_sec, (u64)so_far.ts.tv_nsec); |
| 941 | |
| 942 | arr = json_get_member(buf, result, td->arrname); |
| 943 | if (num_entries) |
| 944 | *num_entries = arr->size; |
| 945 | return process_json_list(cmd, buf, arr, NULL, td, update, |
| 946 | last_created_index, last_updated_index); |
| 947 | } |
| 948 | |
| 949 | static struct command_result *default_list_done(struct command *cmd, |
| 950 | const char *method, |
no test coverage detected