1 | #ifndef NVIM_MSGPACK_RPC_CHANNEL_DEFS_H |
---|---|
2 | #define NVIM_MSGPACK_RPC_CHANNEL_DEFS_H |
3 | |
4 | #include <stdbool.h> |
5 | #include <uv.h> |
6 | #include <msgpack.h> |
7 | |
8 | #include "nvim/api/private/defs.h" |
9 | #include "nvim/event/socket.h" |
10 | #include "nvim/event/process.h" |
11 | #include "nvim/vim.h" |
12 | |
13 | typedef struct Channel Channel; |
14 | |
15 | typedef struct { |
16 | uint32_t request_id; |
17 | bool returned, errored; |
18 | Object result; |
19 | } ChannelCallFrame; |
20 | |
21 | typedef struct { |
22 | MessageType type; |
23 | Channel *channel; |
24 | MsgpackRpcRequestHandler handler; |
25 | Array args; |
26 | uint32_t request_id; |
27 | } RequestEvent; |
28 | |
29 | typedef struct { |
30 | PMap(cstr_t) *subscribed_events; |
31 | bool closed; |
32 | msgpack_unpacker *unpacker; |
33 | uint32_t next_request_id; |
34 | kvec_t(ChannelCallFrame *) call_stack; |
35 | Dictionary info; |
36 | } RpcState; |
37 | |
38 | #endif // NVIM_MSGPACK_RPC_CHANNEL_DEFS_H |
39 |