From de3a515123fa417ecce61efebe4bc117b010c657 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Thu, 16 Jun 2016 13:35:04 +0200 Subject: api: rename "msgpack_rpc/defs.h" to "api/private/dispatch.h" and use the header generator. --- src/nvim/api/private/dispatch.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/nvim/api/private/dispatch.h (limited to 'src/nvim/api/private/dispatch.h') diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h new file mode 100644 index 0000000000..9047752026 --- /dev/null +++ b/src/nvim/api/private/dispatch.h @@ -0,0 +1,21 @@ +#ifndef NVIM_API_PRIVATE_DISPATCH_H +#define NVIM_API_PRIVATE_DISPATCH_H + +#include "nvim/api/private/defs.h" + +/// The rpc_method_handlers table, used in msgpack_rpc_dispatch(), stores +/// functions of this type. +typedef struct { + Object (*fn)(uint64_t channel_id, + uint64_t request_id, + Array args, + Error *error); + bool async; // function is always safe to run immediately instead of being + // put in a request queue for handling when nvim waits for input. +} MsgpackRpcRequestHandler; + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "api/private/dispatch.h.generated.h" +#endif + +#endif // NVIM_API_PRIVATE_DISPATCH_H -- cgit From 3bd3b3b76859b3eef80fa4969147efa881b60f40 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 18 Jun 2016 12:06:50 +0200 Subject: api: auto generate api function wrappers for viml --- src/nvim/api/private/dispatch.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/nvim/api/private/dispatch.h') diff --git a/src/nvim/api/private/dispatch.h b/src/nvim/api/private/dispatch.h index 9047752026..d91456c306 100644 --- a/src/nvim/api/private/dispatch.h +++ b/src/nvim/api/private/dispatch.h @@ -3,13 +3,15 @@ #include "nvim/api/private/defs.h" +typedef Object (*ApiDispatchWrapper)(uint64_t channel_id, + uint64_t request_id, + Array args, + Error *error); + /// The rpc_method_handlers table, used in msgpack_rpc_dispatch(), stores /// functions of this type. typedef struct { - Object (*fn)(uint64_t channel_id, - uint64_t request_id, - Array args, - Error *error); + ApiDispatchWrapper fn; bool async; // function is always safe to run immediately instead of being // put in a request queue for handling when nvim waits for input. } MsgpackRpcRequestHandler; -- cgit