73cbaa5bcc2c3befcec5b9b3d4bf77f8329eb418
[gnulib.git] / lib / glob.in.h
1 /* glob.h -- Find a path matching a pattern.
2
3    Copyright (C) 2005-2007, 2009-2013 Free Software Foundation, Inc.
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 2, 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
18    along with this program; if not, see <http://www.gnu.org/licenses/>.  */
19
20 #ifndef _GL_GLOB_H
21 #define _GL_GLOB_H
22
23 #if @HAVE_SYS_CDEFS_H@
24 # include <sys/cdefs.h>
25 #endif
26
27 #include <stddef.h>
28
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>
33
34 #ifndef __BEGIN_DECLS
35 # ifdef __cplusplus
36 #  define __BEGIN_DECLS  extern "C" {
37 #  define __END_DECLS    }
38 # else
39 #  define __BEGIN_DECLS
40 #  define __END_DECLS
41 # endif
42 #endif
43 #ifndef __THROW
44 # define __THROW
45 #ifndef __THROWNL
46 # define __THROWNL
47 #endif
48
49 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
50
51 /* The definition of _GL_ARG_NONNULL is copied here.  */
52
53 /* The definition of _GL_WARN_ON_USE is copied here.  */
54
55 #ifndef __size_t
56 # define __size_t       size_t
57 #endif
58 #ifndef __USE_GNU
59 # define __USE_GNU    1
60 #endif
61
62
63 #define glob rpl_glob
64 #define globfree rpl_globfree
65 #define glob_pattern_p rpl_glob_pattern_p
66
67 #define __GLOB_GNULIB 1
68
69 /* Now the standard GNU C Library header should work.  */
70 #include "glob-libc.h"
71
72 __BEGIN_DECLS
73 typedef int (*_gl_glob_errfunc_fn) (const char *, int);
74 __END_DECLS
75
76 #if defined __cplusplus && defined GNULIB_NAMESPACE
77 # undef glob
78 # undef globfree
79 # undef glob_pattern_p
80 _GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
81                               _gl_glob_errfunc_fn __errfunc,
82                               glob_t *_Restrict_ __pglob));
83 _GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob));
84 _GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote));
85 # if 0  /* The C function name is rpl_glob, not glob.  */
86 _GL_CXXALIASWARN (glob);
87 _GL_CXXALIASWARN (globfree);
88 _GL_CXXALIASWARN (glob_pattern_p);
89 # endif
90 #endif
91
92 #endif /* _GL_GLOB_H */