From 9cea7b90fb34deff24ba49694963cc98e3e05e49 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Wed, 6 Sep 2017 00:03:39 +0100 Subject: Netbyte rpc example lib --- test/ipc/nbrpc.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test/ipc/nbrpc.h (limited to 'test/ipc/nbrpc.h') diff --git a/test/ipc/nbrpc.h b/test/ipc/nbrpc.h new file mode 100644 index 0000000..6583b51 --- /dev/null +++ b/test/ipc/nbrpc.h @@ -0,0 +1,31 @@ +#ifndef __NBRPC_H +#define __NBRPC_H + +#include + +#include "mq_ntf.h" + +typedef struct rpc_request +{ + char *method; + char *params; + int id; +} rpc_request; + +typedef struct rpc_response +{ + char *result; + char *error; + int id; +} rpc_response; + +rpc_request* rpc_req_new(char *method, char *params, int id); +rpc_response* rpc_resp_new(char *result, char *error, int id); +int rpc_req_free(rpc_request *req); +int rpc_resp_free(rpc_response *resp); +int rpc_req_marsh( rpc_request *req, netbyte_store **nb_req); +int rpc_resp_marsh( rpc_response *resp, netbyte_store **nb_resp); +int rpc_req_unmarsh( netbyte_store *nb_req, rpc_request **req); +int rpc_resp_unmarsh(netbyte_store *nb_resp, rpc_response **resp); + +#endif \ No newline at end of file -- cgit v1.2.3