| 923 | } |
| 924 | |
| 925 | struct command_result *jsonrpc_set_datastore_(struct command *cmd, |
| 926 | const char **keys, |
| 927 | const void *value, |
| 928 | int len_or_str, |
| 929 | const char *mode, |
| 930 | struct command_result *(*cb)(struct command *command, |
| 931 | const char *method, |
| 932 | const char *buf, |
| 933 | const jsmntok_t *result, |
| 934 | void *arg), |
| 935 | struct command_result *(*errcb)(struct command *command, |
| 936 | const char *method, |
| 937 | const char *buf, |
| 938 | const jsmntok_t *result, |
| 939 | void *arg), |
| 940 | void *arg) |
| 941 | { |
| 942 | struct out_req *req; |
| 943 | |
| 944 | if (!cb) |
| 945 | cb = ignore_and_complete; |
| 946 | if (!errcb) |
| 947 | errcb = plugin_broken_cb; |
| 948 | |
| 949 | req = jsonrpc_request_start(cmd, "datastore", cb, errcb, arg); |
| 950 | |
| 951 | json_add_keypath(req->js->jout, "key", keys); |
| 952 | if (len_or_str == -1) |
| 953 | json_add_string(req->js, "string", value); |
| 954 | else |
| 955 | json_add_hex(req->js, "hex", value, len_or_str); |
| 956 | json_add_string(req->js, "mode", mode); |
| 957 | return send_outreq(req); |
| 958 | } |
| 959 | |
| 960 | struct get_ds_info { |
| 961 | struct command_result *(*string_cb)(struct command *command, |
nothing calls this directly
no test coverage detected