3535 * @(#)glob.h 8.1 (Berkeley) 6/2/93
3636 */
3737
38+ #ifdef PHP_WIN32
39+ #include "config.w32.h"
40+ #else
41+ #include <php_config.h>
42+ #endif
43+
44+ #ifndef _PHP_GLOB_H_
45+ #define _PHP_GLOB_H_
46+
3847#if defined(HAVE_GLOB ) && defined(PHP_SYSTEM_GLOB )
3948#include <glob.h>
4049
50+ #ifdef GLOB_APPEND
51+ #define PHP_GLOB_APPEND GLOB_APPEND
52+ #endif
53+ #ifdef GLOB_DOOFFS
54+ #define PHP_GLOB_DOOFFS GLOB_DOOFFS
55+ #endif
56+ #ifdef GLOB_ERR
57+ #define PHP_GLOB_ERR GLOB_ERR
58+ #endif
59+ #ifdef GLOB_MARK
60+ #define PHP_GLOB_MARK GLOB_MARK
61+ #endif
62+ #ifdef GLOB_NOCHECK
63+ #define PHP_GLOB_NOCHECK GLOB_NOCHECK
64+ #endif
65+ #ifdef GLOB_NOSORT
66+ #define PHP_GLOB_NOSORT GLOB_NOSORT
67+ #endif
68+ #ifdef GLOB_NOESCAPE
69+ #define PHP_GLOB_NOESCAPE GLOB_NOESCAPE
70+ #endif
71+ #ifdef GLOB_NOSPACE
72+ #define PHP_GLOB_NOSPACE GLOB_NOSPACE
73+ #endif
74+ #ifdef GLOB_ABORTED
75+ #define PHP_GLOB_ABORTED GLOB_ABORTED
76+ #endif
77+ #ifdef GLOB_NOMATCH
78+ #define PHP_GLOB_NOMATCH GLOB_NOMATCH
79+ #endif
80+ #ifdef GLOB_NOSYS
81+ #define PHP_GLOB_NOSYS GLOB_NOSYS
82+ #endif
83+ #ifdef GLOB_ALTDIRFUNC
84+ #define PHP_GLOB_ALTDIRFUNC GLOB_ALTDIRFUNC
85+ #endif
86+ #ifdef GLOB_BRACE
87+ #define PHP_GLOB_BRACE GLOB_BRACE
88+ #endif
89+ #ifdef GLOB_MAGCHAR
90+ #define PHP_GLOB_MAGCHAR GLOB_MAGCHAR
91+ #endif
92+ #ifdef GLOB_NOMAGIC
93+ #define PHP_GLOB_NOMAGIC GLOB_NOMAGIC
94+ #endif
95+ #ifdef GLOB_QUOTE
96+ #define PHP_GLOB_QUOTE GLOB_QUOTE
97+ #endif
98+ #ifdef GLOB_TILDE
99+ #define PHP_GLOB_TILDE GLOB_TILDE
100+ #endif
101+ #ifdef GLOB_LIMIT
102+ #define PHP_GLOB_LIMIT GLOB_LIMIT
103+ #endif
104+ #ifdef GLOB_KEEPSTAT
105+ #define PHP_GLOB_KEEPSTAT GLOB_KEEPSTAT
106+ #endif
107+
41108#define php_glob_t glob_t
42109#define php_glob glob
43- #define php_globfree
110+ #define php_globfree globfree
44111#else
45112
46- #ifndef _PHP_GLOB_H_
47- #define _PHP_GLOB_H_
113+ #include "php.h"
48114
49115#ifndef PHP_WIN32
50116# include <sys/cdefs.h>
@@ -102,7 +168,7 @@ PHPAPI int php_glob(const char *__restrict, int, int (*)(const char *, int),
102168PHPAPI void php_globfree (php_glob_t * );
103169END_EXTERN_C ()
104170
105- #endif /* !_GLOB_H_ */
171+ #endif /* defined(HAVE_GLOB) */
106172
107173/* These were copied from dir and zip */
108174
@@ -115,4 +181,4 @@ END_EXTERN_C()
115181
116182#define PHP_GLOB_AVAILABLE_FLAGS (0 | PHP_GLOB_BRACE | PHP_GLOB_MARK | PHP_GLOB_NOSORT | PHP_GLOB_NOCHECK | PHP_GLOB_NOESCAPE | PHP_GLOB_ERR | PHP_GLOB_ONLYDIR)
117183
118- #endif /* defined(HAVE_GLOB) */
184+ #endif /* !_GLOB_H_ */
0 commit comments