mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
reorganized library code
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
#ifndef JSONRPC_H
|
||||
#define JSONRPC_H
|
||||
|
||||
#include <jsonrpc/api.h>
|
||||
#include <jsonrpc/method_invoke_fn.h>
|
||||
#include <jsonrpc/proxy.h>
|
||||
#include <jsonrpc/proxy_finished_fn.h>
|
||||
#include <jsonrpc/request.h>
|
||||
#include <jsonrpc/response.h>
|
||||
#include <jsonrpc/send_fn.h>
|
||||
#include <jsonrpc/server.h>
|
||||
#include <jsonrpc/status.h>
|
||||
|
||||
#endif
|
||||
@@ -1,8 +0,0 @@
|
||||
#ifndef JSONRPC_API_H
|
||||
#define JSONRPC_API_H
|
||||
|
||||
#ifndef JSONRPC_API
|
||||
#define JSONRPC_API
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef JSONRPC_METHOD_INVOKE_FN_H
|
||||
#define JSONRPC_METHOD_INVOKE_FN_H
|
||||
|
||||
#include <jsonrpc/api.h>
|
||||
#include <jansson.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct jsonrpc_request;
|
||||
|
||||
typedef void jsonrpc_method_invoke_fn(
|
||||
struct jsonrpc_request * request,
|
||||
char const * method_name,
|
||||
json_t * params,
|
||||
void * user_data);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,64 +0,0 @@
|
||||
#ifndef JSONRPC_PROXY_H
|
||||
#define JSONRPC_PROXY_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 <jsonrpc/api.h>
|
||||
#include <jsonrpc/send_fn.h>
|
||||
#include <jsonrpc/proxy_finished_fn.h>
|
||||
|
||||
#include "webfuse/adapter/impl/time/timeout_manager.h"
|
||||
#include "webfuse/adapter/impl/time/timer.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct jsonrpc_proxy;
|
||||
|
||||
extern JSONRPC_API struct jsonrpc_proxy *
|
||||
jsonrpc_proxy_create(
|
||||
struct wf_impl_timeout_manager * manager,
|
||||
int timeout,
|
||||
jsonrpc_send_fn * send,
|
||||
void * user_data);
|
||||
|
||||
extern JSONRPC_API void jsonrpc_proxy_dispose(
|
||||
struct jsonrpc_proxy * proxy);
|
||||
|
||||
|
||||
extern JSONRPC_API void jsonrpc_proxy_invoke(
|
||||
struct jsonrpc_proxy * proxy,
|
||||
jsonrpc_proxy_finished_fn * finished,
|
||||
void * user_data,
|
||||
char const * method_name,
|
||||
char const * param_info,
|
||||
...
|
||||
);
|
||||
|
||||
extern JSONRPC_API void jsonrpc_proxy_notify(
|
||||
struct jsonrpc_proxy * proxy,
|
||||
char const * method_name,
|
||||
char const * param_info,
|
||||
...
|
||||
);
|
||||
|
||||
extern JSONRPC_API void jsonrpc_proxy_onresult(
|
||||
struct jsonrpc_proxy * proxy,
|
||||
json_t * message);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef JSONRPC_PROXY_FINISHED_FN_H
|
||||
#define JSONRPC_PROXY_FINISHED_FN_H
|
||||
|
||||
#include <jansson.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef void jsonrpc_proxy_finished_fn(
|
||||
void * user_data,
|
||||
json_t const * result,
|
||||
json_t const * error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,53 +0,0 @@
|
||||
#ifndef JSONRPC_REQUEST_H
|
||||
#define 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 <jsonrpc/api.h>
|
||||
#include "jsonrpc/send_fn.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct jsonrpc_request;
|
||||
|
||||
extern JSONRPC_API bool jsonrpc_is_request(
|
||||
json_t * message);
|
||||
|
||||
extern JSONRPC_API struct jsonrpc_request * jsonrpc_request_create(
|
||||
int id,
|
||||
jsonrpc_send_fn * send,
|
||||
void * user_data);
|
||||
|
||||
extern JSONRPC_API void jsonrpc_request_dispose(
|
||||
struct jsonrpc_request * request);
|
||||
|
||||
extern JSONRPC_API void * jsonrpc_request_get_userdata(
|
||||
struct jsonrpc_request * request);
|
||||
|
||||
extern JSONRPC_API void jsonrpc_respond(
|
||||
struct jsonrpc_request * request,
|
||||
json_t * result);
|
||||
|
||||
extern JSONRPC_API void jsonrpc_respond_error(
|
||||
struct jsonrpc_request * request,
|
||||
int code,
|
||||
char const * message);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef JSONRPC_RESPONSE_H
|
||||
#define JSONRPC_RESPONSE_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#include <jansson.h>
|
||||
#include <jsonrpc/api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern JSONRPC_API bool jsonrpc_is_response(
|
||||
json_t * message);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,24 +0,0 @@
|
||||
#ifndef JSONRPC_SEND_FN_H
|
||||
#define JSONRPC_SEND_FN_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
|
||||
#include <jansson.h>
|
||||
#include <jsonrpc/api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef bool jsonrpc_send_fn(
|
||||
json_t * request,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,46 +0,0 @@
|
||||
#ifndef JSONRPC_SERVER_H
|
||||
#define JSONRPC_SERVER_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#else
|
||||
#include <cstdarg>
|
||||
#endif
|
||||
|
||||
#include <jansson.h>
|
||||
#include <jsonrpc/api.h>
|
||||
#include <jsonrpc/send_fn.h>
|
||||
#include <jsonrpc/method_invoke_fn.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct jsonrpc_server;
|
||||
|
||||
extern JSONRPC_API struct jsonrpc_server *
|
||||
jsonrpc_server_create(void);
|
||||
|
||||
extern JSONRPC_API void
|
||||
jsonrpc_server_dispose(
|
||||
struct jsonrpc_server * server);
|
||||
|
||||
extern JSONRPC_API void jsonrpc_server_add(
|
||||
struct jsonrpc_server * server,
|
||||
char const * method_name,
|
||||
jsonrpc_method_invoke_fn * invoke,
|
||||
void * user_data);
|
||||
|
||||
extern JSONRPC_API void jsonrpc_server_process(
|
||||
struct jsonrpc_server * server,
|
||||
json_t * request,
|
||||
jsonrpc_send_fn * send,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,11 +0,0 @@
|
||||
#ifndef JSONRPC_STATUS_H
|
||||
#define JSONRPC_STATUS_H
|
||||
|
||||
#define JSONRPC_GOOD 0
|
||||
#define JSONRPC_BAD -1
|
||||
#define JSONRPC_BAD_NOTIMPLEMENTED -2
|
||||
#define JSONRPC_BAD_TIMEOUT -3
|
||||
#define JSONRPC_BAD_BUSY -4
|
||||
#define JSONRPC_BAD_FORMAT -5
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user