1/* eval.c */ 2varnumber_T num_divide(varnumber_T n1, varnumber_T n2); 3varnumber_T num_modulus(varnumber_T n1, varnumber_T n2); 4void eval_init(void); 5void eval_clear(void); 6int eval_to_bool(char_u *arg, int *error, char_u **nextcmd, int skip); 7int eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv); 8int eval_expr_to_bool(typval_T *expr, int *error); 9char_u *eval_to_string_skip(char_u *arg, char_u **nextcmd, int skip); 10int skip_expr(char_u **pp); 11char_u *eval_to_string(char_u *arg, char_u **nextcmd, int convert); 12char_u *eval_to_string_safe(char_u *arg, char_u **nextcmd, int use_sandbox); 13varnumber_T eval_to_number(char_u *expr); 14typval_T *eval_expr(char_u *arg, char_u **nextcmd); 15int call_vim_function(char_u *func, int argc, typval_T *argv, typval_T *rettv); 16varnumber_T call_func_retnr(char_u *func, int argc, typval_T *argv); 17void *call_func_retstr(char_u *func, int argc, typval_T *argv); 18void *call_func_retlist(char_u *func, int argc, typval_T *argv); 19int eval_foldexpr(char_u *arg, int *cp); 20char_u *get_lval(char_u *name, typval_T *rettv, lval_T *lp, int unlet, int skip, int flags, int fne_flags); 21void clear_lval(lval_T *lp); 22void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, int is_const, char_u *op); 23void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip); 24int next_for_item(void *fi_void, char_u *arg); 25void free_for_info(void *fi_void); 26void set_context_for_expression(expand_T *xp, char_u *arg, cmdidx_T cmdidx); 27int pattern_match(char_u *pat, char_u *text, int ic); 28int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate); 29int eval1(char_u **arg, typval_T *rettv, int evaluate); 30void eval_addblob(typval_T *tv1, typval_T *tv2); 31int eval_addlist(typval_T *tv1, typval_T *tv2); 32int get_option_tv(char_u **arg, typval_T *rettv, int evaluate); 33int get_number_tv(char_u **arg, typval_T *rettv, int evaluate, int want_string); 34int get_string_tv(char_u **arg, typval_T *rettv, int evaluate); 35int get_lit_string_tv(char_u **arg, typval_T *rettv, int evaluate); 36char_u *partial_name(partial_T *pt); 37void partial_unref(partial_T *pt); 38int tv_equal(typval_T *tv1, typval_T *tv2, int ic, int recursive); 39int get_copyID(void); 40int garbage_collect(int testing); 41int set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack); 42int set_ref_in_dict(dict_T *d, int copyID); 43int set_ref_in_list(list_T *ll, int copyID); 44int set_ref_in_list_items(list_T *l, int copyID, ht_stack_T **ht_stack); 45int set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, list_stack_T **list_stack); 46char_u *echo_string_core(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID, int echo_style, int restore_copyID, int composite_val); 47char_u *echo_string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); 48char_u *tv2string(typval_T *tv, char_u **tofree, char_u *numbuf, int copyID); 49char_u *string_quote(char_u *str, int function); 50int string2float(char_u *text, float_T *value); 51int get_env_tv(char_u **arg, typval_T *rettv, int evaluate); 52pos_T *var2fpos(typval_T *varp, int dollar_lnum, int *fnum); 53int list2fpos(typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp); 54int get_env_len(char_u **arg); 55int get_id_len(char_u **arg); 56int get_name_len(char_u **arg, char_u **alias, int evaluate, int verbose); 57char_u *find_name_end(char_u *arg, char_u **expr_start, char_u **expr_end, int flags); 58int eval_isnamec(int c); 59int eval_isnamec1(int c); 60int handle_subscript(char_u **arg, typval_T *rettv, int evaluate, int verbose, char_u *start_leader, char_u **end_leaderp); 61typval_T *alloc_tv(void); 62typval_T *alloc_string_tv(char_u *s); 63void free_tv(typval_T *varp); 64void clear_tv(typval_T *varp); 65void init_tv(typval_T *varp); 66varnumber_T tv_get_number(typval_T *varp); 67varnumber_T tv_get_number_chk(typval_T *varp, int *denote); 68float_T tv_get_float(typval_T *varp); 69char_u *tv_get_string(typval_T *varp); 70char_u *tv_get_string_buf(typval_T *varp, char_u *buf); 71char_u *tv_get_string_chk(typval_T *varp); 72char_u *tv_get_string_buf_chk(typval_T *varp, char_u *buf); 73void copy_tv(typval_T *from, typval_T *to); 74int item_copy(typval_T *from, typval_T *to, int deep, int copyID); 75void echo_one(typval_T *rettv, int with_space, int *atstart, int *needclr); 76void ex_echo(exarg_T *eap); 77void ex_echohl(exarg_T *eap); 78int get_echo_attr(void); 79void ex_execute(exarg_T *eap); 80char_u *find_option_end(char_u **arg, int *opt_flags); 81void last_set_msg(sctx_T script_ctx); 82int typval_compare(typval_T *typ1, typval_T *typ2, exptype_T type, int ic); 83char_u *typval_tostring(typval_T *arg); 84char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, typval_T *expr, char_u *flags); 85/* vim: set ft=c : */ 86