1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/lib/webfuse/core/jsonrpc/request.h

54 lines
958 B
C
Raw Normal View History

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>
#include "webfuse/core/jsonrpc/send_fn.h"
2020-03-01 15:55:58 +00:00
#ifdef __cplusplus
extern "C"
{
#endif
struct wf_jsonrpc_request;
extern bool wf_jsonrpc_is_request(
2020-03-01 15:55:58 +00:00
json_t * message);
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);
extern void wf_jsonrpc_request_dispose(
2020-03-01 15:55:58 +00:00
struct wf_jsonrpc_request * request);
extern void * wf_jsonrpc_request_get_userdata(
2020-03-01 15:55:58 +00:00
struct wf_jsonrpc_request * request);
extern void wf_jsonrpc_respond(
2020-03-01 15:55:58 +00:00
struct wf_jsonrpc_request * request,
json_t * result);
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