2019-03-26 22:04:53 +00:00
|
|
|
#ifndef WF_ADAPTER_IMPL_JSONRPC_SERVER_H
|
|
|
|
#define WF_ADAPTER_IMPL_JSONRPC_SERVER_H
|
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#else
|
|
|
|
#include <cstdarg>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <jansson.h>
|
2019-04-01 20:15:12 +00:00
|
|
|
#include "webfuse/core/status.h"
|
|
|
|
#include "webfuse/adapter/impl/jsonrpc/send_fn.h"
|
2019-03-26 22:04:53 +00:00
|
|
|
#include "webfuse/adapter/impl/jsonrpc/method.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2019-04-01 20:15:12 +00:00
|
|
|
extern "C"
|
2019-03-26 22:04:53 +00:00
|
|
|
{
|
2019-04-01 20:15:12 +00:00
|
|
|
#endif
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
struct wf_impl_jsonrpc_server
|
|
|
|
{
|
|
|
|
struct wf_impl_jsonrpc_method * methods;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern void wf_impl_jsonrpc_server_init(
|
2019-04-01 20:15:12 +00:00
|
|
|
struct wf_impl_jsonrpc_server * server);
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
extern void wf_impl_jsonrpc_server_cleanup(
|
|
|
|
struct wf_impl_jsonrpc_server * server);
|
|
|
|
|
|
|
|
extern void wf_impl_jsonrpc_server_add(
|
|
|
|
struct wf_impl_jsonrpc_server * server,
|
2019-04-01 20:15:12 +00:00
|
|
|
char const * method_name,
|
2019-03-26 22:04:53 +00:00
|
|
|
wf_impl_jsonrpc_method_invoke_fn * invoke,
|
2019-04-01 20:15:12 +00:00
|
|
|
void * user_data);
|
2019-03-26 22:04:53 +00:00
|
|
|
|
2019-04-01 20:15:12 +00:00
|
|
|
extern void wf_impl_jsonrpc_server_process(
|
2019-03-26 22:04:53 +00:00
|
|
|
struct wf_impl_jsonrpc_server * server,
|
2019-04-01 20:15:12 +00:00
|
|
|
json_t * request,
|
|
|
|
wf_impl_jsonrpc_send_fn * send,
|
|
|
|
void * user_data);
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|