diff --git a/src/driver/common/wildmatch.c b/src/3rdparty/wildmatch/wildmatch.c similarity index 98% rename from src/driver/common/wildmatch.c rename to src/3rdparty/wildmatch/wildmatch.c index 7eb138b5..f122f305 100644 --- a/src/driver/common/wildmatch.c +++ b/src/3rdparty/wildmatch/wildmatch.c @@ -63,7 +63,7 @@ const uchar sane_ctype[256] = { #define is_glob_special(x) (ISASCII(x) && sane_istest(x, GIT_GLOB_SPECIAL)) /* Match the "pattern" against the "text" string. */ -FORT_API int wildmatch(const wm_char *pattern, const wm_char *text) +WILDMATCH_API int wildmatch(const wm_char *pattern, const wm_char *text) { const wm_char *p = pattern; wm_char p_ch; diff --git a/src/driver/common/wildmatch.h b/src/3rdparty/wildmatch/wildmatch.h similarity index 71% rename from src/driver/common/wildmatch.h rename to src/3rdparty/wildmatch/wildmatch.h index 5a07b6b8..8eae1a77 100644 --- a/src/driver/common/wildmatch.h +++ b/src/3rdparty/wildmatch/wildmatch.h @@ -1,20 +1,16 @@ #ifndef WILDMATCH_H #define WILDMATCH_H -#include "common.h" - #define WM_NOMATCH 1 #define WM_MATCH 0 #define WM_ABORT_ALL -1 #define WM_ABORT_TO_STARSTAR -2 -typedef WCHAR wm_char; - #if defined(__cplusplus) extern "C" { #endif -FORT_API int wildmatch(const wm_char *pattern, const wm_char *text); +WILDMATCH_API int wildmatch(const wm_char *pattern, const wm_char *text); #ifdef __cplusplus } // extern "C" diff --git a/src/driver/Driver.pri b/src/driver/Driver.pri index fdf7ddef..e0f9cbfe 100644 --- a/src/driver/Driver.pri +++ b/src/driver/Driver.pri @@ -4,7 +4,7 @@ SOURCES += \ $$PWD/common/fortconf.c \ $$PWD/common/fortlog.c \ $$PWD/common/fortprov.c \ - $$PWD/common/wildmatch.c + $$PWD/common/fort_wildmatch.c HEADERS += \ $$PWD/common/common.h \ @@ -14,4 +14,4 @@ HEADERS += \ $$PWD/common/fortioctl.h \ $$PWD/common/fortlog.h \ $$PWD/common/fortprov.h \ - $$PWD/common/wildmatch.h + $$PWD/common/fort_wildmatch.h diff --git a/src/driver/common/fort_wildmatch.c b/src/driver/common/fort_wildmatch.c new file mode 100644 index 00000000..7e6de08c --- /dev/null +++ b/src/driver/common/fort_wildmatch.c @@ -0,0 +1,5 @@ +/* Fort Firewall WildMatch */ + +#include "fort_wildmatch.h" + +#include "../../3rdparty/wildmatch/wildmatch.c" diff --git a/src/driver/common/fort_wildmatch.h b/src/driver/common/fort_wildmatch.h new file mode 100644 index 00000000..67c0d86b --- /dev/null +++ b/src/driver/common/fort_wildmatch.h @@ -0,0 +1,12 @@ +#ifndef FORT_WILDMATCH_H +#define FORT_WILDMATCH_H + +#include "common.h" + +#define WILDMATCH_API FORT_API + +typedef WCHAR wm_char; + +#include "../../3rdparty/wildmatch/wildmatch.h" + +#endif // FORT_WILDMATCH_H diff --git a/src/driver/common/fortconf.c b/src/driver/common/fortconf.c index 868da74d..874dded0 100644 --- a/src/driver/common/fortconf.c +++ b/src/driver/common/fortconf.c @@ -5,7 +5,7 @@ #include #include "fortdef.h" -#include "wildmatch.h" +#include "fort_wildmatch.h" static_assert(sizeof(FORT_CONF_FLAGS) == sizeof(UINT32), "FORT_CONF_FLAGS size mismatch"); static_assert(sizeof(FORT_TRAF) == sizeof(UINT64), "FORT_TRAF size mismatch"); diff --git a/src/driver/fortdrv_amalg.c b/src/driver/fortdrv_amalg.c index deabd7b7..03856062 100644 --- a/src/driver/fortdrv_amalg.c +++ b/src/driver/fortdrv_amalg.c @@ -11,7 +11,7 @@ #include "common/fortconf.c" #include "common/fortlog.c" #include "common/fortprov.c" -#include "common/wildmatch.c" +#include "common/fort_wildmatch.c" #include "loader/fortmm_imp.c" #include "proxycb/fortpcb_dst.c"