1
0
forked from aniani/vim

patch 7.4.1541

Problem:    Missing job_info().
Solution:   Implement it.
This commit is contained in:
Bram Moolenaar
2016-03-12 15:22:55 +01:00
parent ac42afd10b
commit 8950a563b3
6 changed files with 62 additions and 3 deletions

View File

@@ -3725,6 +3725,40 @@ job_status(job_T *job)
return result;
}
/*
* Implementation of job_info().
*/
void
job_info(job_T *job, dict_T *dict)
{
dictitem_T *item;
varnumber_T nr;
dict_add_nr_str(dict, "status", 0L, (char_u *)job_status(job));
item = dictitem_alloc((char_u *)"channel");
if (item == NULL)
return;
item->di_tv.v_lock = 0;
item->di_tv.v_type = VAR_CHANNEL;
item->di_tv.vval.v_channel = job->jv_channel;
if (job->jv_channel != NULL)
++job->jv_channel->ch_refcount;
if (dict_add(dict, item) == FAIL)
dictitem_free(item);
#ifdef UNIX
nr = job->jv_pid;
#else
nr = job->jv_proc_info.dwProcessId;
#endif
dict_add_nr_str(dict, "process", nr, NULL);
dict_add_nr_str(dict, "exitval", job->jv_exitval, NULL);
dict_add_nr_str(dict, "exit-cb", 0L, job->jv_exit_cb);
dict_add_nr_str(dict, "stoponexit", 0L, job->jv_stoponexit);
}
int
job_stop(job_T *job, typval_T *argvars)
{