doc: v:servername, serverstart()

This commit is contained in:
Justin M. Keyes
2015-05-09 02:43:47 -04:00
parent 64c7a36933
commit 84443f176e
5 changed files with 32 additions and 30 deletions

View File

@@ -365,7 +365,7 @@ static struct vimvar {
} vimvars[VV_LEN] =
{
/*
* The order here must match the VV_ defines in vim.h!
* The order here must match the VV_ defines in eval.h!
* Initializing a union does not work, leave tv.vval empty to get zero's.
*/
{VV_NAME("count", VAR_NUMBER), VV_COMPAT+VV_RO},
@@ -13356,7 +13356,7 @@ static void f_serverlist(typval_T *argvars, typval_T *rettv)
static void f_serverstart(typval_T *argvars, typval_T *rettv)
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL; // Will hold the address of the new server.
rettv->vval.v_string = NULL; // Address of the new server
if (check_restricted() || check_secure()) {
return;

View File

@@ -28,13 +28,13 @@ typedef enum {
} ServerType;
typedef struct {
// The address of a pipe, or string value of a tcp address.
// Pipe/socket path, or TCP address string
char addr[ADDRESS_MAX_SIZE];
// Type of the union below
ServerType type;
// This is either a tcp server or unix socket(named pipe on windows)
// TCP server or unix socket (named pipe on Windows)
union {
struct {
uv_tcp_t handle;
@@ -144,7 +144,7 @@ int server_start(const char *endpoint)
size_t addr_len = (size_t)(ip_end - addr);
if (addr_len > sizeof(ip) - 1) {
// Maximum length of an IP address buffer is 15(eg: 255.255.255.255)
// Maximum length of an IPv4 address buffer is 15 (eg: 255.255.255.255)
addr_len = sizeof(ip) - 1;
}
@@ -245,7 +245,7 @@ void server_stop(char *endpoint)
// Trim to `ADDRESS_MAX_SIZE`
xstrlcpy(addr, endpoint, sizeof(addr));
int i = 0; // The index of the server whose address equals addr.
int i = 0; // Index of the server whose address equals addr.
for (; i < servers.ga_len; i++) {
server = ((Server **)servers.ga_data)[i];
if (strcmp(addr, server->addr) == 0) {