comparison src/channel.c @ 9151:d0f69d0bea7a v7.4.1859

commit https://github.com/vim/vim/commit/ef3abc6442260e9a0314970a532400b05571d3fe Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 29 16:44:26 2016 +0200 patch 7.4.1859 Problem: Cannot use a function reference for "exit_cb". Solution: Use get_callback(). (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Sun, 29 May 2016 16:45:05 +0200
parents 18bbf31015c2
children 4b55d8e162d4
comparison
equal deleted inserted replaced
9150:6bcfd4d4166d 9151:d0f69d0bea7a
3837 partial_unref(opt->jo_out_partial); 3837 partial_unref(opt->jo_out_partial);
3838 if (opt->jo_err_partial != NULL) 3838 if (opt->jo_err_partial != NULL)
3839 partial_unref(opt->jo_err_partial); 3839 partial_unref(opt->jo_err_partial);
3840 if (opt->jo_close_partial != NULL) 3840 if (opt->jo_close_partial != NULL)
3841 partial_unref(opt->jo_close_partial); 3841 partial_unref(opt->jo_close_partial);
3842 if (opt->jo_exit_partial != NULL)
3843 partial_unref(opt->jo_exit_partial);
3842 } 3844 }
3843 3845
3844 /* 3846 /*
3845 * Get the PART_ number from the first character of an option name. 3847 * Get the PART_ number from the first character of an option name.
3846 */ 3848 */
4049 { 4051 {
4050 EMSG2(_(e_invarg2), "close_cb"); 4052 EMSG2(_(e_invarg2), "close_cb");
4051 return FAIL; 4053 return FAIL;
4052 } 4054 }
4053 } 4055 }
4056 else if (STRCMP(hi->hi_key, "exit_cb") == 0)
4057 {
4058 if (!(supported & JO_EXIT_CB))
4059 break;
4060 opt->jo_set |= JO_EXIT_CB;
4061 opt->jo_exit_cb = get_callback(item, &opt->jo_exit_partial);
4062 if (opt->jo_exit_cb == NULL)
4063 {
4064 EMSG2(_(e_invarg2), "exit_cb");
4065 return FAIL;
4066 }
4067 }
4054 else if (STRCMP(hi->hi_key, "waittime") == 0) 4068 else if (STRCMP(hi->hi_key, "waittime") == 0)
4055 { 4069 {
4056 if (!(supported & JO_WAITTIME)) 4070 if (!(supported & JO_WAITTIME))
4057 break; 4071 break;
4058 opt->jo_set |= JO_WAITTIME; 4072 opt->jo_set |= JO_WAITTIME;
4108 opt->jo_stoponexit = get_tv_string_buf_chk(item, 4122 opt->jo_stoponexit = get_tv_string_buf_chk(item,
4109 opt->jo_soe_buf); 4123 opt->jo_soe_buf);
4110 if (opt->jo_stoponexit == NULL) 4124 if (opt->jo_stoponexit == NULL)
4111 { 4125 {
4112 EMSG2(_(e_invarg2), "stoponexit"); 4126 EMSG2(_(e_invarg2), "stoponexit");
4113 return FAIL;
4114 }
4115 }
4116 else if (STRCMP(hi->hi_key, "exit_cb") == 0)
4117 {
4118 if (!(supported & JO_EXIT_CB))
4119 break;
4120 opt->jo_set |= JO_EXIT_CB;
4121 if (item->v_type == VAR_PARTIAL && item->vval.v_partial != NULL)
4122 {
4123 opt->jo_exit_partial = item->vval.v_partial;
4124 opt->jo_exit_cb = item->vval.v_partial->pt_name;
4125 }
4126 else
4127 opt->jo_exit_cb = get_tv_string_buf_chk(
4128 item, opt->jo_ecb_buf);
4129 if (opt->jo_exit_cb == NULL)
4130 {
4131 EMSG2(_(e_invarg2), "exit_cb");
4132 return FAIL; 4127 return FAIL;
4133 } 4128 }
4134 } 4129 }
4135 else if (STRCMP(hi->hi_key, "block_write") == 0) 4130 else if (STRCMP(hi->hi_key, "block_write") == 0)
4136 { 4131 {