af_alg: Improve comments.
[gnulib.git] / lib / glob.in.h
blob656c1eb4814d752cf42ce663a8bc87a85e2aca3b
1 /* glob.h -- Find a path matching a pattern.
3 Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc.
5 Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU>
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.
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.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, see <https://www.gnu.org/licenses/>. */
20 #ifndef _@GUARD_PREFIX@_GLOB_H
22 #if __GNUC__ >= 3
23 @PRAGMA_SYSTEM_HEADER@
24 #endif
25 @PRAGMA_COLUMNS@
27 /* The include_next requires a split double-inclusion guard. */
28 #if !@REPLACE_GLOB@
29 # @INCLUDE_NEXT@ @NEXT_GLOB_H@
30 #endif
32 #ifndef _@GUARD_PREFIX@_GLOB_H
33 #define _@GUARD_PREFIX@_GLOB_H
35 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
37 /* GCC 2.95 and later have "__restrict"; C99 compilers have
38 "restrict", and "configure" may have defined "restrict".
39 Other compilers use __restrict, __restrict__, and _Restrict, and
40 'configure' might #define 'restrict' to those words, so pick a
41 different name. */
42 #ifndef _Restrict_
43 # if 199901L <= __STDC_VERSION__
44 # define _Restrict_ restrict
45 # elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
46 # define _Restrict_ __restrict
47 # else
48 # define _Restrict_
49 # endif
50 #endif
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 typedef int (*_gl_glob_errfunc_fn) (const char *, int);
56 #ifdef __cplusplus
58 #endif
61 #if @REPLACE_GLOB@
64 /* Preparations for including the standard GNU C Library header. */
66 # include <libc-config.h>
68 # include <stddef.h>
70 /* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64".
71 Make sure this definition is seen before glob-libc.h defines types that
72 rely on 'struct stat'. */
73 # include <sys/stat.h>
75 # ifndef __USE_GNU
76 # define __USE_GNU 1
77 # endif
79 # define glob rpl_glob
80 # define globfree rpl_globfree
81 # define glob_pattern_p rpl_glob_pattern_p
82 # define __glob_pattern_p glob_pattern_p
84 # define __GLOB_GNULIB 1
87 /* Now the standard GNU C Library header should work. */
88 # include "glob-libc.h"
91 # if defined __cplusplus && defined GNULIB_NAMESPACE
92 # undef glob
93 # undef globfree
94 # undef glob_pattern_p
95 _GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
96 _gl_glob_errfunc_fn __errfunc,
97 glob_t *_Restrict_ __pglob));
98 _GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob));
99 _GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote));
100 # endif
102 #else
104 _GL_CXXALIAS_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags,
105 _gl_glob_errfunc_fn __errfunc,
106 glob_t *_Restrict_ __pglob));
107 _GL_CXXALIAS_SYS (globfree, void, (glob_t *__pglob));
108 _GL_CXXALIAS_SYS (glob_pattern_p, int, (const char *__pattern, int __quote));
110 #endif
112 #if 0 /* The C function name is rpl_glob in some cases, not glob. */
113 _GL_CXXALIASWARN (glob);
114 _GL_CXXALIASWARN (globfree);
115 _GL_CXXALIASWARN (glob_pattern_p);
116 #endif
118 #endif /* _@GUARD_PREFIX@_GLOB_H */
119 #endif /* _@GUARD_PREFIX@_GLOB_H */