comparison src/eval.c @ 951:06959e7212e5 v7.0.077

updated for version 7.0-077
author vimboss
date Sat, 02 Sep 2006 11:41:07 +0000
parents 8fafff87aedb
children 92f3089a7b10
comparison
equal deleted inserted replaced
950:f03c3fae0a99 951:06959e7212e5
699 static void delete_var __ARGS((hashtab_T *ht, hashitem_T *hi)); 699 static void delete_var __ARGS((hashtab_T *ht, hashitem_T *hi));
700 static void list_one_var __ARGS((dictitem_T *v, char_u *prefix)); 700 static void list_one_var __ARGS((dictitem_T *v, char_u *prefix));
701 static void list_one_var_a __ARGS((char_u *prefix, char_u *name, int type, char_u *string)); 701 static void list_one_var_a __ARGS((char_u *prefix, char_u *name, int type, char_u *string));
702 static void set_var __ARGS((char_u *name, typval_T *varp, int copy)); 702 static void set_var __ARGS((char_u *name, typval_T *varp, int copy));
703 static int var_check_ro __ARGS((int flags, char_u *name)); 703 static int var_check_ro __ARGS((int flags, char_u *name));
704 static int var_check_fixed __ARGS((int flags, char_u *name));
704 static int tv_check_lock __ARGS((int lock, char_u *name)); 705 static int tv_check_lock __ARGS((int lock, char_u *name));
705 static void copy_tv __ARGS((typval_T *from, typval_T *to)); 706 static void copy_tv __ARGS((typval_T *from, typval_T *to));
706 static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID)); 707 static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID));
707 static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags)); 708 static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags));
708 static char_u *trans_function_name __ARGS((char_u **pp, int skip, int flags, funcdict_T *fd)); 709 static char_u *trans_function_name __ARGS((char_u **pp, int skip, int flags, funcdict_T *fd));
3362 if (ht != NULL && *varname != NUL) 3363 if (ht != NULL && *varname != NUL)
3363 { 3364 {
3364 hi = hash_find(ht, varname); 3365 hi = hash_find(ht, varname);
3365 if (!HASHITEM_EMPTY(hi)) 3366 if (!HASHITEM_EMPTY(hi))
3366 { 3367 {
3368 if (var_check_fixed(HI2DI(hi)->di_flags, name))
3369 return FAIL;
3367 if (var_check_ro(HI2DI(hi)->di_flags, name)) 3370 if (var_check_ro(HI2DI(hi)->di_flags, name))
3368 return FAIL; 3371 return FAIL;
3369 delete_var(ht, hi); 3372 delete_var(ht, hi);
3370 return OK; 3373 return OK;
3371 } 3374 }
17816 init_tv(tv); 17819 init_tv(tv);
17817 } 17820 }
17818 } 17821 }
17819 17822
17820 /* 17823 /*
17821 * Return TRUE if di_flags "flags" indicate read-only variable "name". 17824 * Return TRUE if di_flags "flags" indicates variable "name" is read-only.
17822 * Also give an error message. 17825 * Also give an error message.
17823 */ 17826 */
17824 static int 17827 static int
17825 var_check_ro(flags, name) 17828 var_check_ro(flags, name)
17826 int flags; 17829 int flags;
17832 return TRUE; 17835 return TRUE;
17833 } 17836 }
17834 if ((flags & DI_FLAGS_RO_SBX) && sandbox) 17837 if ((flags & DI_FLAGS_RO_SBX) && sandbox)
17835 { 17838 {
17836 EMSG2(_(e_readonlysbx), name); 17839 EMSG2(_(e_readonlysbx), name);
17840 return TRUE;
17841 }
17842 return FALSE;
17843 }
17844
17845 /*
17846 * Return TRUE if di_flags "flags" indicates variable "name" is fixed.
17847 * Also give an error message.
17848 */
17849 static int
17850 var_check_fixed(flags, name)
17851 int flags;
17852 char_u *name;
17853 {
17854 if (flags & DI_FLAGS_FIX)
17855 {
17856 EMSG2(_("E795: Cannot delete variable %s"), name);
17837 return TRUE; 17857 return TRUE;
17838 } 17858 }
17839 return FALSE; 17859 return FALSE;
17840 } 17860 }
17841 17861