1/* eval.c */ 2void eval_init(void); 3void eval_clear(void); 4void set_internal_string_var(char_u *name, char_u *value); 5int var_redir_start(char_u *name, int append); 6void var_redir_str(char_u *value, int value_len); 7void var_redir_stop(void); 8int eval_charconvert(char_u *enc_from, char_u *enc_to, char_u *fname_from, char_u *fname_to); 9int eval_printexpr(char_u *fname, char_u *args); 10void eval_diff(char_u *origfile, char_u *newfile, char_u *outfile); 11void eval_patch(char_u *origfile, char_u *difffile, char_u *outfile); 12int eval_to_bool(char_u *arg, int *error, char_u **nextcmd, int skip); 13int eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv); 14int eval_expr_to_bool(typval_T *expr, int *error); 15char_u *eval_to_string_skip(char_u *arg, char_u **nextcmd, int skip); 16int skip_expr(char_u **pp); 17char_u *eval_to_string(char_u *arg, char_u **nextcmd, int convert); 18char_u *eval_to_string_safe(char_u *arg, char_u **nextcmd, int use_sandbox); 19varnumber_T eval_to_number(char_u *expr); 20void prepare_vimvar(int idx, typval_T *save_tv); 21void restore_vimvar(int idx, typval_T *save_tv); 22list_T *eval_spell_expr(char_u *badword, char_u *expr); 23int get_spellword(list_T *list, char_u **pp); 24typval_T *eval_expr(char_u *arg, char_u **nextcmd); 25int call_vim_function(char_u *func, int argc, typval_T *argv, typval_T *rettv); 26varnumber_T call_func_retnr(char_u *func, int argc, typval_T *argv); 27void *call_func_retstr(char_u *func, int argc, typval_T *argv); 28void *call_func_retlist(char_u *func, int argc, typval_T *argv); 29int eval_foldexpr(char_u *arg, int *cp); 30void ex_let(exarg_T *eap); 31void ex_const(exarg_T *eap); 32void list_hashtable_vars(hashtab_T *ht, char *prefix, int empty, int *first); 33char_u *get_lval(char_u *name, typval_T *rettv, lval_T *lp, int unlet, int skip, int flags, int fne_flags); 34void clear_lval(lval_T *lp); 35void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip); 36int next_for_item(void *fi_void, char_u *arg); 37void free_for_info(void *fi_void); 38void set_context_for_expression(expand_T *xp, char_u *arg, cmdidx_T cmdidx); 39void ex_unlet(exarg_T *eap); 40void ex_lockvar(exarg_T *eap); 41int do_unlet(char_u *name, int forceit); 42void del_menutrans_vars(void); 43char_u *get_user_var_name(expand_T *xp, int idx); 44int pattern_match(char_u *pat, char_u *text, int ic); 45int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate); 46int eval1(char_u **arg, typval_T *rettv, int evaluate); 47int get_option_tv(char_u **arg, typval_T *rettv, int evaluate); 48char_u *partial_name(partial_T *pt); 49void partial_unref(partial_T *pt); 50int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive); 51int get_copyID(void); 52int garbage_collect(int testing); 53int set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack); 54int set_ref_in_dict(dict_T *d, int copyID); 55int set_ref_in_list(list_T *ll, int copyID); 56int set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack); 57int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); 58char_u *echo_string_core(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID, int echo_style, int restore_copyID, int composite_val); 59char_u *echo_string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); 60char_u *tv2string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); 61char_u *string_quote(char_u *str, int function); 62int string2float(char_u *text, float_T *value); 63pos_T *var2fpos(typval_T *varp, int dollar_lnum, int *fnum); 64int list2fpos(typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp); 65int get_id_len(char_u **arg); 66int get_name_len(char_u **arg, char_u **alias, int evaluate, int verbose); 67char_u *find_name_end(char_u *arg, char_u **expr_start, char_u **expr_end, int flags); 68int eval_isnamec(int c); 69int eval_isnamec1(int c); 70void set_vim_var_nr(int idx, varnumber_T val); 71typval_T *get_vim_var_tv(int idx); 72varnumber_T get_vim_var_nr(int idx); 73char_u *get_vim_var_str(int idx); 74list_T *get_vim_var_list(int idx); 75dict_T *get_vim_var_dict(int idx); 76void set_vim_var_char(int c); 77void set_vcount(long count, long count1, int set_prevcount); 78void save_vimvars(vimvars_save_T *vvsave); 79void restore_vimvars(vimvars_save_T *vvsave); 80void set_vim_var_string(int idx, char_u *val, int len); 81void set_vim_var_list(int idx, list_T *val); 82void set_vim_var_dict(int idx, dict_T *val); 83void set_reg_var(int c); 84char_u *v_exception(char_u *oldval); 85char_u *v_throwpoint(char_u *oldval); 86char_u *set_cmdarg(exarg_T *eap, char_u *oldarg); 87int get_var_tv(char_u *name, int len, typval_T *rettv, dictitem_T **dip, int verbose, int no_autoload); 88int handle_subscript(char_u **arg, typval_T *rettv, int evaluate, int verbose); 89typval_T *alloc_tv(void); 90void free_tv(typval_T *varp); 91void clear_tv(typval_T *varp); 92void init_tv(typval_T *varp); 93varnumber_T tv_get_number(typval_T *varp); 94varnumber_T tv_get_number_chk(typval_T *varp, int *denote); 95float_T tv_get_float(typval_T *varp); 96char_u *tv_get_string(typval_T *varp); 97char_u *tv_get_string_buf(typval_T *varp, char_u *buf); 98char_u *tv_get_string_chk(typval_T *varp); 99char_u *tv_get_string_buf_chk(typval_T *varp, char_u *buf); 100char_u *tv_stringify(typval_T *varp, char_u *buf); 101dictitem_T *find_var(char_u *name, hashtab_T **htp, int no_autoload); 102dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload); 103hashtab_T *find_var_ht(char_u *name, char_u **varname); 104char_u *get_var_value(char_u *name); 105void new_script_vars(scid_T id); 106void init_var_dict(dict_T *dict, dictitem_T *dict_var, int scope); 107void unref_var_dict(dict_T *dict); 108void vars_clear(hashtab_T *ht); 109void vars_clear_ext(hashtab_T *ht, int free_val); 110void set_var(char_u *name, typval_T *tv, int copy); 111int var_check_ro(int flags, char_u *name, int use_gettext); 112int var_check_fixed(int flags, char_u *name, int use_gettext); 113int var_check_func_name(char_u *name, int new_var); 114int var_check_lock(int lock, char_u *name, int use_gettext); 115int valid_varname(char_u *varname); 116void copy_tv(typval_T *from, typval_T *to); 117int item_copy(typval_T *from, typval_T *to, int deep, int copyID); 118void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog, int secret); 119void ex_echo(exarg_T *eap); 120void ex_echohl(exarg_T *eap); 121void ex_execute(exarg_T *eap); 122win_T *find_win_by_nr(typval_T *vp, tabpage_T *tp); 123win_T *find_win_by_nr_or_id(typval_T *vp); 124win_T *find_tabwin(typval_T *wvp, typval_T *tvp, tabpage_T **ptp); 125void getwinvar(typval_T *argvars, typval_T *rettv, int off); 126void setwinvar(typval_T *argvars, typval_T *rettv, int off); 127char_u *autoload_name(char_u *name); 128int script_autoload(char_u *name, int reload); 129void last_set_msg(sctx_T script_ctx); 130void reset_v_option_vars(void); 131void assert_error(garray_T *gap); 132int typval_compare(typval_T *typ1, typval_T *typ2, exptype_T type, int type_is, int ic); 133char_u *typval_tostring(typval_T *arg); 134int var_exists(char_u *var); 135int modify_fname(char_u *src, int tilde_file, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen); 136char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, typval_T *expr, char_u *flags); 137void filter_map(typval_T *argvars, typval_T *rettv, int map); 138/* vim: set ft=c : */ 139