summaryrefslogtreecommitdiffstats
path: root/kjs/regexp.h
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2024-08-17 22:26:29 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-08-18 20:14:02 +0900
commit7740e825a683a9cc84f8422c94109c5fcc4beb8e (patch)
tree0f4cb4d307e3536232cea590e607d14f9edb5e76 /kjs/regexp.h
parentb59d51c67903335d27ada24d51be77137f664cb3 (diff)
downloadtdelibs-7740e825a683a9cc84f8422c94109c5fcc4beb8e.tar.gz
tdelibs-7740e825a683a9cc84f8422c94109c5fcc4beb8e.zip
kjs: use libpcre2 instead of libpcre
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kjs/regexp.h')
-rw-r--r--kjs/regexp.h21
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();
};