aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/dispatch.h
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-06-16 13:35:04 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2016-08-31 21:40:20 +0200
commitde3a515123fa417ecce61efebe4bc117b010c657 (patch)
tree544542b8b92fa77016be159a1ad78bf482e436bd /src/nvim/api/private/dispatch.h
parent5e59916e84933b0b05fda8ed76cf5f24fa3f48b6 (diff)
downloadrneovim-de3a515123fa417ecce61efebe4bc117b010c657.tar.gz
rneovim-de3a515123fa417ecce61efebe4bc117b010c657.tar.bz2
rneovim-de3a515123fa417ecce61efebe4bc117b010c657.zip
api: rename "msgpack_rpc/defs.h" to "api/private/dispatch.h" and use the header generator.
Diffstat (limited to 'src/nvim/api/private/dispatch.h')
-rw-r--r--src/nvim/api/private/dispatch.h21
1 files changed, 21 insertions, 0 deletions
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