Data Structures | Macros | Enumerations | Functions | Variables
eval.c File Reference
#include <math.h>
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/change.h"
#include "nvim/channel.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/edit.h"
#include "nvim/eval/userfunc.h"
#include "nvim/eval.h"
#include "nvim/eval/encode.h"
#include "nvim/eval/executor.h"
#include "nvim/eval/gc.h"
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/ex_session.h"
#include "nvim/fileio.h"
#include "nvim/getchar.h"
#include "nvim/lua/executor.h"
#include "nvim/mark.h"
#include "nvim/memline.h"
#include "nvim/misc1.h"
#include "nvim/move.h"
#include "nvim/ops.h"
#include "nvim/option.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
#include "nvim/os/shell.h"
#include "nvim/path.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
#include "nvim/screen.h"
#include "nvim/search.h"
#include "nvim/sign.h"
#include "nvim/syntax.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/version.h"
#include "nvim/window.h"

Data Structures

struct  scriptvar_T
 
struct  forinfo_T
 
struct  vimvar
 

Macros

#define DICT_MAXNEST   100
 
#define globvarht   globvardict.dv_hashtab
 g: value More...
 
#define SCRIPT_SV(id)   (((scriptvar_T **)ga_scripts.ga_data)[(id) - 1])
 
#define SCRIPT_VARS(id)   (SCRIPT_SV(id)->sv_dict.dv_hashtab)
 
#define VV_COMPAT   1
 
#define VV_RO   2
 
#define VV_RO_SBX   4
 
#define VV(idx, name, type, flags)
 
#define vv_type   vv_di.di_tv.v_type
 
#define vv_nr   vv_di.di_tv.vval.v_number
 
#define vv_bool   vv_di.di_tv.vval.v_bool
 
#define vv_special   vv_di.di_tv.vval.v_special
 
#define vv_float   vv_di.di_tv.vval.v_float
 
#define vv_str   vv_di.di_tv.vval.v_string
 
#define vv_list   vv_di.di_tv.vval.v_list
 
#define vv_dict   vv_di.di_tv.vval.v_dict
 
#define vv_partial   vv_di.di_tv.vval.v_partial
 
#define vv_tv   vv_di.di_tv
 
#define vimvarht   vimvardict.dv_hashtab
 v: hashtab More...
 
#define ABORTING(func)   abort = abort || func
 

Enumerations

enum  exptype_T {
  TYPE_UNKNOWN = 0, TYPE_EQUAL, TYPE_NEQUAL, TYPE_GREATER,
  TYPE_GEQUAL, TYPE_SMALLER, TYPE_SEQUAL, TYPE_MATCH,
  TYPE_NOMATCH
}
 

Functions

varnumber_T num_divide (varnumber_T n1, varnumber_T n2) FUNC_ATTR_CONST FUNC_ATTR_WARN_UNUSED_RESULT
 
varnumber_T num_modulus (varnumber_T n1, varnumber_T n2) FUNC_ATTR_CONST FUNC_ATTR_WARN_UNUSED_RESULT
 
void eval_init (void)
 
void set_internal_string_var (char_u *name, char_u *value)
 
int var_redir_start (char_u *name, int append)
 
void var_redir_str (char_u *value, int value_len)
 
void var_redir_stop (void)
 
int eval_charconvert (const char *const enc_from, const char *const enc_to, const char *const fname_from, const char *const fname_to)
 
int eval_printexpr (const char *const fname, const char *const args)
 
void eval_diff (const char *const origfile, const char *const newfile, const char *const outfile)
 
void eval_patch (const char *const origfile, const char *const difffile, const char *const outfile)
 
int eval_to_bool (char_u *arg, bool *error, char_u **nextcmd, int skip)
 
 if (ret==FAIL)
 
int eval_expr_typval (const typval_T *expr, typval_T *argv, int argc, typval_T *rettv) FUNC_ATTR_NONNULL_ARG(1
 
int if (expr->v_type==VAR_FUNC)
 
 if (s==NULL)
 
 if (eval1_emsg(&s, rettv, true)==FAIL)
 
 emsgf (_(e_invexpr2), s)
 
bool eval_expr_to_bool (const typval_T *expr, bool *error) FUNC_ATTR_NONNULL_ARG(1
 
bool if (eval_expr_typval(expr,&argv, 0,&rettv)==FAIL)
 
char * eval_to_string_skip (const char *arg, const char **nextcmd, const bool skip) FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_WARN_UNUSED_RESULT
 
int skip_expr (char_u **pp)
 
char_ueval_to_string (char_u *arg, char_u **nextcmd, int convert)
 
char_ueval_to_string_safe (char_u *arg, char_u **nextcmd, int use_sandbox)
 
varnumber_T eval_to_number (char_u *expr)
 
void prepare_vimvar (int idx, typval_T *save_tv)
 
void restore_vimvar (int idx, typval_T *save_tv)
 
void find_win_for_curbuf (void)
 If there is a window for "curbuf", make it the current window. More...
 
list_Teval_spell_expr (char_u *badword, char_u *expr)
 
int get_spellword (list_T *const list, const char **ret_word)
 
int call_vim_function (const char_u *func, int argc, typval_T *argv, typval_T *rettv) FUNC_ATTR_NONNULL_ALL
 
varnumber_T call_func_retnr (const char_u *func, int argc, typval_T *argv) FUNC_ATTR_NONNULL_ALL
 
char * call_func_retstr (const char *const func, int argc, typval_T *argv) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_MALLOC
 
voidcall_func_retlist (const char_u *func, int argc, typval_T *argv) FUNC_ATTR_NONNULL_ALL
 
void prof_child_enter (proftime_T *tm)
 
void prof_child_exit (proftime_T *tm)
 
int eval_foldexpr (char_u *arg, int *cp)
 
void ex_const (exarg_T *eap)
 
void ex_let (exarg_T *eap)
 
void list_hashtable_vars (hashtab_T *ht, const char *prefix, int empty, int *first)
 
 if (len==0)
 
char_uget_lval (char_u *const name, typval_T *const rettv, lval_T *const lp, const bool unlet, const bool skip, const int flags, const int fne_flags) FUNC_ATTR_NONNULL_ARG(1
 
 memset (lp, 0, sizeof(lval_T))
 
 if (skip)
 
 if (expr_start!=NULL)
 
 if ((*p!= '['&&*p!= '.')||lp->ll_name==NULL)
 
 if (v==NULL &&!quiet)
 
whilep (*p== '.'&&lp->ll_tv->v_type==VAR_DICT)
 
void clear_lval (lval_T *lp)
 
voideval_for_line (const char_u *arg, bool *errp, char_u **nextcmdp, int skip)
 
bool next_for_item (void *fi_void, char_u *arg)
 
void free_for_info (void *fi_void)
 
void set_context_for_expression (expand_T *xp, char_u *arg, cmdidx_T cmdidx)
 
void ex_unlet (exarg_T *eap)
 
void ex_lockvar (exarg_T *eap)
 
int do_unlet (const char *const name, const size_t name_len, const int forceit) FUNC_ATTR_NONNULL_ALL
 
void del_menutrans_vars (void)
 
char_uget_user_var_name (expand_T *xp, int idx)
 
int eval0 (char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate)
 
int eval1 (char_u **arg, typval_T *rettv, int evaluate)
 
int get_option_tv (const char **const arg, typval_T *const rettv, const bool evaluate) FUNC_ATTR_NONNULL_ARG(1)
 
char_upartial_name (partial_T *pt)
 
void partial_unref (partial_T *pt)
 
bool func_equal (typval_T *tv1, typval_T *tv2, bool ic)
 
int get_copyID (void)
 
bool garbage_collect (bool testing)
 
bool set_ref_in_ht (hashtab_T *ht, int copyID, list_stack_T **list_stack) FUNC_ATTR_WARN_UNUSED_RESULT
 
bool set_ref_in_list (list_T *l, int copyID, ht_stack_T **ht_stack) FUNC_ATTR_WARN_UNUSED_RESULT
 
bool set_ref_in_item (typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack) FUNC_ATTR_WARN_UNUSED_RESULT
 
size_t string2float (const char *const text, float_T *const ret_value) FUNC_ATTR_NONNULL_ALL
 
void get_arglist_as_rettv (aentry_T *arglist, int argcount, typval_T *rettv)
 Get the argument list for a given window. More...
 
void prepare_assert_error (garray_T *gap)
 
void fill_assert_error (garray_T *gap, typval_T *opt_msg_tv, char_u *exp_str, typval_T *exp_tv, typval_T *got_tv, assert_type_T atype)
 
void assert_error (garray_T *gap)
 
int assert_equal_common (typval_T *argvars, assert_type_T atype) FUNC_ATTR_NONNULL_ALL
 
int assert_equalfile (typval_T *argvars) FUNC_ATTR_NONNULL_ALL
 
int assert_inrange (typval_T *argvars) FUNC_ATTR_NONNULL_ALL
 
int assert_bool (typval_T *argvars, bool is_true) FUNC_ATTR_NONNULL_ALL
 
int assert_exception (typval_T *argvars) FUNC_ATTR_NONNULL_ALL
 
int assert_fails (typval_T *argvars) FUNC_ATTR_NONNULL_ALL
 
int assert_match_common (typval_T *argvars, assert_type_T atype) FUNC_ATTR_NONNULL_ALL
 
win_Tfind_win_by_nr_or_id (typval_T *vp)
 
void filter_map (typval_T *argvars, typval_T *rettv, int map)
 
 tv_copy (tv,&vimvars[VV_VAL].vv_tv)
 
 if (eval_expr_typval(expr, argv, 2,&rettv)==FAIL)
 
 if (map)
 
 if (error)
 
void common_function (typval_T *argvars, typval_T *rettv, bool is_funcref, FunPtr fptr)
 
dict_Tget_buffer_info (buf_T *buf)
 Returns buffer options, variables and other attributes in a dictionary. More...
 
linenr_T tv_get_lnum_buf (const typval_T *const tv, const buf_T *const buf) FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_WARN_UNUSED_RESULT
 
void get_qf_loc_list (int is_qf, win_T *wp, typval_T *what_arg, typval_T *rettv)
 
dict_Tget_tabpage_info (tabpage_T *tp, int tp_idx)
 
dict_Tget_win_info (win_T *wp, int16_t tpnr, int16_t winnr)
 Returns information about a window as a dictionary. More...
 
win_Tfind_win_by_nr (typval_T *vp, tabpage_T *tp)
 
win_Tfind_tabwin (typval_T *wvp, typval_T *tvp)
 Find window specified by "wvp" in tabpage "tvp". More...
 
void getwinvar (typval_T *argvars, typval_T *rettv, int off)
 
void get_user_input (const typval_T *const argvars, typval_T *const rettv, const bool inputdialog, const bool secret) FUNC_ATTR_NONNULL_ALL
 
void dict_list (typval_T *const tv, typval_T *const rettv, const DictListType what)
 
char ** tv_to_argv (typval_T *cmd_tv, const char **cmd, bool *executable)
 
void mapblock_fill_dict (dict_T *const dict, const mapblock_T *const mp, long buffer_value, bool compatible) FUNC_ATTR_NONNULL_ALL
 
int matchadd_dict_arg (typval_T *tv, const char **conceal_char, win_T **win)
 
void return_register (int regname, typval_T *rettv)
 
void screenchar_adjust_grid (ScreenGrid **grid, int *row, int *col)
 
void set_buffer_lines (buf_T *buf, linenr_T lnum_arg, bool append, const typval_T *lines, typval_T *rettv) FUNC_ATTR_NONNULL_ARG(4
 Set line or list of lines in buffer "buf". More...
 
 if (buf==NULL||(!is_curbuf &&buf->b_ml.ml_mfp==NULL)||lnum< 1)
 
 if (!is_curbuf)
 
 if (append)
 
 if (lines->v_type==VAR_LIST)
 
 for (;;)
 
 if (added > 0)
 
void setwinvar (typval_T *argvars, typval_T *rettv, int off)
 
void get_xdg_var_list (const XDGVarType xdg, typval_T *rettv) FUNC_ATTR_NONNULL_ALL
 "stdpath()" helper for list results More...
 
void get_system_output_as_rettv (typval_T *argvars, typval_T *rettv, bool retlist)
 
bool callback_from_typval (Callback *const callback, typval_T *const arg) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
 
bool callback_call (Callback *const callback, const int argcount_in, typval_T *const argvars_in, typval_T *const rettv) FUNC_ATTR_NONNULL_ALL
 
timer_Tfind_timer_by_nr (varnumber_T xx)
 
void add_timer_info (typval_T *rettv, timer_T *timer)
 
void add_timer_info_all (typval_T *rettv)
 
void timer_due_cb (TimeWatcher *tw, void *data)
 
uint64_t timer_start (const long timeout, const int repeat_count, const Callback *const callback)
 
void timer_stop (timer_T *timer)
 
void timer_stop_all (void)
 
void timer_teardown (void)
 
bool write_list (FileDescriptor *const fp, const list_T *const list, const bool binary) FUNC_ATTR_NONNULL_ARG(1)
 
char * save_tv_as_string (typval_T *tv, ptrdiff_t *const len, bool endnl) FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_ALL
 
pos_Tvar2fpos (const typval_T *const tv, const int dollar_lnum, int *const ret_fnum) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
 
int list2fpos (typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp)
 
int get_id_len (const char **const arg)
 
int get_name_len (const char **const arg, char **alias, int evaluate, int verbose)
 
const char_ufind_name_end (const char_u *arg, const char_u **expr_start, const char_u **expr_end, int flags)
 
int eval_isnamec (int c)
 
int eval_isnamec1 (int c)
 
varnumber_T get_vim_var_nr (int idx) FUNC_ATTR_PURE
 
char_uget_vim_var_str (int idx) FUNC_ATTR_PURE FUNC_ATTR_NONNULL_RET
 
list_Tget_vim_var_list (int idx) FUNC_ATTR_PURE
 
dict_Tget_vim_var_dict (int idx) FUNC_ATTR_PURE
 
void set_vim_var_char (int c)
 
void set_vcount (long count, long count1, int set_prevcount)
 
void set_vim_var_nr (const VimVarIndex idx, const varnumber_T val)
 
void set_vim_var_bool (const VimVarIndex idx, const BoolVarValue val)
 
void set_vim_var_special (const VimVarIndex idx, const SpecialVarValue val)
 
void set_vim_var_string (const VimVarIndex idx, const char *const val, const ptrdiff_t len)
 
void set_vim_var_list (const VimVarIndex idx, list_T *const val)
 
void set_vim_var_dict (const VimVarIndex idx, dict_T *const val)
 
void set_argv_var (char **argv, int argc)
 Set the v:argv list. More...
 
void set_reg_var (int c)
 
char_uv_exception (char_u *oldval)
 
char_uv_throwpoint (char_u *oldval)
 
char_uset_cmdarg (exarg_T *eap, char_u *oldarg)
 
int get_var_tv (const char *name, int len, typval_T *rettv, dictitem_T **dip, int verbose, int no_autoload)
 
bool is_luafunc (partial_T *partial)
 check if special v:lua value for calling lua functions More...
 
int check_luafunc_name (const char *str, bool paren)
 check the function name after "v:lua." More...
 
int handle_subscript (const char **const arg, typval_T *rettv, int evaluate, int verbose)
 
void set_selfdict (typval_T *const rettv, dict_T *const selfdict)
 
dictitem_Tfind_var (const char *const name, const size_t name_len, hashtab_T **htp, int no_autoload)
 
dictitem_Tfind_var_in_ht (hashtab_T *const ht, int htname, const char *const varname, const size_t varname_len, int no_autoload) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
 
hashtab_Tfind_var_ht (const char *name, const size_t name_len, const char **varname)
 
char_uget_var_value (const char *const name)
 
void new_script_vars (scid_T id)
 
void init_var_dict (dict_T *dict, ScopeDictDictItem *dict_var, int scope)
 
void unref_var_dict (dict_T *dict)
 
void vars_clear (hashtab_T *ht)
 
void vars_clear_ext (hashtab_T *ht, int free_val)
 
void set_var (const char *name, const size_t name_len, typval_T *const tv, const bool copy) FUNC_ATTR_NONNULL_ALL
 
bool var_check_ro (const int flags, const char *name, size_t name_len) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
 
bool var_check_fixed (const int flags, const char *name, size_t name_len) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
 
bool var_check_func_name (const char *const name, const bool new_var) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
 
bool valid_varname (const char *varname) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
 
int var_item_copy (const vimconv_T *const conv, typval_T *const from, typval_T *const to, const bool deep, const int copyID) FUNC_ATTR_NONNULL_ARG(2
 
 if (recurse >=DICT_MAXNEST)
 
 switch (from->v_type)
 
void ex_echo (exarg_T *eap)
 
void ex_echohl (exarg_T *eap)
 
void ex_execute (exarg_T *eap)
 
void func_do_profile (ufunc_T *fp)
 Start profiling function "fp". More...
 
void func_dump_profile (FILE *fd)
 
char * autoload_name (const char *const name, const size_t name_len) FUNC_ATTR_MALLOC FUNC_ATTR_WARN_UNUSED_RESULT
 
bool script_autoload (const char *const name, const size_t name_len, const bool reload)
 
void func_line_start (void *cookie)
 
void func_line_exec (void *cookie)
 
void func_line_end (void *cookie)
 
const voidvar_shada_iter (const void *const iter, const char **const name, typval_T *rettv, var_flavour_T flavour) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ARG(2
 
 if (iter==NULL)
 
tv_copyTV_DICT_HI2DI (hi) ->di_tv, rettv
 
 while ((size_t)(++hi-hifirst)< hinum)
 
void var_set_global (const char *const name, typval_T vartv)
 
int store_session_globals (FILE *fd)
 
void last_set_msg (sctx_T script_ctx)
 
void option_last_set_msg (LastSet last_set)
 
void reset_v_option_vars (void)
 
int modify_fname (char_u *src, bool tilde_file, size_t *usedlen, char_u **fnamep, char_u **bufp, size_t *fnamelen)
 
char_udo_string_sub (char_u *str, char_u *pat, char_u *sub, typval_T *expr, char_u *flags)
 
bool common_job_callbacks (dict_T *vopts, CallbackReader *on_stdout, CallbackReader *on_stderr, Callback *on_exit)
 
Channelfind_job (uint64_t id, bool show_error)
 
void script_host_eval (char *name, typval_T *argvars, typval_T *rettv)
 
typval_T eval_call_provider (char *provider, char *method, list_T *arguments)
 
bool eval_has_provider (const char *feat)
 Checks if provider for feature feat is enabled. More...
 
void eval_fmt_source_name_line (char *buf, size_t bufsize)
 Writes "<sourcing_name>:<sourcing_lnum>" to buf[bufsize]. More...
 
void ex_checkhealth (exarg_T *eap)
 ":checkhealth [plugins]" More...
 
void invoke_prompt_callback (void)
 
bool invoke_prompt_interrupt (void)
 

Variables

bool * eval_lavars_used = NULL
 Used for checking if local variables or arguments used in a lambda. More...
 
const list_Teval_msgpack_type_lists []
 Array mapping values from MessagePackType to corresponding list pointers. More...
 
static int const int did_emsg_before = did_emsg
 
const int called_emsg_before = called_emsg
 
const int ret = eval1(arg, rettv, evaluate)
 
 else
 
char_us = (char_u *)tv_get_string_buf_chk(expr, buf)
 
return FAIL
 
return OK
 
const bool res = (tv_get_number_chk(&rettv, error) != 0)
 
tv_clearrettv
 
static char_u FUNC_ATTR_WARN_UNUSED_RESULT
 
int len = get_env_len((const char_u **)&arg)
 
int opt_flags
 
char_utofree = NULL
 
if arg
 
char * name = (char *)arg
 
return arg_end
 
char_u typval_T var1
 
typval_T var2
 
int empty1 = FALSE
 
listitem_Tni
 
hashtab_Tht
 
int quiet = flags & GLV_QUIET
 
char_uexpr_start
 
char_uexpr_end
 
char_up
 
lp ll_name_len = (size_t)((const char *)p - lp->ll_name)
 
 v
 
lp ll_tv = &v->di_tv
 
var1 v_type = VAR_UNKNOWN
 
static int typval_T argv [3]
 
int retval = FAIL
 
remp = (tv_get_number_chk(&rettv, &error) == 0)
 
theend __pad0__
 
void const char * line = NULL
 
list_Tl = NULL
 
listitem_Tli = NULL
 
long added = 0
 
linenr_T append_lnum
 
buf_Tcurbuf_save = NULL
 
win_Tcurwin_save = NULL
 
const bool is_curbuf = buf == curbuf
 
 recurse
 
const void const hashitem_Thifirst = globvarht.ht_array
 
const size_t hinum = (size_t) globvarht.ht_mask + 1
 
return NULL
 

Macro Definition Documentation

#define ABORTING (   func)    abort = abort || func
#define DICT_MAXNEST   100
#define globvarht   globvardict.dv_hashtab

g: value

#define SCRIPT_SV (   id)    (((scriptvar_T **)ga_scripts.ga_data)[(id) - 1])
#define SCRIPT_VARS (   id)    (SCRIPT_SV(id)->sv_dict.dv_hashtab)
#define vimvarht   vimvardict.dv_hashtab

v: hashtab

#define VV (   idx,
  name,
  type,
  flags 
)
Value:
[idx] = { \
.vv_name = name, \
.vv_di = { \
.di_tv = { .v_type = type }, \
.di_flags = 0, \
.di_key = { 0 }, \
}, \
.vv_flags = flags, \
}
char * name
Definition: eval.c:1784
err type
Definition: helpers.c:1473
#define vv_bool   vv_di.di_tv.vval.v_bool
#define VV_COMPAT   1
#define vv_dict   vv_di.di_tv.vval.v_dict
#define vv_float   vv_di.di_tv.vval.v_float
#define vv_list   vv_di.di_tv.vval.v_list
#define vv_nr   vv_di.di_tv.vval.v_number
#define vv_partial   vv_di.di_tv.vval.v_partial
#define VV_RO   2
#define VV_RO_SBX   4
#define vv_special   vv_di.di_tv.vval.v_special
#define vv_str   vv_di.di_tv.vval.v_string
#define vv_tv   vv_di.di_tv
#define vv_type   vv_di.di_tv.v_type

Enumeration Type Documentation

enum exptype_T
Enumerator
TYPE_UNKNOWN 
TYPE_EQUAL 
TYPE_NEQUAL 
TYPE_GREATER 
TYPE_GEQUAL 
TYPE_SMALLER 
TYPE_SEQUAL 
TYPE_MATCH 
TYPE_NOMATCH 

Function Documentation

void add_timer_info ( typval_T rettv,
timer_T timer 
)
void add_timer_info_all ( typval_T rettv)
int assert_bool ( typval_T argvars,
bool  is_true 
)
int assert_equal_common ( typval_T argvars,
assert_type_T  atype 
)
int assert_equalfile ( typval_T argvars)
void assert_error ( garray_T gap)
int assert_exception ( typval_T argvars)
int assert_fails ( typval_T argvars)
int assert_inrange ( typval_T argvars)
int assert_match_common ( typval_T argvars,
assert_type_T  atype 
)
char* autoload_name ( const char *const  name,
const size_t  name_len 
)

Return the autoload script name for a function or variable name Caller must make sure that "name" contains AUTOLOAD_CHAR.

Parameters
[in]nameVariable/function name.
[in]name_lenName length.
Returns
[allocated] autoload script name.
void* call_func_retlist ( const char_u func,
int  argc,
typval_T argv 
)

Call Vim script function and return the result as a List

Parameters
[in]funcFunction name.
[in]argcNumber of arguments.
[in]argvArray with typval_T arguments.
Returns
[allocated] NULL when calling function fails or return tv is not a List, allocated List otherwise.
varnumber_T call_func_retnr ( const char_u func,
int  argc,
typval_T argv 
)

Call Vim script function and return the result as a number

Parameters
[in]funcFunction name.
[in]argcNumber of arguments.
[in]argvArray with typval_T arguments.
Returns
-1 when calling function fails, result of function otherwise.
char* call_func_retstr ( const char *const  func,
int  argc,
typval_T argv 
)

Call Vim script function and return the result as a string

Parameters
[in]funcFunction name.
[in]argcNumber of arguments.
[in]argvArray with typval_T arguments.
Returns
[allocated] NULL when calling function fails, allocated string otherwise.
int call_vim_function ( const char_u func,
int  argc,
typval_T argv,
typval_T rettv 
)
bool callback_call ( Callback *const  callback,
const int  argcount_in,
typval_T *const  argvars_in,
typval_T *const  rettv 
)
bool callback_from_typval ( Callback *const  callback,
typval_T *const  arg 
)
int check_luafunc_name ( const char *  str,
bool  paren 
)

check the function name after "v:lua."

void clear_lval ( lval_T lp)
void common_function ( typval_T argvars,
typval_T rettv,
bool  is_funcref,
FunPtr  fptr 
)
bool common_job_callbacks ( dict_T vopts,
CallbackReader on_stdout,
CallbackReader on_stderr,
Callback on_exit 
)

common code for getting job callbacks for jobstart, termopen and rpcstart

Returns
true/false on success/failure.
void del_menutrans_vars ( void  )
void dict_list ( typval_T *const  tv,
typval_T *const  rettv,
const DictListType  what 
)

Turn a dictionary into a list

Parameters
[in]tvDictionary to convert. Is checked for actually being a dictionary, will give an error if not.
[out]rettvLocation where result will be saved.
[in]whatWhat to save in rettv.
char_u* do_string_sub ( char_u str,
char_u pat,
char_u sub,
typval_T expr,
char_u flags 
)

Perform a substitution on "str" with pattern "pat" and substitute "sub". When "sub" is NULL "expr" is used, must be a VAR_FUNC or VAR_PARTIAL. "flags" can be "g" to do a global substitute. Returns an allocated string, NULL for error.

int do_unlet ( const char *const  name,
const size_t  name_len,
const int  forceit 
)

unlet a variable

Parameters
[in]nameVariable name to unlet.
[in]name_lenVariable name length.
[in]fonceitIf true, do not complain if variable doesn’t exist.
Returns
OK if it existed, FAIL otherwise.
emsgf ( _(e_invexpr2)  ,
s   
)
int eval0 ( char_u arg,
typval_T rettv,
char_u **  nextcmd,
int  evaluate 
)
int eval1 ( char_u **  arg,
typval_T rettv,
int  evaluate 
)
typval_T eval_call_provider ( char *  provider,
char *  method,
list_T arguments 
)
int eval_charconvert ( const char *const  enc_from,
const char *const  enc_to,
const char *const  fname_from,
const char *const  fname_to 
)
void eval_diff ( const char *const  origfile,
const char *const  newfile,
const char *const  outfile 
)
bool eval_expr_to_bool ( const typval_T expr,
bool *  error 
)

Like eval_to_bool() but using a typval_T instead of a string. Works for string, funcref and partial.

int eval_expr_typval ( const typval_T expr,
typval_T argv,
int  argc,
typval_T rettv 
)
void eval_fmt_source_name_line ( char *  buf,
size_t  bufsize 
)

Writes "<sourcing_name>:<sourcing_lnum>" to buf[bufsize].

int eval_foldexpr ( char_u arg,
int *  cp 
)
void* eval_for_line ( const char_u arg,
bool *  errp,
char_u **  nextcmdp,
int  skip 
)
bool eval_has_provider ( const char *  feat)

Checks if provider for feature feat is enabled.

void eval_init ( void  )
int eval_isnamec ( int  c)
int eval_isnamec1 ( int  c)
void eval_patch ( const char *const  origfile,
const char *const  difffile,
const char *const  outfile 
)
int eval_printexpr ( const char *const  fname,
const char *const  args 
)
list_T* eval_spell_expr ( char_u badword,
char_u expr 
)
int eval_to_bool ( char_u arg,
bool *  error,
char_u **  nextcmd,
int  skip 
)
varnumber_T eval_to_number ( char_u expr)
char_u* eval_to_string ( char_u arg,
char_u **  nextcmd,
int  convert 
)
char_u* eval_to_string_safe ( char_u arg,
char_u **  nextcmd,
int  use_sandbox 
)
char* eval_to_string_skip ( const char *  arg,
const char **  nextcmd,
const bool  skip 
)

Top level evaluation function, returning a string

Parameters
[in]argString to evaluate.
nextcmdPointer to the start of the next Ex command.
[in]skipIf true, only do parsing to nextcmd without reporting errors or actually evaluating anything.
Returns
[allocated] string result of evaluation or NULL in case of error or when skipping.
void ex_checkhealth ( exarg_T eap)

":checkhealth [plugins]"

void ex_const ( exarg_T eap)
void ex_echo ( exarg_T eap)
void ex_echohl ( exarg_T eap)
void ex_execute ( exarg_T eap)
void ex_let ( exarg_T eap)
void ex_lockvar ( exarg_T eap)
void ex_unlet ( exarg_T eap)
void fill_assert_error ( garray_T gap,
typval_T opt_msg_tv,
char_u exp_str,
typval_T exp_tv,
typval_T got_tv,
assert_type_T  atype 
)
void filter_map ( typval_T argvars,
typval_T rettv,
int  map 
)
Channel* find_job ( uint64_t  id,
bool  show_error 
)
const char_u* find_name_end ( const char_u arg,
const char_u **  expr_start,
const char_u **  expr_end,
int  flags 
)
win_T* find_tabwin ( typval_T wvp,
typval_T tvp 
)

Find window specified by "wvp" in tabpage "tvp".

timer_T* find_timer_by_nr ( varnumber_T  xx)
dictitem_T* find_var ( const char *const  name,
const size_t  name_len,
hashtab_T **  htp,
int  no_autoload 
)
hashtab_T* find_var_ht ( const char *  name,
const size_t  name_len,
const char **  varname 
)

Find the hashtable used for a variable

Parameters
[in]nameVariable name, possibly with scope prefix.
[in]name_lenVariable name length.
[out]varnameWill be set to the start of the name without scope prefix.
Returns
Scope hashtab, NULL if name is not valid.
dictitem_T* find_var_in_ht ( hashtab_T *const  ht,
int  htname,
const char *const  varname,
const size_t  varname_len,
int  no_autoload 
)

Find variable in hashtab. When "varname" is empty returns curwin/curtab/etc vars dictionary.

Parameters
[in]htHashtab to find variable in.
[in]htnameHashtab name (first character).
[in]varnameVariable name.
[in]varname_lenVariable name length.
[in]no_autoloadIf true then autoload scripts will not be sourced if autoload variable was not found.
Returns
pointer to the dictionary item with the found variable or NULL if it was not found.
win_T* find_win_by_nr ( typval_T vp,
tabpage_T tp 
)
win_T* find_win_by_nr_or_id ( typval_T vp)

Find a window: When using a Window ID in any tab page, when using a number in the current tab page.

void find_win_for_curbuf ( void  )

If there is a window for "curbuf", make it the current window.

for ( ;;  )
void free_for_info ( void fi_void)
void func_do_profile ( ufunc_T fp)

Start profiling function "fp".

void func_dump_profile ( FILE *  fd)
bool func_equal ( typval_T tv1,
typval_T tv2,
bool  ic 
)
void func_line_end ( void cookie)
void func_line_exec ( void cookie)
void func_line_start ( void cookie)
bool garbage_collect ( bool  testing)

Do garbage collection for lists and dicts.

Parameters
testingtrue if called from test_garbagecollect_now().
Returns
true if some memory was freed.
void get_arglist_as_rettv ( aentry_T arglist,
int  argcount,
typval_T rettv 
)

Get the argument list for a given window.

dict_T* get_buffer_info ( buf_T buf)

Returns buffer options, variables and other attributes in a dictionary.

int get_copyID ( void  )

Get next (unique) copy ID

Used for traversing nested structures e.g. when serializing them or garbage collecting.

int get_id_len ( const char **const  arg)
char_u* get_lval ( char_u *const  name,
typval_T *const  rettv,
lval_T *const  lp,
const bool  unlet,
const bool  skip,
const int  flags,
const int  fne_flags 
)

Get an lvalue

Lvalue may be

  • variable: "name", "na{me}"
  • dictionary item: "dict.key", "dict['key']"
  • list item: "list[expr]"
  • list slice: "list[expr:expr]"

Indexing only works if trying to use it with an existing List or Dictionary.

Parameters
[in]nameName to parse.
rettvPointer to the value to be assigned or NULL.
[out]lpLvalue definition. When evaluation errors occur ->ll_name is NULL.
[in]unletTrue if using :unlet. This results in slightly different behaviour when something is wrong; must end in space or cmd separator.
[in]skipTrue when skipping.
[in]flags
See also
GetLvalFlags.
Parameters
[in]fne_flagsFlags for find_name_end().
Returns
A pointer to just after the name, including indexes. Returns NULL for a parsing error, but it is still needed to free items in lp.
int get_name_len ( const char **const  arg,
char **  alias,
int  evaluate,
int  verbose 
)
int get_option_tv ( const char **const  arg,
typval_T *const  rettv,
const bool  evaluate 
)

Get an option value

Parameters
[in,out]argPoints to the '&' or '+' before the option name. Is advanced to the character after the option name.
[out]rettvLocation where result is saved.
[in]evaluateIf not true, rettv is not populated.
Returns
OK or FAIL.
void get_qf_loc_list ( int  is_qf,
win_T wp,
typval_T what_arg,
typval_T rettv 
)
int get_spellword ( list_T *const  list,
const char **  ret_word 
)

Get spell word from an entry from spellsuggest=expr:

Entry in question is supposed to be a list (to be checked by the caller) with two items: a word and a score represented as an unsigned number (whether it actually is unsigned is not checked).

Used to get the good word and score from the eval_spell_expr() result.

Parameters
[in]listList to get values from.
[out]ret_wordSuggested word. Not initialized if return value is -1.
Returns
-1 in case of error, score otherwise.
void get_system_output_as_rettv ( typval_T argvars,
typval_T rettv,
bool  retlist 
)
dict_T* get_tabpage_info ( tabpage_T tp,
int  tp_idx 
)

Returns information (variables, options, etc.) about a tab page as a dictionary.

void get_user_input ( const typval_T *const  argvars,
typval_T *const  rettv,
const bool  inputdialog,
const bool  secret 
)
char_u* get_user_var_name ( expand_T xp,
int  idx 
)
int get_var_tv ( const char *  name,
int  len,
typval_T rettv,
dictitem_T **  dip,
int  verbose,
int  no_autoload 
)
char_u* get_var_value ( const char *const  name)
dict_T* get_vim_var_dict ( int  idx)

Get Dictionary v: variable value. Caller must take care of reference count when needed.

list_T* get_vim_var_list ( int  idx)
varnumber_T get_vim_var_nr ( int  idx)
char_u* get_vim_var_str ( int  idx)
dict_T* get_win_info ( win_T wp,
int16_t  tpnr,
int16_t  winnr 
)

Returns information about a window as a dictionary.

void get_xdg_var_list ( const XDGVarType  xdg,
typval_T rettv 
)

"stdpath()" helper for list results

void getwinvar ( typval_T argvars,
typval_T rettv,
int  off 
)
int handle_subscript ( const char **const  arg,
typval_T rettv,
int  evaluate,
int  verbose 
)

Handle expr[expr], expr[expr:expr] subscript and .name lookup. Also handle function call with Funcref variable: func(expr) Can all be combined: dict.func(expr)[idx]['func'](expr)

if ( ret  = FAIL)
else if ( expr->  v_type = VAR_FUNC)
if ( s  = NULL)
if ( eval1_emsg &,,  true = FAIL)
bool if ( eval_expr_typval(expr,&argv, 0,&rettv = FAIL)
if ( len  = = 0)
if ( skip  )
if ( expr_start!  = NULL)
if ( *!= '['&&*!= '.'p||lp->  ll_name = NULL)
if ( v  = NULL && !quiet)
if ( eval_expr_typval(expr, argv, 2,&rettv = FAIL)
if ( map  )
if ( error  )
if ( )
if ( is_curbuf)
if ( append  )
if ( lines->  v_type = VAR_LIST)
if ( added  ,
 
)
if ( recurse >=  DICT_MAXNEST)
if ( iter  = NULL)
void init_var_dict ( dict_T dict,
ScopeDictDictItem *  dict_var,
int  scope 
)
void invoke_prompt_callback ( void  )
bool invoke_prompt_interrupt ( void  )
bool is_luafunc ( partial_T partial)

check if special v:lua value for calling lua functions

void last_set_msg ( sctx_T  script_ctx)
int list2fpos ( typval_T arg,
pos_T posp,
int *  fnump,
colnr_T curswantp 
)
void list_hashtable_vars ( hashtab_T ht,
const char *  prefix,
int  empty,
int *  first 
)
void mapblock_fill_dict ( dict_T *const  dict,
const mapblock_T *const  mp,
long  buffer_value,
bool  compatible 
)

Fill a dictionary with all applicable maparg() like dictionaries

Parameters
dictThe dictionary to be filled
mpThe maphash that contains the mapping information
buffer_valueThe "buffer" value
compatibleTrue for compatible with old maparg() dict
int matchadd_dict_arg ( typval_T tv,
const char **  conceal_char,
win_T **  win 
)
memset ( lp  ,
,
sizeof(lval_T  
)
int modify_fname ( char_u src,
bool  tilde_file,
size_t *  usedlen,
char_u **  fnamep,
char_u **  bufp,
size_t *  fnamelen 
)
void new_script_vars ( scid_T  id)
bool next_for_item ( void fi_void,
char_u arg 
)
varnumber_T num_divide ( varnumber_T  n1,
varnumber_T  n2 
)
varnumber_T num_modulus ( varnumber_T  n1,
varnumber_T  n2 
)
void option_last_set_msg ( LastSet  last_set)

Displays where an option was last set.

Should only be invoked when 'verbose' is non-zero.

while* p ( p = = '.' && lp->ll_tv->v_type == VAR_DICT)
char_u* partial_name ( partial_T pt)
Returns
the function name of the partial.
void partial_unref ( partial_T pt)

Unreference a closure: decrement the reference count and free it when it becomes zero.

void prepare_assert_error ( garray_T gap)
void prepare_vimvar ( int  idx,
typval_T save_tv 
)
void prof_child_enter ( proftime_T tm)
void prof_child_exit ( proftime_T tm)
void reset_v_option_vars ( void  )
void restore_vimvar ( int  idx,
typval_T save_tv 
)
void return_register ( int  regname,
typval_T rettv 
)
char* save_tv_as_string ( typval_T tv,
ptrdiff_t *const  len,
bool  endnl 
)

Saves a typval_T as a string.

For lists or buffers, replaces NLs with NUL and separates items with NLs.

Parameters
[in]tvValue to store as a string.
[out]lenLength of the resulting string or -1 on error.
[in]endnlIf true, the output will end in a newline (if a list).
Returns
an allocated string if tv represents a VimL string, list, or number; NULL otherwise.
void screenchar_adjust_grid ( ScreenGrid **  grid,
int *  row,
int *  col 
)
bool script_autoload ( const char *const  name,
const size_t  name_len,
const bool  reload 
)

If name has a package name try autoloading the script for it

Parameters
[in]nameVariable/function name.
[in]name_lenName length.
[in]reloadIf true, load script again when already loaded.
Returns
true if a package was loaded.
void script_host_eval ( char *  name,
typval_T argvars,
typval_T rettv 
)
void set_argv_var ( char **  argv,
int  argc 
)

Set the v:argv list.

void set_buffer_lines ( buf_T buf,
linenr_T  lnum_arg,
bool  append,
const typval_T lines,
typval_T rettv 
)

Set line or list of lines in buffer "buf".

char_u* set_cmdarg ( exarg_T eap,
char_u oldarg 
)
void set_context_for_expression ( expand_T xp,
char_u arg,
cmdidx_T  cmdidx 
)
void set_internal_string_var ( char_u name,
char_u value 
)
bool set_ref_in_ht ( hashtab_T ht,
int  copyID,
list_stack_T **  list_stack 
)

Mark all lists and dicts referenced through hashtab "ht" with "copyID".

Parameters
htHashtab content will be marked.
copyIDNew mark for lists and dicts.
list_stackUsed to add lists to be marked. Can be NULL.
Returns
true if setting references failed somehow.
bool set_ref_in_item ( typval_T tv,
int  copyID,
ht_stack_T **  ht_stack,
list_stack_T **  list_stack 
)

Mark all lists and dicts referenced through typval "tv" with "copyID".

Parameters
tvTypval content will be marked.
copyIDNew mark for lists and dicts.
ht_stackUsed to add hashtabs to be marked. Can be NULL.
list_stackUsed to add lists to be marked. Can be NULL.
Returns
true if setting references failed somehow.
bool set_ref_in_list ( list_T l,
int  copyID,
ht_stack_T **  ht_stack 
)

Mark all lists and dicts referenced through list "l" with "copyID".

Parameters
lList content will be marked.
copyIDNew mark for lists and dicts.
ht_stackUsed to add hashtabs to be marked. Can be NULL.
Returns
true if setting references failed somehow.
void set_reg_var ( int  c)
void set_selfdict ( typval_T *const  rettv,
dict_T *const  selfdict 
)
void set_var ( const char *  name,
const size_t  name_len,
typval_T *const  tv,
const bool  copy 
)

Set variable to the given value

If the variable already exists, the value is updated. Otherwise the variable is created.

Parameters
[in]nameVariable name to set.
[in]name_lenLength of the variable name.
tvVariable value.
[in]copyTrue if value in tv is to be copied.
void set_vcount ( long  count,
long  count1,
int  set_prevcount 
)
void set_vim_var_bool ( const VimVarIndex  idx,
const BoolVarValue  val 
)

Set boolean v: {true, false} to the given value

Parameters
[in]idxIndex of variable to set.
[in]valValue to set to.
void set_vim_var_char ( int  c)
void set_vim_var_dict ( const VimVarIndex  idx,
dict_T *const  val 
)

Set Dictionary v: variable to the given dictionary

Parameters
[in]idxIndex of variable to set.
[in,out]valValue to set to. Reference count will be incremented. Also keys of the dictionary will be made read-only.
void set_vim_var_list ( const VimVarIndex  idx,
list_T *const  val 
)

Set list v: variable to the given list

Parameters
[in]idxIndex of variable to set.
[in,out]valValue to set to. Reference count will be incremented.
void set_vim_var_nr ( const VimVarIndex  idx,
const varnumber_T  val 
)

Set number v: variable to the given value

Parameters
[in]idxIndex of variable to set.
[in]valValue to set to.
void set_vim_var_special ( const VimVarIndex  idx,
const SpecialVarValue  val 
)

Set special v: variable to the given value

Parameters
[in]idxIndex of variable to set.
[in]valValue to set to.
void set_vim_var_string ( const VimVarIndex  idx,
const char *const  val,
const ptrdiff_t  len 
)

Set string v: variable to the given string

Parameters
[in]idxIndex of variable to set.
[in]valValue to set to. Will be copied.
[in]lenLegth of that value or -1 in which case strlen() will be used.
void setwinvar ( typval_T argvars,
typval_T rettv,
int  off 
)
int skip_expr ( char_u **  pp)
int store_session_globals ( FILE *  fd)
size_t string2float ( const char *const  text,
float_T *const  ret_value 
)

Convert the string to a floating point number

This uses strtod(). setlocale(LC_NUMERIC, "C") has been used earlier to make sure this always uses a decimal point.

Parameters
[in]textString to convert.
[out]ret_valueLocation where conversion result is saved.
Returns
Length of the text that was consumed.
switch ( from->  v_type)
void timer_due_cb ( TimeWatcher tw,
void data 
)
uint64_t timer_start ( const long  timeout,
const int  repeat_count,
const Callback *const  callback 
)
void timer_stop ( timer_T timer)
void timer_stop_all ( void  )
void timer_teardown ( void  )
tv_copy ( tv  ,
&vimvars.  vv_tv[VV_VAL] 
)
tv_copy& TV_DICT_HI2DI ( hi  ) -> di_tv, rettv
linenr_T tv_get_lnum_buf ( const typval_T *const  tv,
const buf_T *const  buf 
)

Get the line number from VimL object

Note
Unlike tv_get_lnum(), this one supports only "$" special string.
Parameters
[in]tvObject to get value from. Is expected to be a number or a special string "$".
[in]bufBuffer to take last line number from in case tv is "$". May be NULL, in this case "$" results in zero return.
Returns
Line number or 0 in case of error.
char** tv_to_argv ( typval_T cmd_tv,
const char **  cmd,
bool *  executable 
)

Builds a process argument vector from a VimL object (typval_T).

Parameters
[in]cmd_tvVimL object
[out]cmdReturns the command or executable name.
[out]executableReturns false if argv[0] is not executable.
Returns
Result of shell_build_argv() if cmd_tv is a String. Else, string values of cmd_tv copied to a (char **) list with argv[0] resolved to full path ($PATHEXT-resolved on Windows).
void unref_var_dict ( dict_T dict)
char_u* v_exception ( char_u oldval)
char_u* v_throwpoint ( char_u oldval)
bool valid_varname ( const char *  varname)

Check if a variable name is valid

Parameters
[in]varnameVariable name to check.
Returns
false when variable name is not valid, true when it is. Also gives an error message if appropriate.
pos_T* var2fpos ( const typval_T *const  tv,
const int  dollar_lnum,
int *const  ret_fnum 
)

Translate a VimL object into a position

Accepts VAR_LIST and VAR_STRING objects. Does not give an error for invalid type.

Parameters
[in]tvObject to translate.
[in]dollar_lnumTrue when "$" is last line.
[out]ret_fnumSet to fnum for marks.
Returns
Pointer to position or NULL in case of error (e.g. invalid type).
bool var_check_fixed ( const int  flags,
const char *  name,
size_t  name_len 
)

Check whether variable is fixed (DI_FLAGS_FIX)

Also gives an error message.

Parameters
[in]flagsdi_flags attribute value.
[in]nameVariable name, for use in error message.
[in]name_lenVariable name length. Use TV_TRANSLATE to translate variable name and compute the length. Use TV_CSTRING to compute the length with strlen() without translating.

Both #TV_… values are used for optimization purposes: variable name with its length is needed only in case of error, when no error occurs computing them is a waste of CPU resources. This especially applies to gettext.

Returns
True if variable is fixed, false otherwise.
bool var_check_func_name ( const char *const  name,
const bool  new_var 
)

Check if name is a valid name to assign funcref to

Parameters
[in]namePossible function/funcref name.
[in]new_varTrue if it is a name for a variable.
Returns
false in case of error, true in case of success. Also gives an error message if appropriate.
bool var_check_ro ( const int  flags,
const char *  name,
size_t  name_len 
)

Check whether variable is read-only (DI_FLAGS_RO, DI_FLAGS_RO_SBX)

Also gives an error message.

Parameters
[in]flagsdi_flags attribute value.
[in]nameVariable name, for use in error message.
[in]name_lenVariable name length. Use TV_TRANSLATE to translate variable name and compute the length. Use TV_CSTRING to compute the length with strlen() without translating.

Both #TV_… values are used for optimization purposes: variable name with its length is needed only in case of error, when no error occurs computing them is a waste of CPU resources. This especially applies to gettext.

Returns
True if variable is read-only: either always or in sandbox when sandbox is enabled, false otherwise.
int var_item_copy ( const vimconv_T *const  conv,
typval_T *const  from,
typval_T *const  to,
const bool  deep,
const int  copyID 
)

Make a copy of an item

Lists and Dictionaries are also copied.

Parameters
[in]convIf not NULL, convert all copied strings.
[in]fromValue to copy.
[out]toLocation where to copy to.
[in]deepIf true, use copy the container and all of the contained containers (nested).
[in]copyIDIf non-zero then when container is referenced more then once then copy of it that was already done is used. E.g. when copying list list = [list2, list2] (list[0] is list[1]) var_item_copy with zero copyID will emit a copy with (copy[0] isnot copy[1]), with non-zero it will emit a copy with (copy[0] is copy[1]) like in the original list. Not used when deep is false.
int var_redir_start ( char_u name,
int  append 
)
void var_redir_stop ( void  )
void var_redir_str ( char_u value,
int  value_len 
)
void var_set_global ( const char *const  name,
typval_T  vartv 
)
const void* var_shada_iter ( const void *const  iter,
const char **const  name,
typval_T rettv,
var_flavour_T  flavour 
)

Iterate over global variables

Warning
No modifications to global variable dictionary must be performed while iteration is in progress.
Parameters
[in]iterIterator. Pass NULL to start iteration.
[out]nameVariable name.
[out]rettvVariable value.
Returns
Pointer that needs to be passed to next var_shada_iter invocation or NULL to indicate that iteration is over.
void vars_clear ( hashtab_T ht)
void vars_clear_ext ( hashtab_T ht,
int  free_val 
)
while ( )
bool write_list ( FileDescriptor *const  fp,
const list_T *const  list,
const bool  binary 
)

Write "list" of strings to file "fd".

Parameters
fpFile to write to.
[in]listList to write.
[in]binaryWhether to write in binary mode.
Returns
true in case of success, false otherwise.

Variable Documentation

theend __pad0__
long added = 0
linenr_T append_lnum
if arg
Initial value:
{
if (is_const) {
EMSG(_("E996: Cannot lock an environment variable"));
return NULL;
}
arg++
#define _(x)
Definition: gettext.h:20
return NULL
Definition: eval.c:9784
if arg
Definition: eval.c:1777
#define EMSG(s)
Definition: message.h:40
return arg_end
argv[1]
Initial value:
{
Structure that holds an internal variable value.
Definition: typval.h:128
tv_clear & rettv
Definition: eval.c:784
const int called_emsg_before = called_emsg
buf_T* curbuf_save = NULL
win_T* curwin_save = NULL
int const int did_emsg_before = did_emsg
else
Initial value:
{
char buf[NUMBUFLEN]
char *const buf
Definition: encode.c:234
Definition: vim.h:27
int empty1 = FALSE
bool* eval_lavars_used = NULL

Used for checking if local variables or arguments used in a lambda.

const list_T* eval_msgpack_type_lists[]
Initial value:
= {
[kMPNil] = NULL,
[kMPMap] = NULL,
[kMPExt] = NULL,
}
Definition: eval.h:170
Definition: eval.h:171
Definition: eval.h:175
return NULL
Definition: eval.c:9784
Definition: eval.h:169
Definition: eval.h:172
Definition: eval.h:168
Definition: eval.h:167
Definition: eval.h:174
Definition: eval.h:173

Array mapping values from MessagePackType to corresponding list pointers.

char_u* expr_end
char_u* expr_start
return FAIL
char_u FUNC_ATTR_WARN_UNUSED_RESULT
Initial value:
{
return NULL
Definition: eval.c:9784
return arg_end
Definition: eval.c:1936
unsigned char char_u
Definition: types.h:11
const void const hashitem_T* hifirst = globvarht.ht_array
const size_t hinum = (size_t) globvarht.ht_mask + 1
hashtab_T* ht
const bool is_curbuf = buf == curbuf
list_T* l = NULL
len = get_env_len((const char_u **)&arg)
void const char* line = NULL
lp ll_name_len = (size_t)((const char *)p - lp->ll_name)
lp ll_tv = &v->di_tv
* name = (char *)arg
return NULL
return OK
int opt_flags
while p
Initial value:
(const char_u **)&expr_start,
(const char_u **)&expr_end,
fne_flags)
char_u * expr_end
Definition: eval.c:1989
char * name
Definition: eval.c:1784
unsigned char char_u
Definition: types.h:11
char_u * expr_start
Definition: eval.c:1988
const char_u * find_name_end(const char_u *arg, const char_u **expr_start, const char_u **expr_end, int flags)
Definition: eval.c:7841
int quiet = flags & GLV_QUIET
recurse
* remp = (tv_get_number_chk(&rettv, &error) == 0)
return ret = eval1(arg, rettv, evaluate)
tv_clear& rettv
return retval = FAIL
char_u* tofree = NULL
v
Initial value:
= find_var(lp->ll_name, lp->ll_name_len,
(flags & GLV_READ_ONLY) ? NULL : &ht,
flags & GLV_NO_AUTOLOAD)
Definition: eval.h:197
Do not use script autoloading.
Definition: eval.h:196
dictitem_T * find_var(const char *const name, const size_t name_len, hashtab_T **htp, int no_autoload)
Definition: eval.c:8489
return NULL
Definition: eval.c:9784
hashtab_T * ht
Definition: eval.c:1974
var2 v_type = VAR_UNKNOWN
tv_clear & var1
Initial value:
{
Definition: coverity-model.c:39
v
Definition: eval.c:2030
typval_T var2