aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/channel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os/channel.h')
-rw-r--r--src/nvim/os/channel.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/os/channel.h b/src/nvim/os/channel.h
index a1c650a378..b88cd2445f 100644
--- a/src/nvim/os/channel.h
+++ b/src/nvim/os/channel.h
@@ -5,6 +5,8 @@
#include "nvim/vim.h"
+#define EVENT_MAXLEN 512
+
/// Initializes the module
void channel_init(void);
@@ -25,11 +27,24 @@ void channel_from_job(char **argv);
/// Sends event/data to channel
///
-/// @param id The channel id
+/// @param id The channel id. If 0, the event will be sent to all
+/// channels that have subscribed to the event type
/// @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);
+/// Subscribes to event broadcasts
+///
+/// @param id The channel id
+/// @param event The event type string
+void channel_subscribe(uint64_t id, char *event);
+
+/// Unsubscribes to event broadcasts
+///
+/// @param id The channel id
+/// @param event The event type string
+void channel_unsubscribe(uint64_t id, char *event);
+
#endif // NVIM_OS_CHANNEL_H