xref: /php-src/ext/standard/php_dir_int.h (revision 5bb03158)
1 /*
2    +----------------------------------------------------------------------+
3    | Copyright (c) The PHP Group                                          |
4    +----------------------------------------------------------------------+
5    | This source file is subject to version 3.01 of the PHP license,      |
6    | that is bundled with this package in the file LICENSE, and is        |
7    | available through the world-wide-web at the following url:           |
8    | https://www.php.net/license/3_01.txt                                 |
9    | If you did not receive a copy of the PHP license and are unable to   |
10    | obtain it through the world-wide-web, please send a note to          |
11    | license@php.net so we can mail you a copy immediately.               |
12    +----------------------------------------------------------------------+
13  */
14 
15 #ifndef PHP_DIR_INT_H
16 #define PHP_DIR_INT_H
17 
18 #ifdef HAVE_GLOB
19 #ifndef PHP_WIN32
20 #include <glob.h>
21 #else
22 #include "win32/glob.h"
23 #endif
24 #endif
25 
26 #ifdef HAVE_GLOB
27 
28 #ifndef GLOB_BRACE
29 #define GLOB_BRACE 0
30 #endif
31 
32 #ifndef GLOB_ERR
33 #define GLOB_ERR 0
34 #endif
35 
36 #ifndef GLOB_MARK
37 #define GLOB_MARK 0
38 #endif
39 
40 #ifndef GLOB_NOCHECK
41 #define GLOB_NOCHECK 0
42 #endif
43 
44 #ifndef GLOB_NOESCAPE
45 #define GLOB_NOESCAPE 0
46 #endif
47 
48 #ifndef GLOB_NOSORT
49 #define GLOB_NOSORT 0
50 #endif
51 
52 #ifndef GLOB_ONLYDIR
53 #define GLOB_ONLYDIR (1<<30)
54 #define GLOB_EMULATE_ONLYDIR
55 #define GLOB_FLAGMASK (~GLOB_ONLYDIR)
56 #else
57 #define GLOB_FLAGMASK (~0)
58 #endif
59 
60 /* This is used for checking validity of passed flags (passing invalid flags causes segfault in glob()!! */
61 #define GLOB_AVAILABLE_FLAGS (0 | GLOB_BRACE | GLOB_MARK | GLOB_NOSORT | GLOB_NOCHECK | GLOB_NOESCAPE | GLOB_ERR | GLOB_ONLYDIR)
62 
63 #endif /* HAVE_GLOB */
64 
65 char dirsep_str[2], pathsep_str[2];
66 
67 #endif /* PHP_DIR_INT_H */
68