mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.1.1584: the evalfunc.c file is getting too big
Problem: The evalfunc.c file is getting too big. Solution: Move channel and job related functions to channel.c.
This commit is contained in:
1095
src/channel.c
1095
src/channel.c
File diff suppressed because it is too large
Load Diff
470
src/evalfunc.c
470
src/evalfunc.c
@@ -86,26 +86,6 @@ static void f_call(typval_T *argvars, typval_T *rettv);
|
|||||||
#ifdef FEAT_FLOAT
|
#ifdef FEAT_FLOAT
|
||||||
static void f_ceil(typval_T *argvars, typval_T *rettv);
|
static void f_ceil(typval_T *argvars, typval_T *rettv);
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_JOB_CHANNEL
|
|
||||||
static void f_ch_canread(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_close(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_close_in(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_evalexpr(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_evalraw(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_getbufnr(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_getjob(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_info(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_log(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_logfile(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_open(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_read(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_readblob(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_readraw(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_sendexpr(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_sendraw(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_setoptions(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_ch_status(typval_T *argvars, typval_T *rettv);
|
|
||||||
#endif
|
|
||||||
static void f_changenr(typval_T *argvars, typval_T *rettv);
|
static void f_changenr(typval_T *argvars, typval_T *rettv);
|
||||||
static void f_char2nr(typval_T *argvars, typval_T *rettv);
|
static void f_char2nr(typval_T *argvars, typval_T *rettv);
|
||||||
static void f_chdir(typval_T *argvars, typval_T *rettv);
|
static void f_chdir(typval_T *argvars, typval_T *rettv);
|
||||||
@@ -246,14 +226,6 @@ static void f_isinf(typval_T *argvars, typval_T *rettv);
|
|||||||
static void f_isnan(typval_T *argvars, typval_T *rettv);
|
static void f_isnan(typval_T *argvars, typval_T *rettv);
|
||||||
#endif
|
#endif
|
||||||
static void f_items(typval_T *argvars, typval_T *rettv);
|
static void f_items(typval_T *argvars, typval_T *rettv);
|
||||||
#ifdef FEAT_JOB_CHANNEL
|
|
||||||
static void f_job_getchannel(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_job_info(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_job_setoptions(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_job_start(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_job_stop(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_job_status(typval_T *argvars, typval_T *rettv);
|
|
||||||
#endif
|
|
||||||
static void f_join(typval_T *argvars, typval_T *rettv);
|
static void f_join(typval_T *argvars, typval_T *rettv);
|
||||||
static void f_js_decode(typval_T *argvars, typval_T *rettv);
|
static void f_js_decode(typval_T *argvars, typval_T *rettv);
|
||||||
static void f_js_encode(typval_T *argvars, typval_T *rettv);
|
static void f_js_encode(typval_T *argvars, typval_T *rettv);
|
||||||
@@ -309,11 +281,6 @@ static void f_pow(typval_T *argvars, typval_T *rettv);
|
|||||||
#endif
|
#endif
|
||||||
static void f_prevnonblank(typval_T *argvars, typval_T *rettv);
|
static void f_prevnonblank(typval_T *argvars, typval_T *rettv);
|
||||||
static void f_printf(typval_T *argvars, typval_T *rettv);
|
static void f_printf(typval_T *argvars, typval_T *rettv);
|
||||||
#ifdef FEAT_JOB_CHANNEL
|
|
||||||
static void f_prompt_setcallback(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_prompt_setinterrupt(typval_T *argvars, typval_T *rettv);
|
|
||||||
static void f_prompt_setprompt(typval_T *argvars, typval_T *rettv);
|
|
||||||
#endif
|
|
||||||
static void f_pumvisible(typval_T *argvars, typval_T *rettv);
|
static void f_pumvisible(typval_T *argvars, typval_T *rettv);
|
||||||
#ifdef FEAT_PYTHON3
|
#ifdef FEAT_PYTHON3
|
||||||
static void f_py3eval(typval_T *argvars, typval_T *rettv);
|
static void f_py3eval(typval_T *argvars, typval_T *rettv);
|
||||||
@@ -2271,262 +2238,6 @@ f_ceil(typval_T *argvars, typval_T *rettv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FEAT_JOB_CHANNEL
|
|
||||||
/*
|
|
||||||
* "ch_canread()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_canread(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
rettv->vval.v_number = 0;
|
|
||||||
if (channel != NULL)
|
|
||||||
rettv->vval.v_number = channel_has_readahead(channel, PART_SOCK)
|
|
||||||
|| channel_has_readahead(channel, PART_OUT)
|
|
||||||
|| channel_has_readahead(channel, PART_ERR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_close()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_close(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
channel_T *channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0);
|
|
||||||
|
|
||||||
if (channel != NULL)
|
|
||||||
{
|
|
||||||
channel_close(channel, FALSE);
|
|
||||||
channel_clear(channel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_close()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_close_in(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
channel_T *channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0);
|
|
||||||
|
|
||||||
if (channel != NULL)
|
|
||||||
channel_close_in(channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_getbufnr()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_getbufnr(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
rettv->vval.v_number = -1;
|
|
||||||
if (channel != NULL)
|
|
||||||
{
|
|
||||||
char_u *what = tv_get_string(&argvars[1]);
|
|
||||||
int part;
|
|
||||||
|
|
||||||
if (STRCMP(what, "err") == 0)
|
|
||||||
part = PART_ERR;
|
|
||||||
else if (STRCMP(what, "out") == 0)
|
|
||||||
part = PART_OUT;
|
|
||||||
else if (STRCMP(what, "in") == 0)
|
|
||||||
part = PART_IN;
|
|
||||||
else
|
|
||||||
part = PART_SOCK;
|
|
||||||
if (channel->ch_part[part].ch_bufref.br_buf != NULL)
|
|
||||||
rettv->vval.v_number =
|
|
||||||
channel->ch_part[part].ch_bufref.br_buf->b_fnum;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_getjob()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_getjob(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
if (channel != NULL)
|
|
||||||
{
|
|
||||||
rettv->v_type = VAR_JOB;
|
|
||||||
rettv->vval.v_job = channel->ch_job;
|
|
||||||
if (channel->ch_job != NULL)
|
|
||||||
++channel->ch_job->jv_refcount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_info()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_info(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
if (channel != NULL && rettv_dict_alloc(rettv) != FAIL)
|
|
||||||
channel_info(channel, rettv->vval.v_dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_log()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_log(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
char_u *msg = tv_get_string(&argvars[0]);
|
|
||||||
channel_T *channel = NULL;
|
|
||||||
|
|
||||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
|
||||||
channel = get_channel_arg(&argvars[1], FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
ch_log(channel, "%s", msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_logfile()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
char_u *fname;
|
|
||||||
char_u *opt = (char_u *)"";
|
|
||||||
char_u buf[NUMBUFLEN];
|
|
||||||
|
|
||||||
/* Don't open a file in restricted mode. */
|
|
||||||
if (check_restricted() || check_secure())
|
|
||||||
return;
|
|
||||||
fname = tv_get_string(&argvars[0]);
|
|
||||||
if (argvars[1].v_type == VAR_STRING)
|
|
||||||
opt = tv_get_string_buf(&argvars[1], buf);
|
|
||||||
ch_logfile(fname, opt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_open()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_open(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
rettv->v_type = VAR_CHANNEL;
|
|
||||||
if (check_restricted() || check_secure())
|
|
||||||
return;
|
|
||||||
rettv->vval.v_channel = channel_open_func(argvars);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_read()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_read(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
common_channel_read(argvars, rettv, FALSE, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_readblob()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_readblob(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
common_channel_read(argvars, rettv, TRUE, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_readraw()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_readraw(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
common_channel_read(argvars, rettv, TRUE, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_evalexpr()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_evalexpr(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
ch_expr_common(argvars, rettv, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_sendexpr()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_sendexpr(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
ch_expr_common(argvars, rettv, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_evalraw()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_evalraw(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
ch_raw_common(argvars, rettv, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_sendraw()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_sendraw(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
ch_raw_common(argvars, rettv, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_setoptions()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_setoptions(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
channel_T *channel;
|
|
||||||
jobopt_T opt;
|
|
||||||
|
|
||||||
channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
|
|
||||||
if (channel == NULL)
|
|
||||||
return;
|
|
||||||
clear_job_options(&opt);
|
|
||||||
if (get_job_options(&argvars[1], &opt,
|
|
||||||
JO_CB_ALL + JO_TIMEOUT_ALL + JO_MODE_ALL, 0) == OK)
|
|
||||||
channel_set_options(channel, &opt);
|
|
||||||
free_job_options(&opt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "ch_status()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_ch_status(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
channel_T *channel;
|
|
||||||
jobopt_T opt;
|
|
||||||
int part = -1;
|
|
||||||
|
|
||||||
/* return an empty string by default */
|
|
||||||
rettv->v_type = VAR_STRING;
|
|
||||||
rettv->vval.v_string = NULL;
|
|
||||||
|
|
||||||
channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
|
|
||||||
|
|
||||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
|
||||||
{
|
|
||||||
clear_job_options(&opt);
|
|
||||||
if (get_job_options(&argvars[1], &opt, JO_PART, 0) == OK
|
|
||||||
&& (opt.jo_set & JO_PART))
|
|
||||||
part = opt.jo_part;
|
|
||||||
}
|
|
||||||
|
|
||||||
rettv->vval.v_string = vim_strsave((char_u *)channel_status(channel, part));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "changenr()" function
|
* "changenr()" function
|
||||||
*/
|
*/
|
||||||
@@ -7750,119 +7461,6 @@ f_items(typval_T *argvars, typval_T *rettv)
|
|||||||
dict_list(argvars, rettv, 2);
|
dict_list(argvars, rettv, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(FEAT_JOB_CHANNEL) || defined(PROTO)
|
|
||||||
/*
|
|
||||||
* Get the job from the argument.
|
|
||||||
* Returns NULL if the job is invalid.
|
|
||||||
*/
|
|
||||||
static job_T *
|
|
||||||
get_job_arg(typval_T *tv)
|
|
||||||
{
|
|
||||||
job_T *job;
|
|
||||||
|
|
||||||
if (tv->v_type != VAR_JOB)
|
|
||||||
{
|
|
||||||
semsg(_(e_invarg2), tv_get_string(tv));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
job = tv->vval.v_job;
|
|
||||||
|
|
||||||
if (job == NULL)
|
|
||||||
emsg(_("E916: not a valid job"));
|
|
||||||
return job;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "job_getchannel()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_job_getchannel(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
job_T *job = get_job_arg(&argvars[0]);
|
|
||||||
|
|
||||||
if (job != NULL)
|
|
||||||
{
|
|
||||||
rettv->v_type = VAR_CHANNEL;
|
|
||||||
rettv->vval.v_channel = job->jv_channel;
|
|
||||||
if (job->jv_channel != NULL)
|
|
||||||
++job->jv_channel->ch_refcount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "job_info()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_job_info(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
|
||||||
{
|
|
||||||
job_T *job = get_job_arg(&argvars[0]);
|
|
||||||
|
|
||||||
if (job != NULL && rettv_dict_alloc(rettv) != FAIL)
|
|
||||||
job_info(job, rettv->vval.v_dict);
|
|
||||||
}
|
|
||||||
else if (rettv_list_alloc(rettv) == OK)
|
|
||||||
job_info_all(rettv->vval.v_list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "job_setoptions()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_job_setoptions(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
job_T *job = get_job_arg(&argvars[0]);
|
|
||||||
jobopt_T opt;
|
|
||||||
|
|
||||||
if (job == NULL)
|
|
||||||
return;
|
|
||||||
clear_job_options(&opt);
|
|
||||||
if (get_job_options(&argvars[1], &opt, JO_STOPONEXIT + JO_EXIT_CB, 0) == OK)
|
|
||||||
job_set_options(job, &opt);
|
|
||||||
free_job_options(&opt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "job_start()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_job_start(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
rettv->v_type = VAR_JOB;
|
|
||||||
if (check_restricted() || check_secure())
|
|
||||||
return;
|
|
||||||
rettv->vval.v_job = job_start(argvars, NULL, NULL, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "job_status()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_job_status(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
job_T *job = get_job_arg(&argvars[0]);
|
|
||||||
|
|
||||||
if (job != NULL)
|
|
||||||
{
|
|
||||||
rettv->v_type = VAR_STRING;
|
|
||||||
rettv->vval.v_string = vim_strsave((char_u *)job_status(job));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "job_stop()" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_job_stop(typval_T *argvars, typval_T *rettv)
|
|
||||||
{
|
|
||||||
job_T *job = get_job_arg(&argvars[0]);
|
|
||||||
|
|
||||||
if (job != NULL)
|
|
||||||
rettv->vval.v_number = job_stop(job, argvars, NULL);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "join()" function
|
* "join()" function
|
||||||
*/
|
*/
|
||||||
@@ -9248,74 +8846,6 @@ f_printf(typval_T *argvars, typval_T *rettv)
|
|||||||
did_emsg |= saved_did_emsg;
|
did_emsg |= saved_did_emsg;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_JOB_CHANNEL
|
|
||||||
/*
|
|
||||||
* "prompt_setcallback({buffer}, {callback})" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_prompt_setcallback(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
buf_T *buf;
|
|
||||||
callback_T callback;
|
|
||||||
|
|
||||||
if (check_secure())
|
|
||||||
return;
|
|
||||||
buf = tv_get_buf(&argvars[0], FALSE);
|
|
||||||
if (buf == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
callback = get_callback(&argvars[1]);
|
|
||||||
if (callback.cb_name == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
free_callback(&buf->b_prompt_callback);
|
|
||||||
set_callback(&buf->b_prompt_callback, &callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "prompt_setinterrupt({buffer}, {callback})" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_prompt_setinterrupt(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
buf_T *buf;
|
|
||||||
callback_T callback;
|
|
||||||
|
|
||||||
if (check_secure())
|
|
||||||
return;
|
|
||||||
buf = tv_get_buf(&argvars[0], FALSE);
|
|
||||||
if (buf == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
callback = get_callback(&argvars[1]);
|
|
||||||
if (callback.cb_name == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
free_callback(&buf->b_prompt_interrupt);
|
|
||||||
set_callback(&buf->b_prompt_interrupt, &callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* "prompt_setprompt({buffer}, {text})" function
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
f_prompt_setprompt(typval_T *argvars, typval_T *rettv UNUSED)
|
|
||||||
{
|
|
||||||
buf_T *buf;
|
|
||||||
char_u *text;
|
|
||||||
|
|
||||||
if (check_secure())
|
|
||||||
return;
|
|
||||||
buf = tv_get_buf(&argvars[0], FALSE);
|
|
||||||
if (buf == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
text = tv_get_string(&argvars[1]);
|
|
||||||
vim_free(buf->b_prompt_text);
|
|
||||||
buf->b_prompt_text = vim_strsave(text);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "pumvisible()" function
|
* "pumvisible()" function
|
||||||
*/
|
*/
|
||||||
|
@@ -11,7 +11,6 @@ channel_T *channel_open(char *hostname, int port_in, int waittime, void (*nb_clo
|
|||||||
channel_T *channel_open_func(typval_T *argvars);
|
channel_T *channel_open_func(typval_T *argvars);
|
||||||
void channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err);
|
void channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err);
|
||||||
void channel_set_job(channel_T *channel, job_T *job, jobopt_T *options);
|
void channel_set_job(channel_T *channel, job_T *job, jobopt_T *options);
|
||||||
void channel_set_options(channel_T *channel, jobopt_T *opt);
|
|
||||||
void channel_set_req_callback(channel_T *channel, ch_part_T part, callback_T *callback, int id);
|
void channel_set_req_callback(channel_T *channel, ch_part_T part, callback_T *callback, int id);
|
||||||
void channel_buffer_free(buf_T *buf);
|
void channel_buffer_free(buf_T *buf);
|
||||||
void channel_write_any_lines(void);
|
void channel_write_any_lines(void);
|
||||||
@@ -52,7 +51,6 @@ int channel_get_timeout(channel_T *channel, ch_part_T part);
|
|||||||
void clear_job_options(jobopt_T *opt);
|
void clear_job_options(jobopt_T *opt);
|
||||||
void free_job_options(jobopt_T *opt);
|
void free_job_options(jobopt_T *opt);
|
||||||
int get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2);
|
int get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2);
|
||||||
channel_T *get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part);
|
|
||||||
void job_free_all(void);
|
void job_free_all(void);
|
||||||
int job_any_running(void);
|
int job_any_running(void);
|
||||||
int win32_build_cmd(list_T *l, garray_T *gap);
|
int win32_build_cmd(list_T *l, garray_T *gap);
|
||||||
@@ -68,9 +66,34 @@ int has_pending_job(void);
|
|||||||
int job_check_ended(void);
|
int job_check_ended(void);
|
||||||
job_T *job_start(typval_T *argvars, char **argv_arg, jobopt_T *opt_arg, int is_terminal);
|
job_T *job_start(typval_T *argvars, char **argv_arg, jobopt_T *opt_arg, int is_terminal);
|
||||||
char *job_status(job_T *job);
|
char *job_status(job_T *job);
|
||||||
void job_info(job_T *job, dict_T *dict);
|
|
||||||
void job_info_all(list_T *l);
|
|
||||||
int job_stop(job_T *job, typval_T *argvars, char *type);
|
int job_stop(job_T *job, typval_T *argvars, char *type);
|
||||||
void invoke_prompt_callback(void);
|
void invoke_prompt_callback(void);
|
||||||
int invoke_prompt_interrupt(void);
|
int invoke_prompt_interrupt(void);
|
||||||
|
void f_prompt_setcallback(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_prompt_setinterrupt(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_prompt_setprompt(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_canread(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_close(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_close_in(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_getbufnr(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_getjob(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_info(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_log(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_logfile(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_open(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_read(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_readblob(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_readraw(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_evalexpr(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_sendexpr(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_evalraw(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_sendraw(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_setoptions(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_ch_status(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_job_getchannel(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_job_info(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_job_setoptions(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_job_start(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_job_status(typval_T *argvars, typval_T *rettv);
|
||||||
|
void f_job_stop(typval_T *argvars, typval_T *rettv);
|
||||||
/* vim: set ft=c : */
|
/* vim: set ft=c : */
|
||||||
|
@@ -777,6 +777,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1584,
|
||||||
/**/
|
/**/
|
||||||
1583,
|
1583,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user