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 list_hashtable_vars(hashtab_T *ht, char *prefix, int empty, int *first); 32char_u *get_lval(char_u *name, typval_T *rettv, lval_T *lp, int unlet, int skip, int flags, int fne_flags); 33void clear_lval(lval_T *lp); 34void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip); 35int next_for_item(void *fi_void, char_u *arg); 36void free_for_info(void *fi_void); 37void set_context_for_expression(expand_T *xp, char_u *arg, cmdidx_T cmdidx); 38void ex_unlet(exarg_T *eap); 39void ex_lockvar(exarg_T *eap); 40int do_unlet(char_u *name, int forceit); 41void del_menutrans_vars(void); 42char_u *get_user_var_name(expand_T *xp, int idx); 43int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate); 44int eval1(char_u **arg, typval_T *rettv, int evaluate); 45int get_option_tv(char_u **arg, typval_T *rettv, int evaluate); 46char_u *partial_name(partial_T *pt); 47void partial_unref(partial_T *pt); 48int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive); 49int get_copyID(void); 50int garbage_collect(int testing); 51int set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack); 52int set_ref_in_list(list_T *l, int copyID, ht_stack_T **ht_stack); 53int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); 54char_u *echo_string_core(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID, int echo_style, int restore_copyID, int composite_val); 55char_u *echo_string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); 56char_u *tv2string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); 57char_u *string_quote(char_u *str, int function); 58int string2float(char_u *text, float_T *value); 59pos_T *var2fpos(typval_T *varp, int dollar_lnum, int *fnum); 60int list2fpos(typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp); 61int get_id_len(char_u **arg); 62int get_name_len(char_u **arg, char_u **alias, int evaluate, int verbose); 63char_u *find_name_end(char_u *arg, char_u **expr_start, char_u **expr_end, int flags); 64int eval_isnamec(int c); 65int eval_isnamec1(int c); 66void set_vim_var_nr(int idx, varnumber_T val); 67varnumber_T get_vim_var_nr(int idx); 68char_u *get_vim_var_str(int idx); 69list_T *get_vim_var_list(int idx); 70dict_T *get_vim_var_dict(int idx); 71void set_vim_var_char(int c); 72void set_vcount(long count, long count1, int set_prevcount); 73void save_vimvars(vimvars_save_T *vvsave); 74void restore_vimvars(vimvars_save_T *vvsave); 75void set_vim_var_string(int idx, char_u *val, int len); 76void set_vim_var_list(int idx, list_T *val); 77void set_vim_var_dict(int idx, dict_T *val); 78void set_reg_var(int c); 79char_u *v_exception(char_u *oldval); 80char_u *v_throwpoint(char_u *oldval); 81char_u *set_cmdarg(exarg_T *eap, char_u *oldarg); 82int get_var_tv(char_u *name, int len, typval_T *rettv, dictitem_T **dip, int verbose, int no_autoload); 83int handle_subscript(char_u **arg, typval_T *rettv, int evaluate, int verbose); 84typval_T *alloc_tv(void); 85void free_tv(typval_T *varp); 86void clear_tv(typval_T *varp); 87void init_tv(typval_T *varp); 88varnumber_T tv_get_number(typval_T *varp); 89varnumber_T tv_get_number_chk(typval_T *varp, int *denote); 90float_T tv_get_float(typval_T *varp); 91char_u *tv_get_string(typval_T *varp); 92char_u *tv_get_string_buf(typval_T *varp, char_u *buf); 93char_u *tv_get_string_chk(typval_T *varp); 94char_u *tv_get_string_buf_chk(typval_T *varp, char_u *buf); 95char_u *tv_stringify(typval_T *varp, char_u *buf); 96dictitem_T *find_var(char_u *name, hashtab_T **htp, int no_autoload); 97dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload); 98hashtab_T *find_var_ht(char_u *name, char_u **varname); 99char_u *get_var_value(char_u *name); 100void new_script_vars(scid_T id); 101void init_var_dict(dict_T *dict, dictitem_T *dict_var, int scope); 102void unref_var_dict(dict_T *dict); 103void vars_clear(hashtab_T *ht); 104void vars_clear_ext(hashtab_T *ht, int free_val); 105void set_var(char_u *name, typval_T *tv, int copy); 106int var_check_ro(int flags, char_u *name, int use_gettext); 107int var_check_fixed(int flags, char_u *name, int use_gettext); 108int var_check_func_name(char_u *name, int new_var); 109int var_check_lock(int lock, char_u *name, int use_gettext); 110int valid_varname(char_u *varname); 111void copy_tv(typval_T *from, typval_T *to); 112int item_copy(typval_T *from, typval_T *to, int deep, int copyID); 113void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog, int secret); 114void ex_echo(exarg_T *eap); 115void ex_echohl(exarg_T *eap); 116void ex_execute(exarg_T *eap); 117win_T *find_win_by_nr(typval_T *vp, tabpage_T *tp); 118win_T *find_win_by_nr_or_id(typval_T *vp); 119win_T *find_tabwin(typval_T *wvp, typval_T *tvp, tabpage_T **ptp); 120void getwinvar(typval_T *argvars, typval_T *rettv, int off); 121void setwinvar(typval_T *argvars, typval_T *rettv, int off); 122char_u *autoload_name(char_u *name); 123int script_autoload(char_u *name, int reload); 124int read_viminfo_varlist(vir_T *virp, int writing); 125void write_viminfo_varlist(FILE *fp); 126int store_session_globals(FILE *fd); 127void last_set_msg(sctx_T script_ctx); 128void reset_v_option_vars(void); 129void prepare_assert_error(garray_T *gap); 130void assert_error(garray_T *gap); 131int assert_equal_common(typval_T *argvars, assert_type_T atype); 132int assert_equalfile(typval_T *argvars); 133int assert_match_common(typval_T *argvars, assert_type_T atype); 134int assert_inrange(typval_T *argvars); 135int assert_bool(typval_T *argvars, int isTrue); 136int assert_report(typval_T *argvars); 137int assert_exception(typval_T *argvars); 138int assert_beeps(typval_T *argvars); 139int assert_fails(typval_T *argvars); 140void 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); 141int typval_compare(typval_T *typ1, typval_T *typ2, exptype_T type, int type_is, int ic); 142char_u *typval_tostring(typval_T *arg); 143int var_exists(char_u *var); 144int modify_fname(char_u *src, int tilde_file, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen); 145char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, typval_T *expr, char_u *flags); 146void filter_map(typval_T *argvars, typval_T *rettv, int map); 147/* vim: set ft=c : */ 148