comparison src/channel.c @ 8124:310dd635e8c9 v7.4.1356

commit https://github.com/vim/vim/commit/40ea1da14ba196a23309789852e1b663fd92e3a8 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 19 22:33:35 2016 +0100 patch 7.4.1356 Problem: Job and channel options parsing is scattered. Solution: Move all option value parsing to get_job_options();
author Christian Brabandt <cb@256bit.org>
date Fri, 19 Feb 2016 22:45:04 +0100
parents 39532ee7dd43
children f96536c291d8
comparison
equal deleted inserted replaced
8123:0d863405732d 8124:310dd635e8c9
747 { 747 {
748 channel->ch_job = job; 748 channel->ch_job = job;
749 } 749 }
750 750
751 /* 751 /*
752 * Set the mode of channel "channel" to "mode".
753 */
754 void
755 channel_set_mode(channel_T *channel, ch_mode_T mode)
756 {
757 channel->ch_mode = mode;
758 }
759
760 /*
761 * Set the read timeout of channel "channel".
762 */
763 void
764 channel_set_timeout(channel_T *channel, int timeout)
765 {
766 channel->ch_timeout = timeout;
767 }
768
769 /*
770 * Set the callback for channel "channel". 752 * Set the callback for channel "channel".
771 */ 753 */
772 void 754 void
773 channel_set_callback(channel_T *channel, char_u *callback) 755 channel_set_callback(channel_T *channel, char_u *callback)
774 { 756 {
780 * Set various properties from an "options" argument. 762 * Set various properties from an "options" argument.
781 */ 763 */
782 void 764 void
783 channel_set_options(channel_T *channel, jobopt_T *options) 765 channel_set_options(channel_T *channel, jobopt_T *options)
784 { 766 {
785 channel_set_mode(channel, options->jo_mode); 767 if (options->jo_set & JO_MODE)
786 768 channel->ch_mode = options->jo_mode;
787 if (options->jo_callback != NULL && *options->jo_callback != NUL) 769 if (options->jo_set & JO_TIMEOUT)
770 channel->ch_timeout = options->jo_timeout;
771
772 if ((options->jo_set & JO_CALLBACK)
773 && options->jo_callback != NULL && *options->jo_callback != NUL)
788 channel_set_callback(channel, options->jo_callback); 774 channel_set_callback(channel, options->jo_callback);
789 } 775 }
790 776
791 /* 777 /*
792 * Set the callback for channel "channel" for the response with "id". 778 * Set the callback for channel "channel" for the response with "id".