cvs: php4 /ext/standard filestat.c

From: Date: Thu, 05 Sep 2002 14:36:33 +0000
Subject: cvs: php4 /ext/standard filestat.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13861@lists.php.net to get a copy of this message
derick Thu Sep 5 10:36:33 2002 EDT Modified files: /php4/ext/standard filestat.c Log: - Tabs for indentation Index: php4/ext/standard/filestat.c diff -u php4/ext/standard/filestat.c:1.103 php4/ext/standard/filestat.c:1.104 --- php4/ext/standard/filestat.c:1.103 Thu Sep 5 10:21:55 2002 +++ php4/ext/standard/filestat.c Thu Sep 5 10:36:33 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.103 2002/09/05 14:21:55 hyanantha Exp $ */ +/* $Id: filestat.c,v 1.104 2002/09/05 14:36:33 derick Exp $ */ #include "php.h" #include "safe_mode.h" @@ -144,7 +144,7 @@ /* These are used by GetDiskFreeSpaceEx, if available. */ ULARGE_INTEGER FreeBytesAvailableToCaller; ULARGE_INTEGER TotalNumberOfBytes; - ULARGE_INTEGER TotalNumberOfFreeBytes; + ULARGE_INTEGER TotalNumberOfFreeBytes; /* These are used by GetDiskFreeSpace otherwise. */ DWORD SectorsPerCluster; @@ -207,7 +207,7 @@ #elif defined(OS2) { FSALLOCATE fsinfo; - char drive = Z_STRVAL_PP(path)[0] & 95; + char drive = Z_STRVAL_PP(path)[0] & 95; if (DosQueryFSInfo( drive ? drive - 64 : 0, FSIL_ALLOC, &fsinfo, sizeof( fsinfo ) ) == 0) bytestotal = (double)fsinfo.cbSector * fsinfo.cSectorUnit * fsinfo.cUnit; @@ -247,7 +247,7 @@ /* These are used by GetDiskFreeSpaceEx, if available. */ ULARGE_INTEGER FreeBytesAvailableToCaller; ULARGE_INTEGER TotalNumberOfBytes; - ULARGE_INTEGER TotalNumberOfFreeBytes; + ULARGE_INTEGER TotalNumberOfFreeBytes; /* These are used by GetDiskFreeSpace otherwise. */ DWORD SectorsPerCluster; @@ -310,7 +310,7 @@ #elif defined(OS2) { FSALLOCATE fsinfo; - char drive = Z_STRVAL_PP(path)[0] & 95; + char drive = Z_STRVAL_PP(path)[0] & 95; if (DosQueryFSInfo( drive ? drive - 64 : 0, FSIL_ALLOC, &fsinfo, sizeof( fsinfo ) ) == 0) bytesfree = (double)fsinfo.cbSector * fsinfo.cSectorUnit * fsinfo.cUnitAvail; @@ -458,7 +458,7 @@ that safe mode doesn't give them. */ if(PG(safe_mode)) - imode &= 0777; + imode &= 0777; ret = VCWD_CHMOD(Z_STRVAL_PP(filename), imode); if (ret == -1) { @@ -477,7 +477,7 @@ pval **filename, **filetime, **fileatime; int ret; #if defined(NETWARE) && defined(CLIB_STAT_PATCH) - struct stat_libc sb; + struct stat_libc sb; #else struct stat sb; #endif @@ -572,18 +572,18 @@ } #ifndef PHP_WIN32 - switch (type) { - case FS_IS_W: - RETURN_BOOL (!access (filename, W_OK)); - case FS_IS_R: - RETURN_BOOL (!access (filename, R_OK)); - case FS_IS_X: - RETURN_BOOL (!access (filename, X_OK)); - case FS_EXISTS: - RETURN_BOOL (!access (filename, F_OK)); - } + switch (type) { + case FS_IS_W: + RETURN_BOOL (!access (filename, W_OK)); + case FS_IS_R: + RETURN_BOOL (!access (filename, R_OK)); + case FS_IS_X: + RETURN_BOOL (!access (filename, X_OK)); + case FS_EXISTS: + RETURN_BOOL (!access (filename, F_OK)); + } #endif - + stat_sb = &BG(sb); if (!BG(CurrentStatFile) || strcmp(filename, BG(CurrentStatFile))) { @@ -669,21 +669,21 @@ RETURN_LONG((long)BG(sb).st_gid); case FS_ATIME: #if defined(NETWARE) && defined(NEW_LIBC) - RETURN_LONG((long)(BG(sb).st_atime).tv_nsec); + RETURN_LONG((long)(BG(sb).st_atime).tv_nsec); #else - RETURN_LONG((long)BG(sb).st_atime); + RETURN_LONG((long)BG(sb).st_atime); #endif case FS_MTIME: #if defined(NETWARE) && defined(NEW_LIBC) RETURN_LONG((long)(BG(sb).st_mtime).tv_nsec); #else - RETURN_LONG((long)BG(sb).st_mtime); + RETURN_LONG((long)BG(sb).st_mtime); #endif case FS_CTIME: #if defined(NETWARE) && defined(NEW_LIBC) RETURN_LONG((long)(BG(sb).st_ctime).tv_nsec); #else - RETURN_LONG((long)BG(sb).st_ctime); + RETURN_LONG((long)BG(sb).st_ctime); #endif case FS_TYPE: #if HAVE_SYMLINK @@ -705,7 +705,7 @@ RETURN_STRING("unknown", 1); case FS_IS_W: #ifdef NETWARE - RETURN_LONG(0); + RETURN_LONG(0); #else if (getuid()==0) { RETURN_TRUE; /* root */ @@ -713,7 +713,7 @@ RETURN_BOOL((BG(sb).st_mode & wmask) != 0); case FS_IS_R: #ifdef NETWARE - RETURN_LONG(0); + RETURN_LONG(0); #else if (getuid()==0) { RETURN_TRUE; /* root */ @@ -721,7 +721,7 @@ RETURN_BOOL((BG(sb).st_mode&rmask)!=0); case FS_IS_X: #ifdef NETWARE - RETURN_LONG(0); + RETURN_LONG(0); #else if (getuid()==0) { xmask = S_IXROOT; /* root */ @@ -748,7 +748,7 @@ if (array_init(return_value) == FAILURE) { RETURN_FALSE; } - + MAKE_LONG_ZVAL_INCREF(stat_dev, stat_sb->st_dev); MAKE_LONG_ZVAL_INCREF(stat_ino, stat_sb->st_ino); MAKE_LONG_ZVAL_INCREF(stat_mode, stat_sb->st_mode);

« previous php.cvs (#13861) next »