diff options
author | Michele Calgaro <[email protected]> | 2024-08-17 22:26:29 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2024-08-18 23:02:35 +0900 |
commit | 3ccc8ad970ccf6e4c5e2abef212af44e17eb0fca (patch) | |
tree | ca31ef78594141e9a4c66cbfaac42d9a69ab8033 /kjs/regexp.h | |
parent | 8b5a45212267b1730a3b59a32067ec088216c725 (diff) | |
download | tdelibs-3ccc8ad970ccf6e4c5e2abef212af44e17eb0fca.tar.gz tdelibs-3ccc8ad970ccf6e4c5e2abef212af44e17eb0fca.zip |
kjs: use libpcre2 instead of libpcre
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit 7740e825a683a9cc84f8422c94109c5fcc4beb8e)
Diffstat (limited to 'kjs/regexp.h')
-rw-r--r-- | kjs/regexp.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/kjs/regexp.h b/kjs/regexp.h index 88851260e..e731eb714 100644 --- a/kjs/regexp.h +++ b/kjs/regexp.h @@ -25,13 +25,16 @@ #include "config.h" -#ifdef HAVE_PCREPOSIX -#include <pcre.h> +#ifdef HAVE_PCRE2POSIX +#define PCRE2_CODE_UNIT_WIDTH 8 +#include <pcre2.h> +typedef PCRE2_UCHAR8 buftype_t; #else // POSIX regex - not so good... extern "C" { // bug with some libc5 distributions #include <regex.h> +typedef char buftype_t; } -#endif //HAVE_PCREPOSIX +#endif #include "ustring.h" @@ -61,7 +64,7 @@ namespace KJS { bool valid; // Cached encoding info... - char* buffer; + buftype_t *buffer; int* originalPos; int bufferSize; @@ -71,22 +74,20 @@ namespace KJS { UString originalS; // the original string, used for sanity-checking #endif -#ifndef HAVE_PCREPOSIX +#ifndef HAVE_PCRE2POSIX regex_t preg; #else - pcre *pcregex; + pcre2_code *pcregex; + pcre2_match_data *match_data; enum UTF8SupportState { Unknown, Supported, Unsupported }; - -#ifdef PCRE_CONFIG_UTF8 static UTF8SupportState utf8Support; #endif -#endif - unsigned int nrSubPatterns; + uint32_t nrSubPatterns; RegExp(); }; |