Lines Matching refs:tv

180 static char_u *ex_let_one(char_u *arg, typval_T *tv, int copy, int flags, char_u *endchars, char_u …
932 typval_T *tv, in ex_let_vars() argument
949 if (ex_let_one(arg, tv, copy, flags, op, op, var_idx) == NULL) in ex_let_vars()
955 if (tv->v_type != VAR_LIST || (l = tv->vval.v_list) == NULL) in ex_let_vars()
1195 typval_T tv; in list_arg_vars() local
1232 if (eval_variable(name, len, &tv, NULL, in list_arg_vars()
1239 if (handle_subscript(&arg, &tv, &EVALARG_EVALUATE, TRUE) in list_arg_vars()
1266 s = echo_string(&tv, &tf, numbuf, 0); in list_arg_vars()
1271 tv.v_type, in list_arg_vars()
1277 clear_tv(&tv); in list_arg_vars()
1299 typval_T *tv, // value to assign to variable in ex_let_one() argument
1349 p = tv_get_string_chk(tv); in ex_let_one()
1407 && (tv->v_type != VAR_STRING || !in_vim9script())) in ex_let_one()
1411 n = (long)tv_get_bool(tv); in ex_let_one()
1414 n = (long)tv_get_number(tv); in ex_let_one()
1419 if (tv->v_type != VAR_BOOL && tv->v_type != VAR_SPECIAL in ex_let_one()
1420 && (!in_vim9script() || tv->v_type != VAR_NUMBER)) in ex_let_one()
1421 s = tv_get_string_chk(tv); in ex_let_one()
1497 p = tv_get_string_chk(tv); in ex_let_one()
1523 p = get_lval(arg, tv, &lv, FALSE, FALSE, in ex_let_one()
1533 set_var_lval(&lv, p, tv, copy, flags, op, var_idx); in ex_let_one()
1884 item_lock(typval_T *tv, int deep, int lock, int check_refcount) in item_lock() argument
1905 tv->v_lock |= VAR_LOCKED; in item_lock()
1907 tv->v_lock &= ~VAR_LOCKED; in item_lock()
1909 switch (tv->v_type) in item_lock()
1927 if ((b = tv->vval.v_blob) != NULL in item_lock()
1937 if ((l = tv->vval.v_list) != NULL in item_lock()
1951 if ((d = tv->vval.v_dict) != NULL in item_lock()
2229 set_vim_var_tv(int idx, typval_T *tv) in set_vim_var_tv() argument
2231 if (vimvars[idx].vv_type != tv->v_type) in set_vim_var_tv()
2234 clear_tv(tv); in set_vim_var_tv()
2249 vimvars[idx].vv_di.di_tv = *tv; in set_vim_var_tv()
2570 typval_T *tv = NULL; in eval_variable() local
2581 if ((tv = lookup_debug_var(name)) == NULL) in eval_variable()
2588 tv = &v->di_tv; in eval_variable()
2596 if (tv == NULL && (in_vim9script() || STRNCMP(name, "s:", 2) == 0)) in eval_variable()
2638 tv = sv->sv_tv; in eval_variable()
2664 if (tv == NULL) in eval_variable()
2673 && tv != &SCRIPT_SV(current_sctx.sc_sid)->sv_var.di_tv) in eval_variable()
2675 svar_T *sv = find_typval_in_script(tv); in eval_variable()
2682 if (tv->v_type == VAR_DICT && tv->vval.v_dict == NULL) in eval_variable()
2684 tv->vval.v_dict = dict_alloc(); in eval_variable()
2685 if (tv->vval.v_dict != NULL) in eval_variable()
2687 ++tv->vval.v_dict->dv_refcount; in eval_variable()
2688 tv->vval.v_dict->dv_type = alloc_type(type); in eval_variable()
2691 else if (tv->v_type == VAR_LIST && tv->vval.v_list == NULL) in eval_variable()
2693 tv->vval.v_list = list_alloc(); in eval_variable()
2694 if (tv->vval.v_list != NULL) in eval_variable()
2696 ++tv->vval.v_list->lv_refcount; in eval_variable()
2697 tv->vval.v_list->lv_type = alloc_type(type); in eval_variable()
2700 else if (tv->v_type == VAR_BLOB && tv->vval.v_blob == NULL) in eval_variable()
2702 tv->vval.v_blob = blob_alloc(); in eval_variable()
2703 if (tv->vval.v_blob != NULL) in eval_variable()
2704 ++tv->vval.v_blob->bv_refcount; in eval_variable()
2706 copy_tv(tv, rettv); in eval_variable()
3190 typval_T *tv, in set_var() argument
3193 set_var_const(name, NULL, tv, copy, ASSIGN_DECL, 0); in set_var()
3210 typval_T *tv = tv_arg; in set_var_const() local
3279 if (check_typval_type(sv->sv_type, tv, where) == FAIL in set_var_const()
3296 if ((tv->v_type == VAR_FUNC || tv->v_type == VAR_PARTIAL) in set_var_const()
3300 if (need_convert_to_bool(type, tv)) in set_var_const()
3306 bool_tv.vval.v_number = tv2bool(tv) ? VVAL_TRUE : VVAL_FALSE; in set_var_const()
3307 tv = &bool_tv; in set_var_const()
3336 if (check_script_var_type(&di->di_tv, tv, name, where) in set_var_const()
3353 update_vim9_script_var(FALSE, di, flags, tv, &type, in set_var_const()
3366 if (copy || tv->v_type != VAR_STRING) in set_var_const()
3368 char_u *val = tv_get_string(tv); in set_var_const()
3379 di->di_tv.vval.v_string = tv->vval.v_string; in set_var_const()
3380 tv->vval.v_string = NULL; in set_var_const()
3386 di->di_tv.vval.v_number = tv_get_number(tv); in set_var_const()
3399 else if (di->di_tv.v_type != tv->v_type) in set_var_const()
3454 update_vim9_script_var(TRUE, di, flags, tv, &type, in set_var_const()
3461 if (copy || tv->v_type == VAR_NUMBER || tv->v_type == VAR_FLOAT) in set_var_const()
3462 copy_tv(tv, dest_tv); in set_var_const()
3465 *dest_tv = *tv; in set_var_const()
3467 init_tv(tv); in set_var_const()
3843 typval_T tv; in var_exists() local
3854 n = (eval_variable(name, len, &tv, NULL, in var_exists()
3860 n = (handle_subscript(&arg, &tv, &EVALARG_EVALUATE, FALSE) == OK); in var_exists()
3862 clear_tv(&tv); in var_exists()
3908 typval_T tv; in var_redir_start() local
3950 tv.v_type = VAR_STRING; in var_redir_start()
3951 tv.vval.v_string = (char_u *)""; in var_redir_start()
3953 set_var_lval(redir_lval, redir_endp, &tv, TRUE, in var_redir_start()
3956 set_var_lval(redir_lval, redir_endp, &tv, TRUE, in var_redir_start()
4007 typval_T tv; in var_redir_stop() local
4021 tv.v_type = VAR_STRING; in var_redir_stop()
4022 tv.vval.v_string = redir_ga.ga_data; in var_redir_stop()
4028 set_var_lval(redir_lval, redir_endp, &tv, FALSE, 0, in var_redir_stop()
4378 put_callback(callback_T *cb, typval_T *tv) in put_callback() argument
4382 tv->v_type = VAR_PARTIAL; in put_callback()
4383 tv->vval.v_partial = cb->cb_partial; in put_callback()
4384 ++tv->vval.v_partial->pt_refcount; in put_callback()
4388 tv->v_type = VAR_FUNC; in put_callback()
4389 tv->vval.v_string = vim_strsave(cb->cb_name); in put_callback()