2020-06-16 21:57:41 +00:00
|
|
|
#ifndef WFP_JSONRPC_REQUEST_H
|
|
|
|
#define WFP_JSONRPC_REQUEST_H
|
2020-03-01 15:55:58 +00:00
|
|
|
|
|
|
|
#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-06-16 21:39:45 +00:00
|
|
|
#include "webfuse_provider/impl/jsonrpc/send_fn.h"
|
2020-03-01 15:55:58 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_jsonrpc_request;
|
2020-03-01 15:55:58 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern bool wfp_jsonrpc_is_request(
|
2020-03-01 15:55:58 +00:00
|
|
|
json_t * message);
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern struct wfp_jsonrpc_request *
|
|
|
|
wfp_jsonrpc_request_create(
|
2020-03-01 15:55:58 +00:00
|
|
|
int id,
|
2020-06-16 21:57:41 +00:00
|
|
|
wfp_jsonrpc_send_fn * send,
|
2020-03-01 15:55:58 +00:00
|
|
|
void * user_data);
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern void wfp_jsonrpc_request_dispose(
|
|
|
|
struct wfp_jsonrpc_request * request);
|
2020-03-01 15:55:58 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern void * wfp_jsonrpc_request_get_userdata(
|
|
|
|
struct wfp_jsonrpc_request * request);
|
2020-03-01 15:55:58 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern void wfp_jsonrpc_respond(
|
|
|
|
struct wfp_jsonrpc_request * request,
|
2020-03-01 15:55:58 +00:00
|
|
|
json_t * result);
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern void wfp_jsonrpc_respond_error(
|
|
|
|
struct wfp_jsonrpc_request * request,
|
2020-03-01 15:55:58 +00:00
|
|
|
int code,
|
|
|
|
char const * message);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|