diff options
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index cc7b9455f..bb9a4c569 100644 --- a/src/eval.c +++ b/src/eval.c @@ -501,6 +501,9 @@ static void f_ceil(typval_T *argvars, typval_T *rettv); #endif #ifdef FEAT_CHANNEL static void f_ch_close(typval_T *argvars, typval_T *rettv); +# ifdef FEAT_JOB +static void f_ch_getjob(typval_T *argvars, typval_T *rettv); +# endif 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); @@ -8186,6 +8189,9 @@ static struct fst #endif #ifdef FEAT_CHANNEL {"ch_close", 1, 1, f_ch_close}, +# ifdef FEAT_JOB + {"ch_getjob", 1, 1, f_ch_getjob}, +# endif {"ch_log", 1, 2, f_ch_log}, {"ch_logfile", 1, 2, f_ch_logfile}, {"ch_open", 1, 2, f_ch_open}, @@ -10186,6 +10192,25 @@ f_ch_close(typval_T *argvars, typval_T *rettv UNUSED) channel_close(channel); } +# ifdef FEAT_JOB +/* + * "ch_getjob()" function + */ + static void +f_ch_getjob(typval_T *argvars, typval_T *rettv) +{ + channel_T *channel = get_channel_arg(&argvars[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; + } +} +# endif + /* * "ch_log()" function */ |