aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/channel.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/channel.h')
-rw-r--r--src/nvim/channel.h44
1 files changed, 20 insertions, 24 deletions
diff --git a/src/nvim/channel.h b/src/nvim/channel.h
index 35d369e513..2327216826 100644
--- a/src/nvim/channel.h
+++ b/src/nvim/channel.h
@@ -7,19 +7,13 @@
#include "nvim/channel_defs.h" // IWYU pragma: keep
#include "nvim/eval/typval_defs.h"
#include "nvim/event/defs.h"
-#include "nvim/event/libuv_process.h"
-#include "nvim/func_attr.h"
+#include "nvim/event/libuv_proc.h"
#include "nvim/macros_defs.h"
#include "nvim/map_defs.h"
#include "nvim/msgpack_rpc/channel_defs.h"
-#include "nvim/os/pty_process.h"
+#include "nvim/os/pty_proc.h"
#include "nvim/types_defs.h"
-static inline bool callback_reader_set(CallbackReader reader)
-{
- return reader.cb.type != kCallbackNone || reader.self;
-}
-
struct Channel {
uint64_t id;
size_t refcount;
@@ -27,10 +21,10 @@ struct Channel {
ChannelStreamType streamtype;
union {
- Process proc;
- LibuvProcess uv;
- PtyProcess pty;
- Stream socket;
+ Proc proc;
+ LibuvProc uv;
+ PtyProc pty;
+ RStream socket;
StdioPair stdio;
StderrState err;
InternalState internal;
@@ -49,14 +43,20 @@ struct Channel {
bool callback_scheduled;
};
-EXTERN PMap(uint64_t) channels INIT( = MAP_INIT);
-
-EXTERN Callback on_print INIT( = CALLBACK_INIT);
-
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "channel.h.generated.h"
+# include "channel.h.inline.generated.h"
#endif
+static inline bool callback_reader_set(CallbackReader reader)
+{
+ return reader.cb.type != kCallbackNone || reader.self;
+}
+
+EXTERN PMap(uint64_t) channels INIT( = MAP_INIT);
+
+EXTERN Callback on_print INIT( = CALLBACK_INIT);
+
/// @returns Channel with the id or NULL if not found
static inline Channel *find_channel(uint64_t id)
{
@@ -64,16 +64,14 @@ static inline Channel *find_channel(uint64_t id)
}
static inline Stream *channel_instream(Channel *chan)
- REAL_FATTR_NONNULL_ALL;
-
-static inline Stream *channel_instream(Channel *chan)
+ FUNC_ATTR_NONNULL_ALL
{
switch (chan->streamtype) {
case kChannelStreamProc:
return &chan->stream.proc.in;
case kChannelStreamSocket:
- return &chan->stream.socket;
+ return &chan->stream.socket.s;
case kChannelStreamStdio:
return &chan->stream.stdio.out;
@@ -85,10 +83,8 @@ static inline Stream *channel_instream(Channel *chan)
abort();
}
-static inline Stream *channel_outstream(Channel *chan)
- REAL_FATTR_NONNULL_ALL;
-
-static inline Stream *channel_outstream(Channel *chan)
+static inline RStream *channel_outstream(Channel *chan)
+ FUNC_ATTR_NONNULL_ALL
{
switch (chan->streamtype) {
case kChannelStreamProc: