comparison src/channel.c @ 8502:ee5cb2e9ed5a v7.4.1541

commit https://github.com/vim/vim/commit/8950a563b306ce76f259573d91c2ddccdf52e32e Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 12 15:22:55 2016 +0100 patch 7.4.1541 Problem: Missing job_info(). Solution: Implement it.
author Christian Brabandt <cb@256bit.org>
date Sat, 12 Mar 2016 15:30:04 +0100
parents 42277980a76d
children 13e5a1f02be4
comparison
equal deleted inserted replaced
8501:e6534d33f5ea 8502:ee5cb2e9ed5a
3723 } 3723 }
3724 } 3724 }
3725 return result; 3725 return result;
3726 } 3726 }
3727 3727
3728 /*
3729 * Implementation of job_info().
3730 */
3731 void
3732 job_info(job_T *job, dict_T *dict)
3733 {
3734 dictitem_T *item;
3735 varnumber_T nr;
3736
3737 dict_add_nr_str(dict, "status", 0L, (char_u *)job_status(job));
3738
3739 item = dictitem_alloc((char_u *)"channel");
3740 if (item == NULL)
3741 return;
3742 item->di_tv.v_lock = 0;
3743 item->di_tv.v_type = VAR_CHANNEL;
3744 item->di_tv.vval.v_channel = job->jv_channel;
3745 if (job->jv_channel != NULL)
3746 ++job->jv_channel->ch_refcount;
3747 if (dict_add(dict, item) == FAIL)
3748 dictitem_free(item);
3749
3750 #ifdef UNIX
3751 nr = job->jv_pid;
3752 #else
3753 nr = job->jv_proc_info.dwProcessId;
3754 #endif
3755 dict_add_nr_str(dict, "process", nr, NULL);
3756
3757 dict_add_nr_str(dict, "exitval", job->jv_exitval, NULL);
3758 dict_add_nr_str(dict, "exit-cb", 0L, job->jv_exit_cb);
3759 dict_add_nr_str(dict, "stoponexit", 0L, job->jv_stoponexit);
3760 }
3761
3728 int 3762 int
3729 job_stop(job_T *job, typval_T *argvars) 3763 job_stop(job_T *job, typval_T *argvars)
3730 { 3764 {
3731 char_u *arg; 3765 char_u *arg;
3732 3766