Blender  V2.93
BLI_fnmatch.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
17  *
18  * NOTE: The canonical source of this file is maintained with the GNU C Library.
19  * Bugs can be reported to <bug-glibc@prep.ai.mit.edu>.
20  */
21 
22 #pragma once
23 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #if defined WIN32 && !defined _LIBC
33 
34 # if defined(__cplusplus) || (defined(__STDC__) && __STDC__)
35 # undef __P
36 # define __P(protos) protos
37 # else /* Not C++ or ANSI C. */
38 # undef __P
39 # define __P(protos) ()
40 /* We can get away without defining `const' here only because in this file
41  * it is used only inside the prototype for `fnmatch', which is elided in
42  * non-ANSI C where `const' is problematical. */
43 # endif /* C++ or ANSI C. */
44 
45 /* We #undef these before defining them because some losing systems
46  * (HP-UX A.08.07 for example) define these in <unistd.h>. */
47 # undef FNM_PATHNAME
48 # undef FNM_NOESCAPE
49 # undef FNM_PERIOD
50 
51 /* Bits set in the FLAGS argument to `fnmatch'. */
52 # define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
53 # define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
54 # define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
55 
56 # if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined(_GNU_SOURCE)
57 # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
58 # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
59 # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
60 # endif
61 
62 /* Value returned by `fnmatch' if STRING does not match PATTERN. */
63 # define FNM_NOMATCH 1
64 
65 /* Match STRING against the filename pattern PATTERN,
66  * returning zero if it matches, FNM_NOMATCH if not. */
67 extern int fnmatch __P((const char *__pattern, const char *__string, int __flags));
68 
69 #else
70 # ifndef _GNU_SOURCE
71 # define _GNU_SOURCE
72 # endif
73 # include <fnmatch.h>
74 #endif /* defined WIN32 && !defined _LIBC */
75 
76 #ifdef __cplusplus
77 }
78 #endif