Blender  V3.3
BLI_fnmatch.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 1991 1992 1993 Free Software Foundation, Inc. */
3 
4 #pragma once
5 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #if defined WIN32 && !defined _LIBC
17 
18 # if defined(__cplusplus) || (defined(__STDC__) && __STDC__)
19 # undef __P
20 # define __P(protos) protos
21 # else /* Not C++ or ANSI C. */
22 # undef __P
23 # define __P(protos) ()
24 /* We can get away without defining `const' here only because in this file
25  * it is used only inside the prototype for `fnmatch', which is elided in
26  * non-ANSI C where `const' is problematical. */
27 # endif /* C++ or ANSI C. */
28 
29 /* We #undef these before defining them because some losing systems
30  * (HP-UX A.08.07 for example) define these in <unistd.h>. */
31 # undef FNM_PATHNAME
32 # undef FNM_NOESCAPE
33 # undef FNM_PERIOD
34 
35 /* Bits set in the FLAGS argument to `fnmatch'. */
36 # define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
37 # define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
38 # define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
39 
40 # if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined(_GNU_SOURCE)
41 # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
42 # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
43 # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
44 # endif
45 
46 /* Value returned by `fnmatch' if STRING does not match PATTERN. */
47 # define FNM_NOMATCH 1
48 
49 /* Match STRING against the filename pattern PATTERN,
50  * returning zero if it matches, FNM_NOMATCH if not. */
51 extern int fnmatch __P((const char *__pattern, const char *__string, int __flags));
52 
53 #else
54 # ifndef _GNU_SOURCE
55 # define _GNU_SOURCE
56 # endif
57 # include <fnmatch.h>
58 #endif /* defined WIN32 && !defined _LIBC */
59 
60 #ifdef __cplusplus
61 }
62 #endif