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

54 lines
997 B
C
Raw Normal View History

#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>
2020-02-29 01:32:03 +00:00
#include <jsonrpc/api.h>
#include "jsonrpc/send_fn.h"
#ifdef __cplusplus
extern "C"
{
#endif
struct jsonrpc_request;
2020-02-29 01:32:03 +00:00
extern JSONRPC_API bool jsonrpc_is_request(
json_t * message);
2020-02-29 01:32:03 +00:00
extern JSONRPC_API struct jsonrpc_request * jsonrpc_request_create(
int id,
jsonrpc_send_fn * send,
void * user_data);
2020-02-29 01:32:03 +00:00
extern JSONRPC_API void jsonrpc_request_dispose(
struct jsonrpc_request * request);
2020-02-29 01:32:03 +00:00
extern JSONRPC_API void * jsonrpc_request_get_userdata(
struct jsonrpc_request * request);
2020-02-29 01:32:03 +00:00
extern JSONRPC_API void jsonrpc_respond(
struct jsonrpc_request * request,
json_t * result);
2020-02-29 01:32:03 +00:00
extern JSONRPC_API void jsonrpc_respond_error(
struct jsonrpc_request * request,
2020-02-29 01:32:03 +00:00
int code,
char const * message);
#ifdef __cplusplus
}
#endif
#endif