aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/msgpack_rpc.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-05-26 13:39:10 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-05-26 14:02:12 -0300
commitf3dc04bf7f658f7d5d15047494fd15e286b4c7b6 (patch)
tree15a3471f10989c2877211447903fb9a2df66732f /src/nvim/os/msgpack_rpc.c
parent139c7ffdc785b19297e8c3b2d2586dfa284f97a5 (diff)
downloadrneovim-f3dc04bf7f658f7d5d15047494fd15e286b4c7b6.tar.gz
rneovim-f3dc04bf7f658f7d5d15047494fd15e286b4c7b6.tar.bz2
rneovim-f3dc04bf7f658f7d5d15047494fd15e286b4c7b6.zip
API: Events: Implement channel_send_event and vimscript wrapper
This function can be used to send arbitrary objects via the API channel back to connected clients, identified by channel id.
Diffstat (limited to 'src/nvim/os/msgpack_rpc.c')
-rw-r--r--src/nvim/os/msgpack_rpc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/os/msgpack_rpc.c b/src/nvim/os/msgpack_rpc.c
index 62d68ebdec..423c5d584d 100644
--- a/src/nvim/os/msgpack_rpc.c
+++ b/src/nvim/os/msgpack_rpc.c
@@ -113,6 +113,15 @@ void msgpack_rpc_call(uint64_t id, msgpack_object *req, msgpack_packer *res)
msgpack_rpc_dispatch(id, req, res);
}
+void msgpack_rpc_notification(String type, Object data, msgpack_packer *pac)
+{
+ msgpack_pack_array(pac, 3);
+ msgpack_pack_int(pac, 2);
+ msgpack_pack_raw(pac, type.size);
+ msgpack_pack_raw_body(pac, type.data, type.size);
+ msgpack_rpc_from_object(data, pac);
+}
+
void msgpack_rpc_error(char *msg, msgpack_packer *res)
{
size_t len = strlen(msg);