aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/libkern.h
diff options
context:
space:
mode:
authorDima Dorfman <dd@FreeBSD.org>2002-10-08 04:15:55 +0000
committerDima Dorfman <dd@FreeBSD.org>2002-10-08 04:15:55 +0000
commit20a6cb8cb86e021f553b86c2d43bcbc8a995bf0d (patch)
treeb4cc92ca4e8e38d896ee5d8b07b785e538d94644 /sys/sys/libkern.h
parentc4598a89161124933a59c542324478c0dd30b797 (diff)
downloadsrc-20a6cb8cb86e021f553b86c2d43bcbc8a995bf0d.tar.gz
src-20a6cb8cb86e021f553b86c2d43bcbc8a995bf0d.zip
Import the libc fnmatch() into the kernel. This will be used by,
among other things, the DEVFS rule subsystem to match nodes against a path pattern supplied by the user. fnmatch.c was repo-copied from src/lib/libc/gen/fnmatch.c, and the only changes to it are those necessary to make it compile in the kernel. The relevant parts of fnmatch.h were imported into libkern.h. Approved by: -arch
Notes
Notes: svn path=/head/; revision=104652
Diffstat (limited to 'sys/sys/libkern.h')
-rw-r--r--sys/sys/libkern.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h
index f050f06e2d3b..2ad98466ecb0 100644
--- a/sys/sys/libkern.h
+++ b/sys/sys/libkern.h
@@ -74,6 +74,7 @@ int ffs(int);
#ifndef HAVE_INLINE_FLS
int fls(int);
#endif
+int fnmatch(const char *, const char *, int);
int locc(int, char *, u_int);
void qsort(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *));
@@ -113,4 +114,16 @@ memset(void *b, int c, size_t len)
return (b);
}
+/* fnmatch() return values. */
+#define FNM_NOMATCH 1 /* Match failed. */
+
+/* fnmatch() flags. */
+#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
+#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
+#define FNM_PERIOD 0x04 /* Period must be matched by period. */
+#define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */
+#define FNM_CASEFOLD 0x10 /* Case insensitive search. */
+#define FNM_IGNORECASE FNM_CASEFOLD
+#define FNM_FILE_NAME FNM_PATHNAME
+
#endif /* !_SYS_LIBKERN_H_ */