From ca474e3041b3916d65ea8c3383da03de71c2405a Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Mon, 5 Sep 2011 16:26:25 +0000 Subject: Add fnmatch support to libkrb5support git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25153 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-platform.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/include') 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 #include #include +#ifdef HAVE_FNMATCH_H +#include +#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 / after Imatch. */ +#endif + /* Provide [v]asprintf interfaces. */ #ifndef HAVE_VSNPRINTF #ifdef _WIN32 -- cgit