robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
2008fe7b85
master
1#pragma once 2#include <stdbool.h> 3#include <stdint.h> 4#include <stdlib.h> 5 6#include "nvim/event/defs.h" 7 8#define CHAN_STDIO 1 9#define CHAN_STDERR 2 10 11typedef enum { 12kChannelStreamProc , 13kChannelStreamSocket , 14kChannelStreamStdio , 15kChannelStreamStderr , 16kChannelStreamInternal , 17}ChannelStreamType ; 18 19typedef enum { 20kChannelPartStdin , 21kChannelPartStdout , 22kChannelPartStderr , 23kChannelPartRpc , 24kChannelPartAll , 25}ChannelPart ; 26 27typedef enum { 28kChannelStdinPipe , 29kChannelStdinNull , 30}ChannelStdinMode ; 31 32typedef struct { 33RStream in ; 34Stream out ; 35}StdioPair ; 36 37typedef struct { 38bool closed ; 39}StderrState ; 40 41typedef struct { 42LuaRef cb ; 43bool closed ; 44}InternalState ; 45 46typedef struct { 47Callback cb ; 48dict_T * self ; 49garray_T buffer ; 50bool eof ; 51bool buffered ; 52bool fwd_err ; 53const char * type ; 54}CallbackReader ; 55 56#define CALLBACK_READER_INIT ((CallbackReader){ .cb = CALLBACK_NONE, \ 57 .self = NULL, \ 58 .buffer = GA_EMPTY_INIT_VALUE, \ 59 .buffered = false, \ 60 .fwd_err = false, \ 61 .type = NULL })