summaryrefslogtreecommitdiff
path: root/main/php_virtual_cwd.h
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-08-27 19:36:35 +0000
committerSascha Schumann <sas@php.net>2000-08-27 19:36:35 +0000
commit626fc9a7732fa07a1dc9cd861818b049c9862b21 (patch)
tree3174cc30c0a0e6d255a872920dbd1f7b148da9d6 /main/php_virtual_cwd.h
parentab458219eca76e4897a8c437a72da772e37079a1 (diff)
downloadphp-git-626fc9a7732fa07a1dc9cd861818b049c9862b21.tar.gz
Export IS_ABSOLUTE_PATH to the outside world.
Diffstat (limited to 'main/php_virtual_cwd.h')
-rw-r--r--main/php_virtual_cwd.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/main/php_virtual_cwd.h b/main/php_virtual_cwd.h
index 6b6606cc17..03b100d8c2 100644
--- a/main/php_virtual_cwd.h
+++ b/main/php_virtual_cwd.h
@@ -36,12 +36,28 @@
#include <unistd.h>
#endif
+#include <ctype.h>
+
#ifdef ZEND_WIN32
#include "win32/readdir.h"
+
+#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
+
+#define IS_ABSOLUTE_PATH(path, len) \
+ (len >= 2 && isalpha(path[0]) && path[1] == ':')
+
#else
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
+
+#define IS_SLASH(c) ((c) == '/')
+
+#endif
+
+#ifndef IS_ABSOLUTE_PATH
+#define IS_ABSOLUTE_PATH(path, len) \
+ (IS_SLASH(path[0]))
#endif
#if HAVE_UTIME