Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sudo-project
GitHub Repository: sudo-project/sudo
Path: blob/main/include/compat/fnmatch.h
1532 views
1
/*
2
* SPDX-License-Identifier: ISC
3
*
4
* Copyright (c) 2011 Todd C. Miller <[email protected]>
5
*
6
* Permission to use, copy, modify, and distribute this software for any
7
* purpose with or without fee is hereby granted, provided that the above
8
* copyright notice and this permission notice appear in all copies.
9
*
10
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
*/
18
19
#ifndef COMPAT_FNMATCH_H
20
#define COMPAT_FNMATCH_H
21
22
#define FNM_NOMATCH 1 /* String does not match pattern */
23
24
#define FNM_PATHNAME (1 << 0) /* Globbing chars don't match '/' */
25
#define FNM_PERIOD (1 << 1) /* Leading '.' in string must exactly */
26
#define FNM_NOESCAPE (1 << 2) /* Backslash treated as ordinary char */
27
#define FNM_LEADING_DIR (1 << 3) /* Only match the leading directory */
28
#define FNM_CASEFOLD (1 << 4) /* Case insensitive matching */
29
30
sudo_dso_public int sudo_fnmatch(const char *pattern, const char *string, int flags);
31
32
#define fnmatch(_a, _b, _c) sudo_fnmatch((_a), (_b), (_c))
33
34
#endif /* COMPAT_FNMATCH_H */
35
36