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