Commit | Line | Data |
---|---|---|
6ec2e0f5 SDJ |
1 | /* glob.h -- Find a path matching a pattern. |
2 | ||
5e8754f9 | 3 | Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc. |
6ec2e0f5 SDJ |
4 | |
5 | Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU> | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 3, or (at your option) | |
10 | any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
5e8754f9 | 18 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ |
6ec2e0f5 | 19 | |
5e8754f9 SDJ |
20 | #ifndef _GL_GLOB_H |
21 | #define _GL_GLOB_H | |
6ec2e0f5 | 22 | |
5e8754f9 SDJ |
23 | #if @HAVE_SYS_CDEFS_H@ |
24 | # include <sys/cdefs.h> | |
6ec2e0f5 SDJ |
25 | #endif |
26 | ||
5e8754f9 | 27 | #include <stddef.h> |
7a6dbc2f | 28 | |
5e8754f9 SDJ |
29 | /* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64". |
30 | Make sure this definition is seen before glob-libc.h defines types that | |
31 | rely on 'struct stat'. */ | |
32 | #include <sys/stat.h> | |
7a6dbc2f | 33 | |
5e8754f9 SDJ |
34 | #ifndef __BEGIN_DECLS |
35 | # ifdef __cplusplus | |
36 | # define __BEGIN_DECLS extern "C" { | |
37 | # define __END_DECLS } | |
6ec2e0f5 | 38 | # else |
5e8754f9 SDJ |
39 | # define __BEGIN_DECLS |
40 | # define __END_DECLS | |
6ec2e0f5 SDJ |
41 | # endif |
42 | #endif | |
5e8754f9 SDJ |
43 | #ifndef __THROW |
44 | # define __THROW | |
6ec2e0f5 | 45 | #endif |
5e8754f9 SDJ |
46 | #ifndef __THROWNL |
47 | # define __THROWNL | |
6ec2e0f5 SDJ |
48 | #endif |
49 | ||
5e8754f9 | 50 | /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ |
6ec2e0f5 | 51 | |
5e8754f9 | 52 | /* The definition of _GL_ARG_NONNULL is copied here. */ |
7a6dbc2f | 53 | |
5e8754f9 | 54 | /* The definition of _GL_WARN_ON_USE is copied here. */ |
6ec2e0f5 | 55 | |
5e8754f9 SDJ |
56 | #ifndef __size_t |
57 | # define __size_t size_t | |
58 | #endif | |
59 | #ifndef __USE_GNU | |
60 | # define __USE_GNU 1 | |
61 | #endif | |
6ec2e0f5 | 62 | |
7a6dbc2f | 63 | |
5e8754f9 SDJ |
64 | #define glob rpl_glob |
65 | #define globfree rpl_globfree | |
66 | #define glob_pattern_p rpl_glob_pattern_p | |
6ec2e0f5 | 67 | |
5e8754f9 | 68 | #define __GLOB_GNULIB 1 |
6ec2e0f5 SDJ |
69 | |
70 | /* Now the standard GNU C Library header should work. */ | |
5e8754f9 | 71 | #include "glob-libc.h" |
7a6dbc2f | 72 | |
5e8754f9 SDJ |
73 | __BEGIN_DECLS |
74 | typedef int (*_gl_glob_errfunc_fn) (const char *, int); | |
75 | __END_DECLS | |
7a6dbc2f | 76 | |
5e8754f9 SDJ |
77 | #if defined __cplusplus && defined GNULIB_NAMESPACE |
78 | # undef glob | |
79 | # undef globfree | |
80 | # undef glob_pattern_p | |
6ec2e0f5 SDJ |
81 | _GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags, |
82 | _gl_glob_errfunc_fn __errfunc, | |
83 | glob_t *_Restrict_ __pglob)); | |
7a6dbc2f | 84 | _GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob)); |
7a6dbc2f | 85 | _GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote)); |
5e8754f9 SDJ |
86 | # if 0 /* The C function name is rpl_glob, not glob. */ |
87 | _GL_CXXALIASWARN (glob); | |
88 | _GL_CXXALIASWARN (globfree); | |
6ec2e0f5 SDJ |
89 | _GL_CXXALIASWARN (glob_pattern_p); |
90 | # endif | |
91 | #endif | |
92 | ||
5e8754f9 | 93 | #endif /* _GL_GLOB_H */ |