robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
221b6ddf1c
master
1#pragma once 2 3#include <stdbool.h> 4#include <uv.h> 5 6#include "nvim/api/private/dispatch.h" 7#include "nvim/map_defs.h" 8#include "nvim/ui_defs.h" 9 10typedef struct Channel Channel ; 11typedef struct Unpacker Unpacker ; 12 13typedef enum { 14kClientTypeUnknown = -1 , 15kClientTypeRemote = 0 , 16kClientTypeMsgpackRpc = 5 , 17kClientTypeUi = 1 , 18kClientTypeEmbedder = 2 , 19kClientTypeHost = 3 , 20kClientTypePlugin = 4 , 21}ClientType ; 22 23typedef struct { 24uint32_t request_id ; 25bool returned ,errored ; 26Object result ; 27ArenaMem result_mem ; 28}ChannelCallFrame ; 29 30typedef struct { 31MessageType type ; 32Channel * channel ; 33MsgpackRpcRequestHandler handler ; 34Array args ; 35uint32_t request_id ; 36Arena used_mem ; 37}RequestEvent ; 38 39typedef struct { 40bool closed ; 41Unpacker * unpacker ; 42RemoteUI * ui ; 43uint32_t next_request_id ; 44kvec_t (ChannelCallFrame * )call_stack ; 45Dict info ; 46ClientType client_type ; 47}RpcState ;