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 
7 #include <uv.h>
8 
9 #include "nvim/event/loop.h"
10 #include "nvim/rbuffer.h"
11 
12 typedef struct stream Stream;
20 typedef void (*stream_read_cb)(Stream *stream, RBuffer *buf, size_t count,
21  void *data, bool eof);
22 
29 typedef void (*stream_write_cb)(Stream *stream, void *data, int status);
30 typedef void (*stream_close_cb)(Stream *stream, void *data);
31 
32 struct stream {
33  bool closed;
34  bool did_eof;
35  union {
36  uv_pipe_t pipe;
37  uv_tcp_t tcp;
38  uv_idle_t idle;
39 #ifdef WIN32
40  uv_tty_t tty;
41 #endif
42  } uv;
43  uv_stream_t *uvstream;
44  uv_buf_t uvbuf;
46  uv_file fd;
49  void *cb_data;
52  size_t fpos;
53  size_t curmem;
54  size_t maxmem;
55  size_t pending_reqs;
56  size_t num_bytes;
58 };
59 
60 #ifdef INCLUDE_GENERATED_DECLARATIONS
61 # include "event/stream.h.generated.h"
62 #endif
63 #endif // NVIM_EVENT_STREAM_H
void(* stream_write_cb)(Stream *stream, void *data, int status)
Definition: stream.h:29
stream_close_cb internal_close_cb
Definition: stream.h:50
size_t num_bytes
Definition: stream.h:56
uv_pipe_t pipe
Definition: stream.h:36
size_t curmem
Definition: stream.h:53
uv_tcp_t tcp
Definition: stream.h:37
Definition: rbuffer.h:77
stream_read_cb read_cb
Definition: stream.h:47
uv_idle_t idle
Definition: stream.h:38
bool did_eof
Definition: stream.h:34
bool closed
Definition: stream.h:33
uv_buf_t uvbuf
Definition: stream.h:44
void * close_cb_data
Definition: stream.h:51
size_t fpos
Definition: stream.h:52
void * cb_data
Definition: stream.h:49
int count
Definition: regexp_nfa.c:4344
RBuffer * buffer
Definition: stream.h:45
void * internal_data
Definition: stream.h:51
char *const buf
Definition: encode.c:231
uv_file fd
Definition: stream.h:46
uv_stream_t * uvstream
Definition: stream.h:43
Definition: stream.h:32
stream_write_cb write_cb
Definition: stream.h:48
size_t pending_reqs
Definition: stream.h:55
void(* stream_close_cb)(Stream *stream, void *data)
Definition: stream.h:30
void(* stream_read_cb)(Stream *stream, RBuffer *buf, size_t count, void *data, bool eof)
Definition: stream.h:20
size_t maxmem
Definition: stream.h:54
stream_close_cb close_cb
Definition: stream.h:50
union stream::@19 uv
Definition: multiqueue.c:73
MultiQueue * events
Definition: stream.h:57