Functions
channel.c File Reference
#include "nvim/api/private/helpers.h"
#include "nvim/api/ui.h"
#include "nvim/channel.h"
#include "nvim/eval.h"
#include "nvim/eval/encode.h"
#include "nvim/event/socket.h"
#include "nvim/fileio.h"
#include "nvim/msgpack_rpc/channel.h"
#include "nvim/msgpack_rpc/server.h"
#include "nvim/os/shell.h"
#include "nvim/path.h"
#include "nvim/ascii.h"

Functions

 PMap (uint64_t)
 Teardown the module. More...
 
bool channel_close (uint64_t id, ChannelPart part, const char **error)
 
void channel_init (void)
 Initializes the module. More...
 
void channel_create_event (Channel *chan, const char *ext_source)
 
void channel_incref (Channel *chan)
 
void channel_decref (Channel *chan)
 
void callback_reader_free (CallbackReader *reader)
 
void callback_reader_start (CallbackReader *reader, const char *type)
 
Channelchannel_job_start (char **argv, CallbackReader on_stdout, CallbackReader on_stderr, Callback on_exit, bool pty, bool rpc, bool detach, const char *cwd, uint16_t pty_width, uint16_t pty_height, char *term_name, varnumber_T *status_out)
 
uint64_t channel_connect (bool tcp, const char *address, bool rpc, CallbackReader on_output, int timeout, const char **error)
 
void channel_from_connection (SocketWatcher *watcher)
 
uint64_t channel_from_stdio (bool rpc, CallbackReader on_output, const char **error) FUNC_ATTR_NONNULL_ALL
 
size_t channel_send (uint64_t id, char *data, size_t len, const char **error)
 
void on_channel_data (Stream *stream, RBuffer *buf, size_t count, void *data, bool eof)
 
void on_job_stderr (Stream *stream, RBuffer *buf, size_t count, void *data, bool eof)
 
void channel_reader_callbacks (Channel *chan, CallbackReader *reader)
 
void channel_terminal_open (Channel *chan)
 
void channel_info_changed (Channel *chan, bool new)
 
bool channel_job_running (uint64_t id)
 
Dictionary channel_info (uint64_t id)
 
Array channel_all_info (void)
 

Function Documentation

void callback_reader_free ( CallbackReader reader)
void callback_reader_start ( CallbackReader reader,
const char *  type 
)
Array channel_all_info ( void  )
bool channel_close ( uint64_t  id,
ChannelPart  part,
const char **  error 
)

Closes a channel

Parameters
idThe channel id
Returns
true if successful, false otherwise
uint64_t channel_connect ( bool  tcp,
const char *  address,
bool  rpc,
CallbackReader  on_output,
int  timeout,
const char **  error 
)
void channel_create_event ( Channel chan,
const char *  ext_source 
)
void channel_decref ( Channel chan)
void channel_from_connection ( SocketWatcher watcher)

Creates an RPC channel from a tcp/pipe socket connection

Parameters
watcherThe SocketWatcher ready to accept the connection
uint64_t channel_from_stdio ( bool  rpc,
CallbackReader  on_output,
const char **  error 
)

Creates an API channel from stdin/stdout. This is used when embedding Neovim

void channel_incref ( Channel chan)
Dictionary channel_info ( uint64_t  id)
void channel_info_changed ( Channel chan,
bool  new 
)
void channel_init ( void  )

Initializes the module.

bool channel_job_running ( uint64_t  id)
Channel* channel_job_start ( char **  argv,
CallbackReader  on_stdout,
CallbackReader  on_stderr,
Callback  on_exit,
bool  pty,
bool  rpc,
bool  detach,
const char *  cwd,
uint16_t  pty_width,
uint16_t  pty_height,
char *  term_name,
varnumber_T status_out 
)
void channel_reader_callbacks ( Channel chan,
CallbackReader reader 
)
size_t channel_send ( uint64_t  id,
char *  data,
size_t  len,
const char **  error 
)
Parameters
datawill be consumed
void channel_terminal_open ( Channel chan)

Open terminal for channel

Channel chan is assumed to be an open pty channel, and curbuf is assumed to be a new, unmodified buffer.

void on_channel_data ( Stream stream,
RBuffer buf,
size_t  count,
void *  data,
bool  eof 
)
void on_job_stderr ( Stream stream,
RBuffer buf,
size_t  count,
void *  data,
bool  eof 
)
PMap ( uint64_t  )

Teardown the module.