From f3dc04bf7f658f7d5d15047494fd15e286b4c7b6 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Mon, 26 May 2014 13:39:10 -0300 Subject: 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. --- src/nvim/os/channel.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/nvim/os/channel.h') diff --git a/src/nvim/os/channel.h b/src/nvim/os/channel.h index 4a3962575d..543b91dd89 100644 --- a/src/nvim/os/channel.h +++ b/src/nvim/os/channel.h @@ -3,6 +3,7 @@ #include +#include "nvim/vim.h" #include "nvim/os/channel_defs.h" /// Initializes the module @@ -25,5 +26,13 @@ void channel_from_stream(uv_stream_t *stream, ChannelProtocol prot); /// @param prot The rpc protocol used void channel_from_job(char **argv, ChannelProtocol prot); +/// Sends event/data to channel +/// +/// @param id The channel id +/// @param type The event type, an arbitrary string +/// @param obj The event data +/// @return True if the data was sent successfully, false otherwise. +bool channel_send_event(uint64_t id, char *type, typval_T *data); + #endif // NVIM_OS_CHANNEL_H -- cgit