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_to_bool(typval_T *expr, int *error); 14char_u *eval_to_string_skip(char_u *arg, char_u **nextcmd, int skip); 15int skip_expr(char_u **pp); 16char_u *eval_to_string(char_u *arg, char_u **nextcmd, int convert); 17char_u *eval_to_string_safe(char_u *arg, char_u **nextcmd, int use_sandbox); 18varnumber_T eval_to_number(char_u *expr); 19list_T *eval_spell_expr(char_u *badword, char_u *expr); 20int get_spellword(list_T *list, char_u **pp); 21typval_T *eval_expr(char_u *arg, char_u **nextcmd); 22int call_vim_function(char_u *func, int argc, char_u **argv, int safe, int str_arg_only, typval_T *rettv); 23varnumber_T call_func_retnr(char_u *func, int argc, char_u **argv, int safe); 24void *call_func_retstr(char_u *func, int argc, char_u **argv, int safe); 25void *call_func_retlist(char_u *func, int argc, char_u **argv, int safe); 26int eval_foldexpr(char_u *arg, int *cp); 27void ex_let(exarg_T *eap); 28void list_hashtable_vars(hashtab_T *ht, char_u *prefix, int empty, int *first); 29char_u *get_lval(char_u *name, typval_T *rettv, lval_T *lp, int unlet, int skip, int flags, int fne_flags); 30void clear_lval(lval_T *lp); 31void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip); 32int next_for_item(void *fi_void, char_u *arg); 33void free_for_info(void *fi_void); 34void set_context_for_expression(expand_T *xp, char_u *arg, cmdidx_T cmdidx); 35void ex_unlet(exarg_T *eap); 36void ex_lockvar(exarg_T *eap); 37int do_unlet(char_u *name, int forceit); 38void del_menutrans_vars(void); 39char_u *get_user_var_name(expand_T *xp, int idx); 40int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate); 41int eval1(char_u **arg, typval_T *rettv, int evaluate); 42int get_option_tv(char_u **arg, typval_T *rettv, int evaluate); 43char_u *partial_name(partial_T *pt); 44void partial_unref(partial_T *pt); 45int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive); 46int get_copyID(void); 47int garbage_collect(int testing); 48int set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack); 49int set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack); 50int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); 51char_u *echo_string_core(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID, int echo_style, int restore_copyID, int composite_val); 52char_u *echo_string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); 53char_u *tv2string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); 54char_u *string_quote(char_u *str, int function); 55int string2float(char_u *text, float_T *value); 56pos_T *var2fpos(typval_T *varp, int dollar_lnum, int *fnum); 57int list2fpos(typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp); 58int get_id_len(char_u **arg); 59int get_name_len(char_u **arg, char_u **alias, int evaluate, int verbose); 60char_u *find_name_end(char_u *arg, char_u **expr_start, char_u **expr_end, int flags); 61int eval_isnamec(int c); 62int eval_isnamec1(int c); 63void set_vim_var_nr(int idx, varnumber_T val); 64varnumber_T get_vim_var_nr(int idx); 65char_u *get_vim_var_str(int idx); 66list_T *get_vim_var_list(int idx); 67void set_vim_var_char(int c); 68void set_vcount(long count, long count1, int set_prevcount); 69void set_vim_var_string(int idx, char_u *val, int len); 70void set_vim_var_list(int idx, list_T *val); 71void set_vim_var_dict(int idx, dict_T *val); 72void set_reg_var(int c); 73char_u *v_exception(char_u *oldval); 74char_u *v_throwpoint(char_u *oldval); 75char_u *set_cmdarg(exarg_T *eap, char_u *oldarg); 76int get_var_tv(char_u *name, int len, typval_T *rettv, dictitem_T **dip, int verbose, int no_autoload); 77int handle_subscript(char_u **arg, typval_T *rettv, int evaluate, int verbose); 78typval_T *alloc_tv(void); 79void free_tv(typval_T *varp); 80void clear_tv(typval_T *varp); 81void init_tv(typval_T *varp); 82varnumber_T get_tv_number(typval_T *varp); 83varnumber_T get_tv_number_chk(typval_T *varp, int *denote); 84float_T get_tv_float(typval_T *varp); 85char_u *get_tv_string(typval_T *varp); 86char_u *get_tv_string_buf(typval_T *varp, char_u *buf); 87char_u *get_tv_string_chk(typval_T *varp); 88char_u *get_tv_string_buf_chk(typval_T *varp, char_u *buf); 89dictitem_T *find_var(char_u *name, hashtab_T **htp, int no_autoload); 90dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload); 91hashtab_T *find_var_ht(char_u *name, char_u **varname); 92char_u *get_var_value(char_u *name); 93void new_script_vars(scid_T id); 94void init_var_dict(dict_T *dict, dictitem_T *dict_var, int scope); 95void unref_var_dict(dict_T *dict); 96void vars_clear(hashtab_T *ht); 97void vars_clear_ext(hashtab_T *ht, int free_val); 98void set_var(char_u *name, typval_T *tv, int copy); 99int var_check_ro(int flags, char_u *name, int use_gettext); 100int var_check_fixed(int flags, char_u *name, int use_gettext); 101int var_check_func_name(char_u *name, int new_var); 102int valid_varname(char_u *varname); 103int tv_check_lock(int lock, char_u *name, int use_gettext); 104void copy_tv(typval_T *from, typval_T *to); 105int item_copy(typval_T *from, typval_T *to, int deep, int copyID); 106void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog, int secret); 107void ex_echo(exarg_T *eap); 108void ex_echohl(exarg_T *eap); 109void ex_execute(exarg_T *eap); 110win_T *find_win_by_nr(typval_T *vp, tabpage_T *tp); 111win_T *find_tabwin(typval_T *wvp, typval_T *tvp); 112void getwinvar(typval_T *argvars, typval_T *rettv, int off); 113void setwinvar(typval_T *argvars, typval_T *rettv, int off); 114char_u *autoload_name(char_u *name); 115int script_autoload(char_u *name, int reload); 116int read_viminfo_varlist(vir_T *virp, int writing); 117void write_viminfo_varlist(FILE *fp); 118int store_session_globals(FILE *fd); 119void last_set_msg(scid_T scriptID); 120void reset_v_option_vars(void); 121void prepare_assert_error(garray_T *gap); 122void assert_error(garray_T *gap); 123void assert_equal_common(typval_T *argvars, assert_type_T atype); 124void assert_match_common(typval_T *argvars, assert_type_T atype); 125void assert_inrange(typval_T *argvars); 126void assert_bool(typval_T *argvars, int isTrue); 127void assert_report(typval_T *argvars); 128void assert_exception(typval_T *argvars); 129void assert_fails(typval_T *argvars); 130void 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); 131int modify_fname(char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen); 132char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, typval_T *expr, char_u *flags); 133void filter_map(typval_T *argvars, typval_T *rettv, int map); 134/* vim: set ft=c : */ 135