Macros | Functions
channel.c File Reference
#include <inttypes.h>
#include <msgpack.h>
#include <stdbool.h>
#include <string.h>
#include <uv.h>
#include "nvim/api/private/helpers.h"
#include "nvim/api/ui.h"
#include "nvim/api/vim.h"
#include "nvim/ascii.h"
#include "nvim/channel.h"
#include "nvim/eval.h"
#include "nvim/event/libuv_process.h"
#include "nvim/event/loop.h"
#include "nvim/event/rstream.h"
#include "nvim/event/socket.h"
#include "nvim/event/wstream.h"
#include "nvim/lib/kvec.h"
#include "nvim/log.h"
#include "nvim/main.h"
#include "nvim/map.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/misc1.h"
#include "nvim/msgpack_rpc/channel.h"
#include "nvim/msgpack_rpc/helpers.h"
#include "nvim/os/input.h"
#include "nvim/os_unix.h"
#include "nvim/ui.h"
#include "nvim/vim.h"

Macros

#define REQ   "[request] "
 
#define RES   "[response] "
 
#define NOT   "[notify] "
 
#define ERR   "[error] "
 
#define MUR_OFF   2
 

Functions

void rpc_start (Channel *channel)
 
bool rpc_send_event (uint64_t id, const char *name, Array args)
 
Object rpc_send_call (uint64_t id, const char *method_name, Array args, Error *err)
 
void rpc_subscribe (uint64_t id, char *event)
 
void rpc_unsubscribe (uint64_t id, char *event)
 
void rpc_close (Channel *channel)
 
void rpc_free (Channel *channel)
 
void rpc_set_client_info (uint64_t id, Dictionary info)
 
Dictionary rpc_client_info (Channel *chan)
 
const char * rpc_client_name (Channel *chan)
 

Macro Definition Documentation

◆ ERR

#define ERR   "[error] "

◆ MUR_OFF

#define MUR_OFF   2

◆ NOT

#define NOT   "[notify] "

◆ REQ

#define REQ   "[request] "

◆ RES

#define RES   "[response] "

Function Documentation

◆ rpc_client_info()

Dictionary rpc_client_info ( Channel chan)

◆ rpc_client_name()

const char* rpc_client_name ( Channel chan)

◆ rpc_close()

void rpc_close ( Channel channel)

Mark rpc state as closed, and release its reference to the channel. Don't call this directly, call channel_close(id, kChannelPartRpc, &error)

◆ rpc_free()

void rpc_free ( Channel channel)

◆ rpc_send_call()

Object rpc_send_call ( uint64_t  id,
const char *  method_name,
Array  args,
Error err 
)

Sends a method call to a channel

Parameters
idThe channel id
method_nameThe method name, an arbitrary string
argsArray with method arguments
[out]errorTrue if the return value is an error
Returns
Whatever the remote method returned

◆ rpc_send_event()

bool rpc_send_event ( uint64_t  id,
const char *  name,
Array  args 
)

Publishes an event to a channel.

Parameters
idChannel id. 0 means "broadcast to all subscribed channels"
nameEvent name (application-defined)
argsArray of event arguments
Returns
True if the event was sent successfully, false otherwise.

◆ rpc_set_client_info()

void rpc_set_client_info ( uint64_t  id,
Dictionary  info 
)

◆ rpc_start()

void rpc_start ( Channel channel)

◆ rpc_subscribe()

void rpc_subscribe ( uint64_t  id,
char *  event 
)

Subscribes to event broadcasts

Parameters
idThe channel id
eventThe event type string

◆ rpc_unsubscribe()

void rpc_unsubscribe ( uint64_t  id,
char *  event 
)

Unsubscribes to event broadcasts

Parameters
idThe channel id
eventThe event type string