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