#include <limits.h>
#include <errno.h>
#include <stdlib.h>
-#include <ctype.h>
#include <fcntl.h>
#ifdef ZEND_WIN32
#ifdef ZEND_WIN32
#define php_strtok_r(a,b,c) strtok((a),(b))
-#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
#define DEFAULT_SLASH '\\'
#define TOKENIZER_STRING "/\\"
-#define IS_ABSOLUTE_PATH(path, len) \
- (len >= 2 && isalpha(path[0]) && path[1] == ':')
-
#define COPY_WHEN_ABSOLUTE 2
static int php_check_dots(const char *element, int n)
#else
-#define IS_SLASH(c) ((c) == '/')
#define DEFAULT_SLASH '/'
#define TOKENIZER_STRING "/"
#endif
/* default macros */
-#ifndef IS_ABSOLUTE_PATH
-#define IS_ABSOLUTE_PATH(path, len) \
- (IS_SLASH(path[0]))
-#endif
-
#ifndef IS_DIRECTORY_UP
#define IS_DIRECTORY_UP(element, len) \
(len == 2 && memcmp(element, "..", 2) == 0)
#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