diff options
Diffstat (limited to 'kjs/regexp.h')
| -rw-r--r-- | kjs/regexp.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/kjs/regexp.h b/kjs/regexp.h index 3a14728d0..d84fca17c 100644 --- a/kjs/regexp.h +++ b/kjs/regexp.h @@ -1,4 +1,3 @@ -// -*- c-basic-offset: 2 -*- /* * This file is part of the KDE libraries * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) @@ -22,17 +21,21 @@ #ifndef _KJS_REGEXP_H_ #define _KJS_REGEXP_H_ +#include <stdint.h> #include <sys/types.h> #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" @@ -62,7 +65,7 @@ namespace KJS { bool valid; // Cached encoding info... - char* buffer; + buftype_t *buffer; int* originalPos; int bufferSize; @@ -72,22 +75,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(); }; |
