comparison src/eval.c @ 315:a0451524244d v7.0082

updated for version 7.0082
author vimboss
date Tue, 07 Jun 2005 21:12:49 +0000
parents 006e9c8a6a8a
children 03b3684919e3
comparison
equal deleted inserted replaced
314:529f887b5cb7 315:a0451524244d
7929 7929
7930 rettv->vval.v_number = n; 7930 rettv->vval.v_number = n;
7931 } 7931 }
7932 7932
7933 /* 7933 /*
7934 * return 0 for not writable, 1 for writable file, 2 for a dir which we have 7934 * Return 0 for not writable, 1 for writable file, 2 for a dir which we have
7935 * rights to write into. 7935 * rights to write into.
7936 */ 7936 */
7937 static void 7937 static void
7938 f_filewritable(argvars, rettv) 7938 f_filewritable(argvars, rettv)
7939 typval_T *argvars; 7939 typval_T *argvars;
7940 typval_T *rettv; 7940 typval_T *rettv;
7941 { 7941 {
7942 char_u *p; 7942 rettv->vval.v_number = filewritable(get_tv_string(&argvars[0]));
7943 int retval = 0;
7944 #if defined(UNIX) || defined(VMS)
7945 int perm = 0;
7946 #endif
7947
7948 p = get_tv_string(&argvars[0]);
7949 #if defined(UNIX) || defined(VMS)
7950 perm = mch_getperm(p);
7951 #endif
7952 #ifndef MACOS_CLASSIC /* TODO: get either mch_writable or mch_access */
7953 if (
7954 # ifdef WIN3264
7955 mch_writable(p) &&
7956 # else
7957 # if defined(UNIX) || defined(VMS)
7958 (perm & 0222) &&
7959 # endif
7960 # endif
7961 mch_access((char *)p, W_OK) == 0
7962 )
7963 #endif
7964 {
7965 ++retval;
7966 if (mch_isdir(p))
7967 ++retval;
7968 }
7969 rettv->vval.v_number = retval;
7970 } 7943 }
7971 7944
7972 static void findfilendir __ARGS((typval_T *argvars, typval_T *rettv, int dir)); 7945 static void findfilendir __ARGS((typval_T *argvars, typval_T *rettv, int dir));
7973 7946
7974 static void 7947 static void
9488 #ifdef FEAT_SUN_WORKSHOP 9461 #ifdef FEAT_SUN_WORKSHOP
9489 "sun_workshop", 9462 "sun_workshop",
9490 #endif 9463 #endif
9491 #ifdef FEAT_NETBEANS_INTG 9464 #ifdef FEAT_NETBEANS_INTG
9492 "netbeans_intg", 9465 "netbeans_intg",
9466 #endif
9467 #ifdef FEAT_SYN_HL
9468 "spell",
9493 #endif 9469 #endif
9494 #ifdef FEAT_SYN_HL 9470 #ifdef FEAT_SYN_HL
9495 "syntax", 9471 "syntax",
9496 #endif 9472 #endif
9497 #if defined(USE_SYSTEM) || !defined(UNIX) 9473 #if defined(USE_SYSTEM) || !defined(UNIX)