Blender V5.0
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
12
13#if defined WIN32 && !defined _LIBC
14
15# undef __P
16# define __P(protos) protos
17
18/* We #undef these before defining them because some losing systems
19 * (HP-UX A.08.07 for example) define these in <unistd.h>. */
20# undef FNM_PATHNAME
21# undef FNM_NOESCAPE
22# undef FNM_PERIOD
23
24/* Bits set in the FLAGS argument to `fnmatch'. */
25# define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
26# define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
27# define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
28
29# if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined(_GNU_SOURCE)
30# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
31# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
32# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
33# endif
34
35/* Value returned by `fnmatch' if STRING does not match PATTERN. */
36# define FNM_NOMATCH 1
37
38/* Match STRING against the filename pattern PATTERN,
39 * returning zero if it matches, FNM_NOMATCH if not. */
40extern int fnmatch __P((const char *__pattern, const char *__string, int __flags));
41
42#else
43# ifndef _GNU_SOURCE
44# define _GNU_SOURCE
45# endif
46# include <fnmatch.h> // IWYU pragma: export
47#endif /* defined WIN32 && !defined _LIBC */