cvs: TSRM / tsrm_virtual_cwd.h
| From: | Andrei Zmievski | Date: | Thu, 03 Aug 2006 23:56:46 +0000 |
| Subject: | cvs: TSRM / tsrm_virtual_cwd.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5151@lists.php.net to get a copy of this message | ||
andrei Thu Aug 3 23:56:46 2006 UTC
Modified files:
/TSRM tsrm_virtual_cwd.h
Log:
Add IS_U_SLASH_* macros to test for path separator chars.
http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.h?r1=1.53&r2=1.54&diff_format=u
Index: TSRM/tsrm_virtual_cwd.h
diff -u TSRM/tsrm_virtual_cwd.h:1.53 TSRM/tsrm_virtual_cwd.h:1.54
--- TSRM/tsrm_virtual_cwd.h:1.53 Mon Apr 10 11:56:04 2006
+++ TSRM/tsrm_virtual_cwd.h Thu Aug 3 23:56:46 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.h,v 1.53 2006/04/10 11:56:04 sniper Exp $ */
+/* $Id: tsrm_virtual_cwd.h,v 1.54 2006/08/03 23:56:46 andrei Exp $ */
#ifndef VIRTUAL_CWD_H
#define VIRTUAL_CWD_H
@@ -57,6 +57,9 @@
#define IS_SLASH_P(c) (*(c) == '/' || \
(*(c) == '\\' && !IsDBCSLeadByte(*(c-1))))
+#define IS_U_SLASH(c) ((UChar32)(c) == (UChar32)0x2f /*'/'*/ || (UChar32)(c) ==
(UChar32)0x5c /*'\\'*/)
+#define IS_U_SLASH_P(c) IS_SLASH(*(c))
+
/* COPY_WHEN_ABSOLUTE is 2 under Win32 because by chance both regular absolute paths
in the file system and UNC paths need copying of two characters */
#define COPY_WHEN_ABSOLUTE(path) 2
@@ -74,6 +77,10 @@
#define DEFAULT_DIR_SEPARATOR ';'
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
#define IS_SLASH_P(c) IS_SLASH(*(c))
+
+#define IS_U_SLASH(c) ((UChar32)(c) == (UChar32)0x2f /*'/'*/ || (UChar32)(c) ==
(UChar32)0x5c /*'\\'*/)
+#define IS_U_SLASH_P(c) IS_U_SLASH(*(c))
+
/* Colon indicates volume name, either first character should be forward slash or backward slash */
#define IS_ABSOLUTE_PATH(path, len) \
((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/')
|| (path[0] == '\\'))))
@@ -91,8 +98,11 @@
#define DEFAULT_DIR_SEPARATOR ':'
#endif
-#define IS_SLASH(c) ((c) == '/')
-#define IS_SLASH_P(c) (*(c) == '/')
+#define IS_SLASH(c) ((c) == '/')
+#define IS_SLASH_P(c) IS_SLASH(*(c))
+
+#define IS_U_SLASH(c) ((UChar32)(c) == (UChar32)0x2f /*'/'*/)
+#define IS_U_SLASH_P(c) IS_U_SLASH(*(c))
#endif