diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-06-26 15:35:24 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-07-17 11:30:01 -0300 |
commit | c19b8404a7695221b5f4029a6f206f0a50e200f4 (patch) | |
tree | 0480629acddff28314147550b0152e3216e22d03 | |
parent | 21d44ab115ba399ea06dcd47c71960332885e48c (diff) | |
download | rneovim-c19b8404a7695221b5f4029a6f206f0a50e200f4.tar.gz rneovim-c19b8404a7695221b5f4029a6f206f0a50e200f4.tar.bz2 rneovim-c19b8404a7695221b5f4029a6f206f0a50e200f4.zip |
channel: Implement channel_exists function
-rw-r--r-- | src/nvim/os/channel.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 |