diff options
author | Andrei Zmievski <andrei@php.net> | 2006-08-03 23:56:46 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 2006-08-03 23:56:46 +0000 |
commit | 050f22bf0ba3c5dcc2a93dc31b2b7fe90cd1aab7 (patch) | |
tree | 6849d3fadc5f3db3c061f5edee471a3deef77f76 /TSRM | |
parent | 49f1d3a7793f291723780bc68a2e93214c8c3847 (diff) | |
download | php-git-050f22bf0ba3c5dcc2a93dc31b2b7fe90cd1aab7.tar.gz |
Add IS_U_SLASH_* macros to test for path separator chars.
Diffstat (limited to 'TSRM')
-rw-r--r-- | TSRM/tsrm_virtual_cwd.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h index b92f0f2875..279deae0dc 100644 --- a/TSRM/tsrm_virtual_cwd.h +++ b/TSRM/tsrm_virtual_cwd.h @@ -57,6 +57,9 @@ typedef unsigned short mode_t; #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 @@ typedef unsigned short mode_t; #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 @@ typedef unsigned short mode_t; #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 |