S_ISxxx macros

From: Date: Fri, 26 Jul 2002 13:35:43 +0000
Subject: S_ISxxx macros
Groups: php.dev 
Request: Send a blank email to php-dev+get-86236@lists.php.net to get a copy of this message
The following patch would collect all S_ISxxx macros into trsm_virtual_cwd.h so they would be available everywhere in php sources. This finishes what started with parameter -c accepting directories. Perhaps someone with karma for tsrm apply this? marcus cvs -z3 -q diff ext\standard\filestat.c TSRM\tsrm_virtual_cwd.c TSRM\tsrm_virtual_cwd.h (in directory S:\php4\) Index: ext/standard/filestat.c =================================================================== RCS file: /repository/php4/ext/standard/filestat.c,v retrieving revision 1.100 diff -u -r1.100 filestat.c
--- ext/standard/filestat.c     26 Jul 2002 08:04:42 -0000      1.100
+++ ext/standard/filestat.c     26 Jul 2002 13:25:54 -0000
@@ -78,16 +78,6 @@ #include "basic_functions.h" #include "php_filestat.h" -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif -#ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) -#endif -#ifndef S_ISLNK -#define S_ISLNK(mode) (((mode)&S_IFMT) == S_IFLNK) -#endif - #define S_IXROOT ( S_IXUSR | S_IXGRP | S_IXOTH ) /* Switches for various filestat functions: */ Index: TSRM/tsrm_virtual_cwd.c =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.c,v retrieving revision 1.30 diff -u -r1.30 tsrm_virtual_cwd.c
--- TSRM/tsrm_virtual_cwd.c     29 May 2002 08:41:21 -0000      1.30
+++ TSRM/tsrm_virtual_cwd.c     26 Jul 2002 13:25:54 -0000
@@ -64,14 +64,6 @@ #include <direct.h> #endif -#ifndef S_ISDIR -#define S_ISDIR(mode) ((mode) & _S_IFDIR) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) ((mode) & _S_IFREG) -#endif - #ifdef TSRM_WIN32 #include <tchar.h> #define tsrm_strtok_r(a,b,c) _tcstok((a),(b)) Index: TSRM/tsrm_virtual_cwd.h =================================================================== RCS file: /repository/TSRM/tsrm_virtual_cwd.h,v retrieving revision 1.19 diff -u -r1.19 tsrm_virtual_cwd.h
--- TSRM/tsrm_virtual_cwd.h     29 May 2002 08:41:21 -0000      1.19
+++ TSRM/tsrm_virtual_cwd.h     26 Jul 2002 13:25:54 -0000
@@ -238,4 +238,23 @@ #endif +#ifndef S_ISDIR +#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#endif +#ifndef S_ISCHR +#define S_ISCHR(mode) (((mode)&S_IFMT) == S_IFCHR) +#endif +#ifndef S_ISFIFO +#define S_ISFIFO(mode) (((mode)&S_IFMT) == S_IFIFO) +#endif +#ifndef S_ISREG +#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) +#endif +#ifndef S_ISLNK +#define S_ISLNK(mode) (((mode)&S_IFMT) == S_IFLNK) +#endif +#ifndef S_ISBLK +#define S_ISBLK(mode) (((mode)&S_IFMT) == S_IFBLK) +#endif + #endif /* VIRTUAL_CWD_H */

« previous php.dev (#86236) next »