aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/json_rpc.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-18 01:08:30 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-18 01:08:30 +0200
commitcf65ac5f7d058710435fb8c6113c1a120b76cbec (patch)
tree63e1277aa9b8a5bcc485d2e3c246d956483b97d1 /src/json_rpc.c
parentnet: remove unused buf_* routines (diff)
downloadcimple-cf65ac5f7d058710435fb8c6113c1a120b76cbec.tar.gz
cimple-cf65ac5f7d058710435fb8c6113c1a120b76cbec.zip
json_rpc: removed unused routines
Diffstat (limited to 'src/json_rpc.c')
-rw-r--r--src/json_rpc.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/json_rpc.c b/src/json_rpc.c
index 538cff0..7630f64 100644
--- a/src/json_rpc.c
+++ b/src/json_rpc.c
@@ -257,11 +257,6 @@ int jsonrpc_request_is_notification(const struct jsonrpc_request *request)
return !json_has(request->impl, jsonrpc_key_id);
}
-const char *jsonrpc_request_to_string(struct jsonrpc_request *request)
-{
- return json_to_string(request->impl);
-}
-
static int jsonrpc_request_from_json(struct jsonrpc_request **_request, struct json_object *impl)
{
int ret = 0;
@@ -290,26 +285,6 @@ static int jsonrpc_request_from_json(struct jsonrpc_request **_request, struct j
return ret;
}
-int jsonrpc_request_parse(struct jsonrpc_request **_request, const char *src)
-{
- struct json_object *impl = json_from_string(src);
- if (!impl) {
- log_err("JSON-RPC: failed to parse request\n");
- return -1;
- }
-
- int ret = jsonrpc_request_from_json(_request, impl);
- if (ret < 0)
- goto free_impl;
-
- return ret;
-
-free_impl:
- json_object_put(impl);
-
- return ret;
-}
-
int jsonrpc_request_send(const struct jsonrpc_request *request, int fd)
{
return json_send(request->impl, fd);
@@ -511,11 +486,6 @@ int jsonrpc_response_is_error(const struct jsonrpc_response *response)
return json_has(response->impl, jsonrpc_key_error);
}
-const char *jsonrpc_response_to_string(struct jsonrpc_response *response)
-{
- return json_to_string(response->impl);
-}
-
static int jsonrpc_response_from_json(struct jsonrpc_response **_response, struct json_object *impl)
{
int ret = 0;
@@ -541,26 +511,6 @@ static int jsonrpc_response_from_json(struct jsonrpc_response **_response, struc
return ret;
}
-int jsonrpc_response_parse(struct jsonrpc_response **_response, const char *src)
-{
- struct json_object *impl = json_from_string(src);
- if (!impl) {
- log_err("JSON-RPC: failed to parse response\n");
- return -1;
- }
-
- int ret = jsonrpc_response_from_json(_response, impl);
- if (ret < 0)
- goto free_impl;
-
- return ret;
-
-free_impl:
- json_object_put(impl);
-
- return ret;
-}
-
int jsonrpc_response_send(const struct jsonrpc_response *response, int fd)
{
return json_send(response->impl, fd);