2020-03-01 15:55:58 +00:00
|
|
|
#ifndef WF_JSONRPC_REQUEST_H
|
|
|
|
#define WF_JSONRPC_REQUEST_H
|
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#else
|
|
|
|
#include <cstdarg>
|
|
|
|
#include <cstddef>
|
|
|
|
using std::size_t;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <jansson.h>
|
2020-03-29 15:40:33 +00:00
|
|
|
#include "webfuse/core/jsonrpc/send_fn.h"
|
2020-03-01 15:55:58 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct wf_jsonrpc_request;
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern bool wf_jsonrpc_is_request(
|
2020-03-01 15:55:58 +00:00
|
|
|
json_t * message);
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern struct wf_jsonrpc_request *
|
2020-03-01 15:55:58 +00:00
|
|
|
wf_jsonrpc_request_create(
|
|
|
|
int id,
|
|
|
|
wf_jsonrpc_send_fn * send,
|
|
|
|
void * user_data);
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern void wf_jsonrpc_request_dispose(
|
2020-03-01 15:55:58 +00:00
|
|
|
struct wf_jsonrpc_request * request);
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern void * wf_jsonrpc_request_get_userdata(
|
2020-03-01 15:55:58 +00:00
|
|
|
struct wf_jsonrpc_request * request);
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern void wf_jsonrpc_respond(
|
2020-03-01 15:55:58 +00:00
|
|
|
struct wf_jsonrpc_request * request,
|
|
|
|
json_t * result);
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern void wf_jsonrpc_respond_error(
|
2020-03-01 15:55:58 +00:00
|
|
|
struct wf_jsonrpc_request * request,
|
|
|
|
int code,
|
|
|
|
char const * message);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|