summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2011-09-05 16:26:25 +0000
committerGreg Hudson <ghudson@mit.edu>2011-09-05 16:26:25 +0000
commitca474e3041b3916d65ea8c3383da03de71c2405a (patch)
treeda4446d4c0d4e4afc7bf6649c60c3fe9f998e60b /src/include
parent889d3ca4c482f730cd194f2d83c41d70bc615a67 (diff)
downloadkrb5-ca474e3041b3916d65ea8c3383da03de71c2405a.tar.gz
krb5-ca474e3041b3916d65ea8c3383da03de71c2405a.tar.xz
krb5-ca474e3041b3916d65ea8c3383da03de71c2405a.zip
Add fnmatch support to libkrb5support
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25153 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r--src/include/k5-platform.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h
index 2f24ffaff..e9155cefb 100644
--- a/src/include/k5-platform.h
+++ b/src/include/k5-platform.h
@@ -35,6 +35,8 @@
* + shared library init/fini hooks
* + consistent getpwnam/getpwuid interfaces
* + va_copy fudged if not provided
+ * + strlcpy/strlcat
+ * + fnmatch
* + [v]asprintf
* + mkstemp
* + zap (support function; macro is in k5-int.h)
@@ -54,6 +56,9 @@
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
+#ifdef HAVE_FNMATCH_H
+#include <fnmatch.h>
+#endif
#ifdef _WIN32
#define CAN_COPY_VA_LIST
@@ -927,6 +932,20 @@ extern size_t krb5int_strlcpy(char *dst, const char *src, size_t siz);
extern size_t krb5int_strlcat(char *dst, const char *src, size_t siz);
#endif
+/* Provide fnmatch interface. */
+#ifndef HAVE_FNMATCH
+#define fnmatch k5_fnmatch
+int k5_fnmatch(const char *pattern, const char *string, int flags);
+#define FNM_NOMATCH 1 /* Match failed. */
+#define FNM_NOSYS 2 /* Function not implemented. */
+#define FNM_NORES 3 /* Out of resources */
+#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_CASEFOLD 0x08 /* Pattern is matched case-insensitive */
+#define FNM_LEADING_DIR 0x10 /* Ignore /<tail> after Imatch. */
+#endif
+
/* Provide [v]asprintf interfaces. */
#ifndef HAVE_VSNPRINTF
#ifdef _WIN32