stream.h
Go to the documentation of this file.
1 #ifndef NVIM_EVENT_STREAM_H
2 #define NVIM_EVENT_STREAM_H
3 
4 #include <stdbool.h>
5 #include <stddef.h>
6 #include <uv.h>
7 
8 #include "nvim/event/loop.h"
9 #include "nvim/rbuffer.h"
10 
11 typedef struct stream Stream;
20  void *data, bool eof);
21 
28 typedef void (*stream_write_cb)(Stream *stream, void *data, int status);
29 typedef void (*stream_close_cb)(Stream *stream, void *data);
30 
31 struct stream {
32  bool closed;
33  bool did_eof;
34  union {
35  uv_pipe_t pipe;
36  uv_tcp_t tcp;
37  uv_idle_t idle;
38 #ifdef WIN32
39  uv_tty_t tty;
40 #endif
41  } uv;
42  uv_stream_t *uvstream;
43  uv_buf_t uvbuf;
45  uv_file fd;
48  void *cb_data;
51  size_t fpos;
52  size_t curmem;
53  size_t maxmem;
54  size_t pending_reqs;
55  size_t num_bytes;
57 };
58 
59 #ifdef INCLUDE_GENERATED_DECLARATIONS
60 # include "event/stream.h.generated.h"
61 #endif
62 #endif // NVIM_EVENT_STREAM_H
stream::pending_reqs
size_t pending_reqs
Definition: stream.h:54
stream::cb_data
void * cb_data
Definition: stream.h:48
stream::fd
uv_file fd
Definition: stream.h:45
stream::close_cb_data
void * close_cb_data
Definition: stream.h:50
stream::curmem
size_t curmem
Definition: stream.h:52
stream::buffer
RBuffer * buffer
Definition: stream.h:44
stream::write_cb
stream_write_cb write_cb
Definition: stream.h:47
stream::internal_data
void * internal_data
Definition: stream.h:50
stream::closed
bool closed
Definition: stream.h:32
void
void(WINAPI *pClosePseudoConsole)(HPCON)
stream::uv
union stream::@28 uv
stream
Definition: stream.h:31
stream_write_cb
void(* stream_write_cb)(Stream *stream, void *data, int status)
Definition: stream.h:28
stream::idle
uv_idle_t idle
Definition: stream.h:37
stream::close_cb
stream_close_cb close_cb
Definition: stream.h:49
stream::maxmem
size_t maxmem
Definition: stream.h:53
stream::fpos
size_t fpos
Definition: stream.h:51
rbuffer
Definition: rbuffer.h:77
stream::uvstream
uv_stream_t * uvstream
Definition: stream.h:42
stream::internal_close_cb
stream_close_cb internal_close_cb
Definition: stream.h:49
count
int count
Definition: regexp_nfa.c:4366
buf
char *const buf
Definition: encode.c:235
multiqueue
Definition: multiqueue.c:71
stream_close_cb
void(* stream_close_cb)(Stream *stream, void *data)
Definition: stream.h:29
stream_read_cb
void(* stream_read_cb)(Stream *stream, RBuffer *buf, size_t count, void *data, bool eof)
Definition: stream.h:19
stream::did_eof
bool did_eof
Definition: stream.h:33
loop.h
stream::num_bytes
size_t num_bytes
Definition: stream.h:55
stream::uvbuf
uv_buf_t uvbuf
Definition: stream.h:43
stream::tcp
uv_tcp_t tcp
Definition: stream.h:36
stream::read_cb
stream_read_cb read_cb
Definition: stream.h:46
rbuffer.h
stream::pipe
uv_pipe_t pipe
Definition: stream.h:35
stream::events
MultiQueue * events
Definition: stream.h:56