From c19b8404a7695221b5f4029a6f206f0a50e200f4 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Thu, 26 Jun 2014 15:35:24 -0300 Subject: channel: Implement channel_exists function --- src/nvim/os/channel.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/nvim/os/channel.c b/src/nvim/os/channel.c index a57fb9ea9e..9e2c812a3f 100644 --- a/src/nvim/os/channel.c +++ b/src/nvim/os/channel.c @@ -124,6 +124,13 @@ void channel_from_stream(uv_stream_t *stream) channel->data.streams.uv = stream; } +bool channel_exists(uint64_t id) +{ + Channel *channel; + return (channel = pmap_get(uint64_t)(channels, id)) != NULL + && channel->enabled; +} + /// Sends event/data to channel /// /// @param id The channel id. If 0, the event will be sent to all -- cgit