f_prompt_setcallback(typval_T *argvars, typval_T *rettv UNUSED)
{
    buf_T	*buf;
    char_u	*callback;
    partial_T	*partial;

    if (check_secure())
	return;
    buf = tv_get_buf(&argvars[0], FALSE);
    if (buf == NULL)
	return;

    callback = get_callback(&argvars[1], &partial);
    if (callback == NULL)
	return;

    free_callback(buf->b_prompt_callback, buf->b_prompt_partial);
    if (partial == NULL)
	buf->b_prompt_callback = vim_strsave(callback);
    else
	/* pointer into the partial */
	buf->b_prompt_callback = callback;
    buf->b_prompt_partial = partial;
}
f_prompt_setcallback(typval_T *argvars, typval_T *rettv UNUSED)
{
    buf_T	*buf;
    char_u	*callback;
    partial_T	*partial;

    if (check_secure())
	return;
    buf = tv_get_buf(&argvars[0], FALSE);
    if (buf == NULL)
	return;

    callback = get_callback(&argvars[1], &partial);
    if (callback == NULL)
	return;

    free_callback(buf->b_prompt_callback, buf->b_prompt_partial);
    if (partial == NULL)
	buf->b_prompt_callback = vim_strsave(callback);
    else
	 
	buf->b_prompt_callback = callback;
    buf->b_prompt_partial = partial;
}