From 60a7a800b3b8fb17e01c2a0f0d51043fc37bd9be Mon Sep 17 00:00:00 2001 From: ddkilzer Date: Mon, 1 Jan 2007 05:07:40 +0000 Subject: [PATCH] JavaScriptCore: Reviewed by Geoff. Update embedded pcre library from version 6.2 to 6.4. Changes from pcre 6.2 to 6.3 did not include any files in JavaScriptCore/pcre. All changes include renaming EXPORT to PCRE_EXPORT, renaming of ucp_findchar() to _pcre_ucp_findchar(), or comment changes. Additional changes noted below. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated source file list. * JavaScriptCore.xcodeproj/project.pbxproj: Renamed pcre_printint.c to pcre_printint.src and changed it from a source file to a header file. * JavaScriptCoreSources.bkl: Updated source file list. * pcre/CMakeLists.txt: Updated source file list. * pcre/pcre-config.h: * pcre/pcre.h: Updated version. * pcre/pcre.pri: Updated source file list. * pcre/pcre_compile.c: Include pcre_printint.src #if DEBUG. (pcre_compile2): * pcre/pcre_config.c: * pcre/pcre_exec.c: (match): * pcre/pcre_fullinfo.c: * pcre/pcre_info.c: * pcre/pcre_internal.h: Added header guard. Removed export of _pcre_printint(). * pcre/pcre_ord2utf8.c: * pcre/pcre_printint.c: Renamed to pcre_printint.src. * pcre/pcre_printint.src: Added. Renamed _pcre_printint() to pcre_printint(). * pcre/pcre_refcount.c: * pcre/pcre_study.c: * pcre/pcre_tables.c: * pcre/pcre_try_flipped.c: * pcre/pcre_ucp_findchar.c: Added contents of ucp_findchar.c. * pcre/pcre_version.c: * pcre/pcre_xclass.c: (_pcre_xclass): * pcre/ucp.h: Removed export of ucp_findchar(). * pcre/ucp_findchar.c: Removed. Contents moved to pcre_ucp_findchar.c. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@18498 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- JavaScriptCore/ChangeLog | 40 +++++ .../JavaScriptCore/JavaScriptCore.vcproj | 6 +- .../JavaScriptCore.xcodeproj/project.pbxproj | 8 +- JavaScriptCore/JavaScriptCoreSources.bkl | 2 - JavaScriptCore/pcre/CMakeLists.txt | 2 - JavaScriptCore/pcre/pcre-config.h | 2 +- JavaScriptCore/pcre/pcre.h | 4 +- JavaScriptCore/pcre/pcre.pri | 2 - JavaScriptCore/pcre/pcre_compile.c | 18 +- JavaScriptCore/pcre/pcre_config.c | 2 +- JavaScriptCore/pcre/pcre_exec.c | 36 ++-- JavaScriptCore/pcre/pcre_fullinfo.c | 2 +- JavaScriptCore/pcre/pcre_info.c | 2 +- JavaScriptCore/pcre/pcre_internal.h | 30 ++-- JavaScriptCore/pcre/pcre_ord2utf8.c | 2 +- .../{pcre_printint.c => pcre_printint.src} | 15 +- JavaScriptCore/pcre/pcre_refcount.c | 2 +- JavaScriptCore/pcre/pcre_study.c | 2 +- JavaScriptCore/pcre/pcre_tables.c | 7 +- JavaScriptCore/pcre/pcre_try_flipped.c | 2 +- JavaScriptCore/pcre/pcre_ucp_findchar.c | 114 ++++++++++++- JavaScriptCore/pcre/pcre_version.c | 2 +- JavaScriptCore/pcre/pcre_xclass.c | 4 +- JavaScriptCore/pcre/ucp.h | 6 +- JavaScriptCore/pcre/ucp_findchar.c | 160 ------------------ 25 files changed, 231 insertions(+), 241 deletions(-) rename JavaScriptCore/pcre/{pcre_printint.c => pcre_printint.src} (96%) delete mode 100644 JavaScriptCore/pcre/ucp_findchar.c diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog index 040c7594d38..0aea8077a01 100644 --- a/JavaScriptCore/ChangeLog +++ b/JavaScriptCore/ChangeLog @@ -1,3 +1,43 @@ +2006-12-31 David Kilzer + + Reviewed by Geoff. + + Update embedded pcre library from version 6.2 to 6.4. Changes from pcre 6.2 to 6.3 + did not include any files in JavaScriptCore/pcre. + + All changes include renaming EXPORT to PCRE_EXPORT, renaming of ucp_findchar() to + _pcre_ucp_findchar(), or comment changes. Additional changes noted below. + + * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated source file list. + * JavaScriptCore.xcodeproj/project.pbxproj: Renamed pcre_printint.c to pcre_printint.src + and changed it from a source file to a header file. + * JavaScriptCoreSources.bkl: Updated source file list. + * pcre/CMakeLists.txt: Updated source file list. + * pcre/pcre-config.h: + * pcre/pcre.h: Updated version. + * pcre/pcre.pri: Updated source file list. + * pcre/pcre_compile.c: Include pcre_printint.src #if DEBUG. + (pcre_compile2): + * pcre/pcre_config.c: + * pcre/pcre_exec.c: + (match): + * pcre/pcre_fullinfo.c: + * pcre/pcre_info.c: + * pcre/pcre_internal.h: Added header guard. Removed export of _pcre_printint(). + * pcre/pcre_ord2utf8.c: + * pcre/pcre_printint.c: Renamed to pcre_printint.src. + * pcre/pcre_printint.src: Added. Renamed _pcre_printint() to pcre_printint(). + * pcre/pcre_refcount.c: + * pcre/pcre_study.c: + * pcre/pcre_tables.c: + * pcre/pcre_try_flipped.c: + * pcre/pcre_ucp_findchar.c: Added contents of ucp_findchar.c. + * pcre/pcre_version.c: + * pcre/pcre_xclass.c: + (_pcre_xclass): + * pcre/ucp.h: Removed export of ucp_findchar(). + * pcre/ucp_findchar.c: Removed. Contents moved to pcre_ucp_findchar.c. + 2006-12-29 David Kilzer Reviewed by Geoff. diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj index 760c0355bb0..8f917eccbfd 100644 --- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj +++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj @@ -565,7 +565,7 @@ > - - diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj index 40d5849fad5..6ec1aa84d76 100644 --- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj +++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj @@ -256,7 +256,7 @@ 93E26BFE08B151D400F85226 /* ucpinternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E26BFC08B151D400F85226 /* ucpinternal.h */; }; 93E26C1308B1523D00F85226 /* ucptable.c in Headers */ = {isa = PBXBuildFile; fileRef = 93E26C0D08B1520900F85226 /* ucptable.c */; }; 93E26CF708B29A1C00F85226 /* pcre_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 93E26CF608B29A1C00F85226 /* pcre_get.c */; }; - 93E26DDC08B2A4F400F85226 /* pcre_printint.c in Sources */ = {isa = PBXBuildFile; fileRef = 93E26DDB08B2A4F400F85226 /* pcre_printint.c */; }; + 93E26DDC08B2A4F400F85226 /* pcre_printint.src in Headers */ = {isa = PBXBuildFile; fileRef = 93E26DDB08B2A4F400F85226 /* pcre_printint.src */; }; 93F0B3AB09BB4DC00068FCE3 /* Parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F0B3A909BB4DC00068FCE3 /* Parser.cpp */; }; 93F0B3AC09BB4DC00068FCE3 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; }; BCF655590A2049710038A194 /* MathExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF6553B0A2048DE0038A194 /* MathExtras.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -595,7 +595,7 @@ 93E26BFC08B151D400F85226 /* ucpinternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = ucpinternal.h; path = pcre/ucpinternal.h; sourceTree = ""; tabWidth = 8; }; 93E26C0D08B1520900F85226 /* ucptable.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; indentWidth = 4; name = ucptable.c; path = pcre/ucptable.c; sourceTree = ""; tabWidth = 8; }; 93E26CF608B29A1C00F85226 /* pcre_get.c */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.c; name = pcre_get.c; path = pcre/pcre_get.c; sourceTree = ""; tabWidth = 8; }; - 93E26DDB08B2A4F400F85226 /* pcre_printint.c */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.c; name = pcre_printint.c; path = pcre/pcre_printint.c; sourceTree = ""; tabWidth = 8; }; + 93E26DDB08B2A4F400F85226 /* pcre_printint.src */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = pcre_printint.src; path = pcre/pcre_printint.src; sourceTree = ""; tabWidth = 8; }; 93F0B3A909BB4DC00068FCE3 /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Parser.cpp; sourceTree = ""; }; 93F0B3AA09BB4DC00068FCE3 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parser.h; sourceTree = ""; }; 93F1981A08245AAE001E9ABC /* keywords.table */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = keywords.table; sourceTree = ""; tabWidth = 8; }; @@ -1024,7 +1024,7 @@ 930754D108B0F76200AB3056 /* pcre_globals.c */, 93E26BE508B1517100F85226 /* pcre_internal.h */, 93E26BC908B1511900F85226 /* pcre_ord2utf8.c */, - 93E26DDB08B2A4F400F85226 /* pcre_printint.c */, + 93E26DDB08B2A4F400F85226 /* pcre_printint.src */, 930754CE08B0F74500AB3056 /* pcre_tables.c */, 93E26BD008B1513800F85226 /* pcre_try_flipped.c */, 93E26BCD08B1512600F85226 /* pcre_ucp_findchar.c */, @@ -1149,6 +1149,7 @@ 932FC11D0824A6A3005B3C75 /* create_hash_table in Headers */, 65621E6E089E859700760F35 /* property_slot.h in Headers */, 93E26BE608B1517100F85226 /* pcre_internal.h in Headers */, + 93E26DDC08B2A4F400F85226 /* pcre_printint.src in Headers */, 93E26BFD08B151D400F85226 /* ucp.h in Headers */, 93E26BFE08B151D400F85226 /* ucpinternal.h in Headers */, 93E26C1308B1523D00F85226 /* ucptable.c in Headers */, @@ -1487,7 +1488,6 @@ 93E26BD108B1513800F85226 /* pcre_try_flipped.c in Sources */, 93E26BD408B1514100F85226 /* pcre_xclass.c in Sources */, 93E26CF708B29A1C00F85226 /* pcre_get.c in Sources */, - 93E26DDC08B2A4F400F85226 /* pcre_printint.c in Sources */, 65E217BE08E7EECC0023E5F6 /* Assertions.cpp in Sources */, 65E217BF08E7EECC0023E5F6 /* FastMalloc.cpp in Sources */, 6541BD7408E80A17002CBEE7 /* TCSystemAlloc.cpp in Sources */, diff --git a/JavaScriptCore/JavaScriptCoreSources.bkl b/JavaScriptCore/JavaScriptCoreSources.bkl index b280b1c43d1..340e5cb84ec 100644 --- a/JavaScriptCore/JavaScriptCoreSources.bkl +++ b/JavaScriptCore/JavaScriptCoreSources.bkl @@ -60,7 +60,6 @@ pcre/pcre_info.c pcre/pcre_maketables.c pcre/pcre_ord2utf8.c - pcre/pcre_printint.c pcre/pcre_refcount.c pcre/pcre_study.c pcre/pcre_tables.c @@ -68,7 +67,6 @@ pcre/pcre_ucp_findchar.c pcre/pcre_version.c pcre/pcre_xclass.c - pcre/ucp_findchar.c diff --git a/JavaScriptCore/pcre/CMakeLists.txt b/JavaScriptCore/pcre/CMakeLists.txt index 5956a2b6284..f65f1570780 100644 --- a/JavaScriptCore/pcre/CMakeLists.txt +++ b/JavaScriptCore/pcre/CMakeLists.txt @@ -21,7 +21,6 @@ set(pcre-unity_LIB_SRCS ${pcre-unity_LIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/chartables.c pcre_get.c - pcre_printint.c pcre_refcount.c pcre_ucp_findchar.c pcre_compile.c @@ -32,7 +31,6 @@ set(pcre-unity_LIB_SRCS pcre_study.c pcre_exec.c pcre_xclass.c - ucp_findchar.c pcre_tables.c pcre_maketables.c pcre_try_flipped.c diff --git a/JavaScriptCore/pcre/pcre-config.h b/JavaScriptCore/pcre/pcre-config.h index 5371c25a926..547c250a0d4 100644 --- a/JavaScriptCore/pcre/pcre-config.h +++ b/JavaScriptCore/pcre/pcre-config.h @@ -20,7 +20,7 @@ this can be done via --enable-ebcdic. */ before the definition of an exported function, define this macro to contain the relevant magic. It apears at the start of every exported function. */ -#define EXPORT +#define PCRE_EXPORT /* Define to empty if the "const" keyword does not work. */ diff --git a/JavaScriptCore/pcre/pcre.h b/JavaScriptCore/pcre/pcre.h index 340511d8b55..290231cfdbc 100644 --- a/JavaScriptCore/pcre/pcre.h +++ b/JavaScriptCore/pcre/pcre.h @@ -65,8 +65,8 @@ POSSIBILITY OF SUCH DAMAGE. #define pcre_version kjs_pcre_version #define PCRE_MAJOR 6 -#define PCRE_MINOR 2 -#define PCRE_DATE 01-Aug-2005 +#define PCRE_MINOR 4 +#define PCRE_DATE 05-Sep-2005 #define PCRE_UTF16 1 diff --git a/JavaScriptCore/pcre/pcre.pri b/JavaScriptCore/pcre/pcre.pri index ba407e59607..651de2fb33a 100644 --- a/JavaScriptCore/pcre/pcre.pri +++ b/JavaScriptCore/pcre/pcre.pri @@ -4,7 +4,6 @@ INCLUDEPATH += $$PWD SOURCES += \ pcre_get.c \ - pcre_printint.c \ pcre_refcount.c \ pcre_ucp_findchar.c \ pcre_compile.c \ @@ -15,7 +14,6 @@ SOURCES += \ pcre_study.c \ pcre_exec.c \ pcre_xclass.c \ - ucp_findchar.c \ pcre_tables.c \ pcre_maketables.c \ pcre_try_flipped.c \ diff --git a/JavaScriptCore/pcre/pcre_compile.c b/JavaScriptCore/pcre/pcre_compile.c index cfa2070dabd..a6350326d43 100644 --- a/JavaScriptCore/pcre/pcre_compile.c +++ b/JavaScriptCore/pcre/pcre_compile.c @@ -56,6 +56,15 @@ supporting internal functions that are not used by other modules. */ #endif +/* When DEBUG is defined, we need the pcre_printint() function, which is also +used by pcretest. DEBUG is not defined when building a production library. */ + +#ifdef DEBUG +#include "pcre_printint.src" +#endif + + + /************************************************* * Code parameters and static tables * *************************************************/ @@ -3893,7 +3902,7 @@ Returns: pointer to compiled data block, or NULL on error, with errorptr and erroroffset set */ -EXPORT pcre * +PCRE_EXPORT pcre * pcre_compile(const pcre_char *pattern, int options, const char **errorptr, int *erroroffset, const unsigned char *tables) { @@ -3901,7 +3910,7 @@ return pcre_compile2(pattern, options, NULL, errorptr, erroroffset, tables); } -EXPORT pcre * +PCRE_EXPORT pcre * pcre_compile2(const pcre_char *pattern, int options, int *errorcodeptr, const char **errorptr, int *erroroffset, const unsigned char *tables) { @@ -5100,7 +5109,8 @@ if (reqbyte >= 0 && } } -/* Print out the compiled data for debugging */ +/* Print out the compiled data if debugging is enabled. This is never the +case when building a production library. */ #ifdef DEBUG @@ -5138,7 +5148,7 @@ if ((re->options & PCRE_REQCHSET) != 0) else printf("Req char = \\x%02x%s\n", ch, caseless); } -_pcre_printint(re, stdout); +pcre_printint(re, stdout); /* This check is done here in the debugging case so that the code that was compiled can be seen. */ diff --git a/JavaScriptCore/pcre/pcre_config.c b/JavaScriptCore/pcre/pcre_config.c index 04029a9464c..5538a70a3bf 100644 --- a/JavaScriptCore/pcre/pcre_config.c +++ b/JavaScriptCore/pcre/pcre_config.c @@ -58,7 +58,7 @@ Arguments: Returns: 0 if data returned, negative on error */ -EXPORT int +PCRE_EXPORT int pcre_config(int what, void *where) { switch (what) diff --git a/JavaScriptCore/pcre/pcre_exec.c b/JavaScriptCore/pcre/pcre_exec.c index 987a5ff4e5e..12786e423b6 100644 --- a/JavaScriptCore/pcre/pcre_exec.c +++ b/JavaScriptCore/pcre/pcre_exec.c @@ -1364,7 +1364,7 @@ for (;;) { int chartype, rqdtype; int othercase; - int category = ucp_findchar(c, &chartype, &othercase); + int category = _pcre_ucp_findchar(c, &chartype, &othercase); rqdtype = *(++ecode); ecode++; @@ -1391,7 +1391,7 @@ for (;;) { int chartype; int othercase; - int category = ucp_findchar(c, &chartype, &othercase); + int category = _pcre_ucp_findchar(c, &chartype, &othercase); if (category == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { @@ -1400,7 +1400,7 @@ for (;;) { GETCHARLEN(c, eptr, len); } - category = ucp_findchar(c, &chartype, &othercase); + category = _pcre_ucp_findchar(c, &chartype, &othercase); if (category != ucp_M) break; eptr += len; } @@ -1891,7 +1891,7 @@ for (;;) ecode += length; /* If we have Unicode property support, we can use it to test the other - case of the character, if there is one. The result of ucp_findchar() is + case of the character, if there is one. The result of _pcre_ucp_findchar() is < 0 if the char isn't found, and othercase is returned as zero if there isn't one. */ @@ -1900,7 +1900,7 @@ for (;;) #ifdef SUPPORT_UCP int chartype; int othercase; - if (ucp_findchar(fc, &chartype, &othercase) < 0 || dc != othercase) + if (_pcre_ucp_findchar(fc, &chartype, &othercase) < 0 || dc != othercase) #endif RRETURN(MATCH_NOMATCH); } @@ -1963,7 +1963,7 @@ for (;;) #ifdef SUPPORT_UCP int othercase; int chartype; - if ((ims & PCRE_CASELESS) == 0 || ucp_findchar(fc, &chartype, &othercase) < 0) + if ((ims & PCRE_CASELESS) == 0 || _pcre_ucp_findchar(fc, &chartype, &othercase) < 0) othercase = -1; /* Guaranteed to not match any character */ #endif /* SUPPORT_UCP */ @@ -2078,7 +2078,7 @@ for (;;) int othercase; int chartype; if ((ims & PCRE_CASELESS) != 0 && - ucp_findchar(fc, &chartype, &othercase) >= 0 && + _pcre_ucp_findchar(fc, &chartype, &othercase) >= 0 && othercase > 0) oclength = _pcre_ord2utf8(othercase, occhars); #endif /* SUPPORT_UCP */ @@ -2604,7 +2604,7 @@ for (;;) for (i = 1; i <= min; i++) { GETCHARINC(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if ((*prop_test_variable == prop_test_against) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -2618,7 +2618,7 @@ for (;;) for (i = 1; i <= min; i++) { GETCHARINCTEST(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { @@ -2627,7 +2627,7 @@ for (;;) { GETCHARLEN(c, eptr, len); } - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if (prop_category != ucp_M) break; eptr += len; } @@ -2797,7 +2797,7 @@ for (;;) if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINC(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if ((*prop_test_variable == prop_test_against) == prop_fail_result) RRETURN(MATCH_NOMATCH); } @@ -2814,7 +2814,7 @@ for (;;) if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); GETCHARINCTEST(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); while (eptr < md->end_subject) { @@ -2823,7 +2823,7 @@ for (;;) { GETCHARLEN(c, eptr, len); } - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if (prop_category != ucp_M) break; eptr += len; } @@ -2955,7 +2955,7 @@ for (;;) int len = 1; if (eptr >= md->end_subject) break; GETCHARLEN(c, eptr, len); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if ((*prop_test_variable == prop_test_against) == prop_fail_result) break; eptr+= len; @@ -2981,7 +2981,7 @@ for (;;) { if (eptr >= md->end_subject) break; GETCHARINCTEST(c, eptr); - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if (prop_category == ucp_M) break; while (eptr < md->end_subject) { @@ -2990,7 +2990,7 @@ for (;;) { GETCHARLEN(c, eptr, len); } - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if (prop_category != ucp_M) break; eptr += len; } @@ -3011,7 +3011,7 @@ for (;;) { GETCHARLEN(c, eptr, len); } - prop_category = ucp_findchar(c, &prop_chartype, &prop_othercase); + prop_category = _pcre_ucp_findchar(c, &prop_chartype, &prop_othercase); if (prop_category != ucp_M) break; eptr--; } @@ -3365,7 +3365,7 @@ Returns: > 0 => success; value is the number of elements filled in < -1 => some kind of unexpected problem */ -EXPORT int +PCRE_EXPORT int pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, const pcre_char *subject, int length, int start_offset, int options, int *offsets, int offsetcount) diff --git a/JavaScriptCore/pcre/pcre_fullinfo.c b/JavaScriptCore/pcre/pcre_fullinfo.c index ac80e65e2a1..cd1a9a4ffc0 100644 --- a/JavaScriptCore/pcre/pcre_fullinfo.c +++ b/JavaScriptCore/pcre/pcre_fullinfo.c @@ -61,7 +61,7 @@ Arguments: Returns: 0 if data returned, negative on error */ -EXPORT int +PCRE_EXPORT int pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what, void *where) { diff --git a/JavaScriptCore/pcre/pcre_info.c b/JavaScriptCore/pcre/pcre_info.c index 228949d0cd2..18741b17312 100644 --- a/JavaScriptCore/pcre/pcre_info.c +++ b/JavaScriptCore/pcre/pcre_info.c @@ -68,7 +68,7 @@ Returns: number of capturing subpatterns or negative values on error */ -EXPORT int +PCRE_EXPORT int pcre_info(const pcre *argument_re, int *optptr, int *first_byte) { real_pcre internal_re; diff --git a/JavaScriptCore/pcre/pcre_internal.h b/JavaScriptCore/pcre/pcre_internal.h index 280185ef8a6..81482122a22 100644 --- a/JavaScriptCore/pcre/pcre_internal.h +++ b/JavaScriptCore/pcre/pcre_internal.h @@ -39,6 +39,13 @@ POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ +/* This header contains definitions that are shared between the different +modules, but which are not relevant to the exported API. This includes some +functions whose names all begin with "_pcre_". */ + +#ifndef PCRE_INTERNAL_H +#define PCRE_INTERNAL_H + #include "Assertions.h" /* Added to prevent 64-to-32 shortening warnings when compiling for 64-bit @@ -54,10 +61,6 @@ POSSIBILITY OF SUCH DAMAGE. #pragma warning(disable: 4244) #endif -/* This header contains definitions that are shared between the different -modules, but which are not relevant to the exported API. This includes some -functions whose names all begin with "_pcre_". */ - #define _pcre_OP_lengths kjs_pcre_OP_lengths #define _pcre_default_tables kjs_pcre_default_tables #define _pcre_ord2utf8 kjs_pcre_ord2utf8 @@ -76,9 +79,9 @@ functions whose names all begin with "_pcre_". */ /* Define DEBUG to get debugging output on stdout. */ -/**** +#if 0 #define DEBUG -****/ +#endif /* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef inline, and there are *still* stupid compilers about that don't like indented @@ -134,9 +137,11 @@ preprocessor time in standard C environments. */ #error Cannot determine a type for 32-bit unsigned integers #endif -/* Include the public PCRE header */ +/* Include the public PCRE header and the definitions of UCP character property +values. */ #include "pcre.h" +#include "ucp.h" /* All character handling must be done as unsigned characters. Otherwise there are problems with top-bit-set characters and functions such as isspace(). @@ -154,12 +159,6 @@ typedef pcre_char pcre_uchar; typedef unsigned char pcre_uchar; #endif -/* Include the (copy of) the public ucp header, changing the external name into -a private one. This does no harm, even if we aren't compiling UCP support. */ - -#define ucp_findchar _pcre_ucp_findchar -#include "ucp.h" - /* When compiling for use with the Virtual Pascal compiler, these functions need to have their names changed. PCRE must be compiled with the -DVPCOMPAT option on the command line. */ @@ -951,7 +950,7 @@ total length. */ #define tables_length (ctypes_offset + 256) /* Layout of the UCP type table that translates property names into codes for -ucp_findchar(). */ +_pcre_ucp_findchar(). */ typedef struct { const char *name; @@ -983,11 +982,12 @@ one of the exported public functions. They have to be "external" in the C sense, but are not part of the PCRE public API. */ extern int _pcre_ord2utf8(int, uschar *); -extern void _pcre_printint(pcre *, FILE *); extern real_pcre * _pcre_try_flipped(const real_pcre *, real_pcre *, const pcre_study_data *, pcre_study_data *); extern int _pcre_ucp_findchar(const int, int *, int *); extern int _pcre_valid_utf8(const uschar *, int); extern BOOL _pcre_xclass(int, const uschar *); +#endif + /* End of pcre_internal.h */ diff --git a/JavaScriptCore/pcre/pcre_ord2utf8.c b/JavaScriptCore/pcre/pcre_ord2utf8.c index f6a06fc6eaf..82fa3c7f0a7 100644 --- a/JavaScriptCore/pcre/pcre_ord2utf8.c +++ b/JavaScriptCore/pcre/pcre_ord2utf8.c @@ -59,7 +59,7 @@ Arguments: Returns: number of characters placed in the buffer */ -EXPORT int +PCRE_EXPORT int _pcre_ord2utf8(int cvalue, uschar *buffer) { register int i, j; diff --git a/JavaScriptCore/pcre/pcre_printint.c b/JavaScriptCore/pcre/pcre_printint.src similarity index 96% rename from JavaScriptCore/pcre/pcre_printint.c rename to JavaScriptCore/pcre/pcre_printint.src index d18f3992527..410f92082d7 100644 --- a/JavaScriptCore/pcre/pcre_printint.c +++ b/JavaScriptCore/pcre/pcre_printint.src @@ -38,12 +38,15 @@ POSSIBILITY OF SUCH DAMAGE. */ -/* This module contains an PCRE private debugging function for printing out the +/* This module contains a PCRE private debugging function for printing out the internal form of a compiled regular expression, along with some supporting -local functions. */ +local functions. This source file is used in two places: +(1) It is #included by pcre_compile.c when it is compiled in debugging mode +(DEBUG defined in pcre_internal.h). It is not included in production compiles. -#include "pcre_internal.h" +(2) It is always #included by pcretest.c, which can be asked to print out a +compiled regex for debugging purposes. */ static const char *OP_names[] = { OP_NAME_LIST }; @@ -121,8 +124,8 @@ return "??"; /* Make this function work for a regex with integers either byte order. However, we assume that what we are passed is a compiled regex. */ -EXPORT void -_pcre_printint(pcre *external_re, FILE *f) +static void +pcre_printint(pcre *external_re, FILE *f) { real_pcre *re = (real_pcre *)external_re; uschar *codestart, *code; @@ -448,4 +451,4 @@ for(;;) } } -/* End of pcre_printint.c */ +/* End of pcre_printint.src */ diff --git a/JavaScriptCore/pcre/pcre_refcount.c b/JavaScriptCore/pcre/pcre_refcount.c index 35a7ee86911..79fde42493e 100644 --- a/JavaScriptCore/pcre/pcre_refcount.c +++ b/JavaScriptCore/pcre/pcre_refcount.c @@ -63,7 +63,7 @@ Returns: the (possibly updated) count value (a non-negative number), or a negative error number */ -EXPORT int +PCRE_EXPORT int pcre_refcount(pcre *argument_re, int adjust) { real_pcre *re = (real_pcre *)argument_re; diff --git a/JavaScriptCore/pcre/pcre_study.c b/JavaScriptCore/pcre/pcre_study.c index 7c10c049171..58f24140037 100644 --- a/JavaScriptCore/pcre/pcre_study.c +++ b/JavaScriptCore/pcre/pcre_study.c @@ -401,7 +401,7 @@ Returns: pointer to a pcre_extra block, with study_data filled in and the NULL on error or if no optimization possible */ -EXPORT pcre_extra * +PCRE_EXPORT pcre_extra * pcre_study(const pcre *external_re, int options, const char **errorptr) { uschar start_bits[32]; diff --git a/JavaScriptCore/pcre/pcre_tables.c b/JavaScriptCore/pcre/pcre_tables.c index 64dec56ce32..3990d39ebf3 100644 --- a/JavaScriptCore/pcre/pcre_tables.c +++ b/JavaScriptCore/pcre/pcre_tables.c @@ -39,7 +39,9 @@ POSSIBILITY OF SUCH DAMAGE. /* This module contains some fixed tables that are used by more than one of the -PCRE code modules. */ +PCRE code modules. The tables are also #included by the pcretest program, which +uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name +clashes with the library. */ #include "pcre_internal.h" @@ -81,8 +83,7 @@ const uschar _pcre_utf8_table4[] = { 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; /* This table translates Unicode property names into code values for the -ucp_findchar() function. It is used by pcretest as well as by the library -functions. */ +_pcre_ucp_findchar() function. */ const ucp_type_table _pcre_utt[] = { { "C", 128 + ucp_C }, diff --git a/JavaScriptCore/pcre/pcre_try_flipped.c b/JavaScriptCore/pcre/pcre_try_flipped.c index d8a159fb95c..e14eb9d18d0 100644 --- a/JavaScriptCore/pcre/pcre_try_flipped.c +++ b/JavaScriptCore/pcre/pcre_try_flipped.c @@ -94,7 +94,7 @@ Returns: the new block if is is indeed a byte-flipped regex NULL if it is not */ -EXPORT real_pcre * +PCRE_EXPORT real_pcre * _pcre_try_flipped(const real_pcre *re, real_pcre *internal_re, const pcre_study_data *study, pcre_study_data *internal_study) { diff --git a/JavaScriptCore/pcre/pcre_ucp_findchar.c b/JavaScriptCore/pcre/pcre_ucp_findchar.c index 9f8de0663e9..b9a4c97c7f1 100644 --- a/JavaScriptCore/pcre/pcre_ucp_findchar.c +++ b/JavaScriptCore/pcre/pcre_ucp_findchar.c @@ -41,13 +41,121 @@ POSSIBILITY OF SUCH DAMAGE. /* This module compiles code for supporting the use of Unicode character properties. We use the (embryonic at the time of writing) UCP library, by including some of its files, copies of which have been put in the PCRE -distribution. There is a macro in pcre_internal.h that changes the name -ucp_findchar into _pcre_ucp_findchar. */ +distribution. The actual search function is reproduced here, with its name +changed. */ #include "pcre_internal.h" -#include "ucp_findchar.c" +#include "ucp.h" /* Category definitions */ +#include "ucpinternal.h" /* Internal table details */ +#include "ucptable.c" /* The table itself */ + +/************************************************* +* Search table and return data * +*************************************************/ + +/* Two values are returned: the category is ucp_C, ucp_L, etc. The detailed +character type is ucp_Lu, ucp_Nd, etc. + +Arguments: + c the character value + type_ptr the detailed character type is returned here + case_ptr for letters, the opposite case is returned here, if there + is one, else zero + +Returns: the character type category or -1 if not found +*/ + +PCRE_EXPORT int +_pcre_ucp_findchar(const int c, int *type_ptr, int *case_ptr) +{ +cnode *node = ucp_table; +register int cc = c; +int case_offset; + +for (;;) + { + register int d = node->f1 | ((node->f0 & f0_chhmask) << 16); + if (cc == d) break; + if (cc < d) + { + if ((node->f0 & f0_leftexists) == 0) return -1; + node ++; + } + else + { + register int roffset = (node->f2 & f2_rightmask) >> f2_rightshift; + if (roffset == 0) return -1; + node += 1 << (roffset - 1); + } + } + +switch ((*type_ptr = ((node->f0 & f0_typemask) >> f0_typeshift))) + { + case ucp_Cc: + case ucp_Cf: + case ucp_Cn: + case ucp_Co: + case ucp_Cs: + return ucp_C; + break; + + case ucp_Ll: + case ucp_Lu: + case_offset = node->f2 & f2_casemask; + if ((case_offset & 0x0100) != 0) case_offset |= 0xfffff000; + *case_ptr = (case_offset == 0)? 0 : cc + case_offset; + return ucp_L; + + case ucp_Lm: + case ucp_Lo: + case ucp_Lt: + *case_ptr = 0; + return ucp_L; + break; + + case ucp_Mc: + case ucp_Me: + case ucp_Mn: + return ucp_M; + break; + + case ucp_Nd: + case ucp_Nl: + case ucp_No: + return ucp_N; + break; + + case ucp_Pc: + case ucp_Pd: + case ucp_Pe: + case ucp_Pf: + case ucp_Pi: + case ucp_Ps: + case ucp_Po: + return ucp_P; + break; + + case ucp_Sc: + case ucp_Sk: + case ucp_Sm: + case ucp_So: + return ucp_S; + break; + + case ucp_Zl: + case ucp_Zp: + case ucp_Zs: + return ucp_Z; + break; + + default: /* "Should never happen" */ + return -1; + break; + } +} + /* End of pcre_ucp_findchar.c */ diff --git a/JavaScriptCore/pcre/pcre_version.c b/JavaScriptCore/pcre/pcre_version.c index d296eea809c..2d3080a7023 100644 --- a/JavaScriptCore/pcre/pcre_version.c +++ b/JavaScriptCore/pcre/pcre_version.c @@ -52,7 +52,7 @@ string that identifies the PCRE version that is in use. */ #define STRING(a) # a #define XSTRING(s) STRING(s) -EXPORT const char * +PCRE_EXPORT const char * pcre_version(void) { return XSTRING(PCRE_MAJOR) "." XSTRING(PCRE_MINOR) " " XSTRING(PCRE_DATE); diff --git a/JavaScriptCore/pcre/pcre_xclass.c b/JavaScriptCore/pcre/pcre_xclass.c index 43f5adf5aef..d62816aa1f4 100644 --- a/JavaScriptCore/pcre/pcre_xclass.c +++ b/JavaScriptCore/pcre/pcre_xclass.c @@ -60,7 +60,7 @@ Arguments: Returns: TRUE if character matches, else FALSE */ -EXPORT BOOL +PCRE_EXPORT BOOL _pcre_xclass(int c, const uschar *data) { int t; @@ -102,7 +102,7 @@ while ((t = *data++) != XCL_END) { int chartype, othercase; int rqdtype = *data++; - int category = ucp_findchar(c, &chartype, &othercase); + int category = _pcre_ucp_findchar(c, &chartype, &othercase); if (rqdtype >= 128) { if ((rqdtype - 128 == category) == (t == XCL_PROP)) return !negated; diff --git a/JavaScriptCore/pcre/ucp.h b/JavaScriptCore/pcre/ucp.h index 955e104a6a8..470524d10a6 100644 --- a/JavaScriptCore/pcre/ucp.h +++ b/JavaScriptCore/pcre/ucp.h @@ -6,7 +6,7 @@ #ifndef _UCP_H #define _UCP_H -/* These are the character categories that are returned by ucp_findchar */ +/* These are the character categories that are returned by _pcre_ucp_findchar */ enum { ucp_C, /* Other */ @@ -18,7 +18,7 @@ enum { ucp_Z /* Separator */ }; -/* These are the detailed character types that are returned by ucp_findchar */ +/* These are the detailed character types that are returned by _pcre_ucp_findchar */ enum { ucp_Cc, /* Control */ @@ -53,8 +53,6 @@ enum { ucp_Zs /* Space separator */ }; -extern int ucp_findchar(const int, int *, int *); - #endif /* End of ucp.h */ diff --git a/JavaScriptCore/pcre/ucp_findchar.c b/JavaScriptCore/pcre/ucp_findchar.c deleted file mode 100644 index 1f451172f9c..00000000000 --- a/JavaScriptCore/pcre/ucp_findchar.c +++ /dev/null @@ -1,160 +0,0 @@ -/************************************************* -* libucp - Unicode Property Table handler * -*************************************************/ - -/* Copyright (c) University of Cambridge 2004 */ - -/* This little library provides a fast way of obtaining the basic Unicode -properties of a character, using a compact binary tree that occupies less than -100K bytes. - ------------------------------------------------------------------------------ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the University of Cambridge nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------ -*/ - - -#include "ucp.h" /* Exported interface */ -#include "ucpinternal.h" /* Internal table details */ -#include "ucptable.c" /* The table itself */ - - -/* In some environments, external functions have to be preceded by some magic. -In my world (Unix), they do not. Use a macro to deal with this. */ - -#ifndef EXPORT -#define EXPORT -#endif - - - -/************************************************* -* Search table and return data * -*************************************************/ - -/* Two values are returned: the category is ucp_C, ucp_L, etc. The detailed -character type is ucp_Lu, ucp_Nd, etc. - -Arguments: - c the character value - type_ptr the detailed character type is returned here - case_ptr for letters, the opposite case is returned here, if there - is one, else zero - -Returns: the character type category or -1 if not found -*/ - -EXPORT int -ucp_findchar(const int c, int *type_ptr, int *case_ptr) -{ -cnode *node = ucp_table; -register int cc = c; -int case_offset; - -for (;;) - { - register int d = node->f1 | ((node->f0 & f0_chhmask) << 16); - if (cc == d) break; - if (cc < d) - { - if ((node->f0 & f0_leftexists) == 0) return -1; - node ++; - } - else - { - register int roffset = (node->f2 & f2_rightmask) >> f2_rightshift; - if (roffset == 0) return -1; - node += 1 << (roffset - 1); - } - } - -switch ((*type_ptr = ((node->f0 & f0_typemask) >> f0_typeshift))) - { - case ucp_Cc: - case ucp_Cf: - case ucp_Cn: - case ucp_Co: - case ucp_Cs: - return ucp_C; - break; - - case ucp_Ll: - case ucp_Lu: - case_offset = node->f2 & f2_casemask; - if ((case_offset & 0x0100) != 0) case_offset |= 0xfffff000; - *case_ptr = (case_offset == 0)? 0 : cc + case_offset; - return ucp_L; - - case ucp_Lm: - case ucp_Lo: - case ucp_Lt: - *case_ptr = 0; - return ucp_L; - break; - - case ucp_Mc: - case ucp_Me: - case ucp_Mn: - return ucp_M; - break; - - case ucp_Nd: - case ucp_Nl: - case ucp_No: - return ucp_N; - break; - - case ucp_Pc: - case ucp_Pd: - case ucp_Pe: - case ucp_Pf: - case ucp_Pi: - case ucp_Ps: - case ucp_Po: - return ucp_P; - break; - - case ucp_Sc: - case ucp_Sk: - case ucp_Sm: - case ucp_So: - return ucp_S; - break; - - case ucp_Zl: - case ucp_Zp: - case ucp_Zs: - return ucp_Z; - break; - - default: /* "Should never happen" */ - return -1; - break; - } -} - -/* End of ucp_findchar.c */ -- GitLab