2020-03-01 15:55:58 +00:00
|
|
|
#ifndef WF_JSONRPC_SERVER_H
|
|
|
|
#define WF_JSONRPC_SERVER_H
|
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#else
|
|
|
|
#include <cstdarg>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <jansson.h>
|
2020-03-29 15:40:33 +00:00
|
|
|
#include "webfuse/core/jsonrpc/method_invoke_fn.h"
|
|
|
|
#include "webfuse/core/jsonrpc/send_fn.h"
|
2020-03-01 15:55:58 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct wf_jsonrpc_server;
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern struct wf_jsonrpc_server *
|
2020-03-01 15:55:58 +00:00
|
|
|
wf_jsonrpc_server_create(void);
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern void
|
2020-03-01 15:55:58 +00:00
|
|
|
wf_jsonrpc_server_dispose(
|
|
|
|
struct wf_jsonrpc_server * server);
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern void wf_jsonrpc_server_add(
|
2020-03-01 15:55:58 +00:00
|
|
|
struct wf_jsonrpc_server * server,
|
|
|
|
char const * method_name,
|
|
|
|
wf_jsonrpc_method_invoke_fn * invoke,
|
|
|
|
void * user_data);
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
extern void wf_jsonrpc_server_process(
|
2020-03-01 15:55:58 +00:00
|
|
|
struct wf_jsonrpc_server * server,
|
|
|
|
json_t * request,
|
|
|
|
wf_jsonrpc_send_fn * send,
|
|
|
|
void * user_data);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|