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

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

Function Documentation

Dictionary rpc_client_info ( Channel chan)
const char* rpc_client_name ( Channel chan)
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)

void rpc_free ( Channel channel)
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
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.
void rpc_set_client_info ( uint64_t  id,
Dictionary  info 
)
void rpc_start ( Channel channel)
void rpc_subscribe ( uint64_t  id,
char *  event 
)

Subscribes to event broadcasts

Parameters
idThe channel id
eventThe event type string
void rpc_unsubscribe ( uint64_t  id,
char *  event 
)

Unsubscribes to event broadcasts

Parameters
idThe channel id
eventThe event type string