diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-26 13:39:10 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-05-26 14:02:12 -0300 |
commit | f3dc04bf7f658f7d5d15047494fd15e286b4c7b6 (patch) | |
tree | 15a3471f10989c2877211447903fb9a2df66732f /src/nvim/os/channel.h | |
parent | 139c7ffdc785b19297e8c3b2d2586dfa284f97a5 (diff) | |
download | rneovim-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/channel.h')
-rw-r--r-- | src/nvim/os/channel.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 <uv.h> +#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 |