aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/private/dispatch.h
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-09-01 18:32:37 +0200
committerGitHub <noreply@github.com>2016-09-01 18:32:37 +0200
commitc6ac4f84b16324b56c38bd2003f037d995262fa1 (patch)
tree5ece44d718f6511d468ac4fe35030a795044999c /src/nvim/api/private/dispatch.h
parent0ade1bb7067d0cdb9b059fb66a8c4b868408be9c (diff)
parentacb7c826b3df50bd9825baf3b2ffaaa79c8b80df (diff)
downloadrneovim-c6ac4f84b16324b56c38bd2003f037d995262fa1.tar.gz
rneovim-c6ac4f84b16324b56c38bd2003f037d995262fa1.tar.bz2
rneovim-c6ac4f84b16324b56c38bd2003f037d995262fa1.zip
Merge pull request #4934 from bfredl/api
make the API callable from vimL, rename API functions to common nvim_ prefix
Diffstat (limited to 'src/nvim/api/private/dispatch.h')
-rw-r--r--src/nvim/api/private/dispatch.h23
1 files changed, 23 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..d91456c306
--- /dev/null
+++ b/src/nvim/api/private/dispatch.h
@@ -0,0 +1,23 @@
+#ifndef NVIM_API_PRIVATE_DISPATCH_H
+#define NVIM_API_PRIVATE_DISPATCH_H
+
+#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 {
+ 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;
+
+#ifdef INCLUDE_GENERATED_DECLARATIONS
+# include "api/private/dispatch.h.generated.h"
+#endif
+
+#endif // NVIM_API_PRIVATE_DISPATCH_H