Commit 60a7a800 authored by ddkilzer's avatar ddkilzer

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
parent 2306f20a
2006-12-31 David Kilzer <ddkilzer@webkit.org>
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 <ddkilzer@webkit.org>
Reviewed by Geoff.
......
......@@ -565,7 +565,7 @@
>
</File>
<File
RelativePath="..\..\pcre\pcre_printint.c"
RelativePath="..\..\pcre\pcre_printint.src"
>
</File>
<File
......@@ -600,10 +600,6 @@
RelativePath="..\..\pcre\ucp.h"
>
</File>
<File
RelativePath="..\..\pcre\ucp_findchar.c"
>
</File>
<File
RelativePath="..\..\pcre\ucpinternal.h"
>
......
......@@ -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 = "<group>"; tabWidth = 8; };
93E26C0D08B1520900F85226 /* ucptable.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; indentWidth = 4; name = ucptable.c; path = pcre/ucptable.c; sourceTree = "<group>"; 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 = "<group>"; 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 = "<group>"; 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 = "<group>"; tabWidth = 8; };
93F0B3A909BB4DC00068FCE3 /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Parser.cpp; sourceTree = "<group>"; };
93F0B3AA09BB4DC00068FCE3 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parser.h; sourceTree = "<group>"; };
93F1981A08245AAE001E9ABC /* keywords.table */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = keywords.table; sourceTree = "<group>"; 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 */,
......
......@@ -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
</set>
<set append="1" var="JSCORE_SOURCES_BINDINGS">
......
......@@ -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
......
......@@ -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. */
......
......@@ -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
......
......@@ -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 \
......
......@@ -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. */
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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 */
......@@ -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;
......
......@@ -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 */
......@@ -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;
......
......@@ -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];
......
......@@ -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 },
......
......@@ -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)
{
......
......@@ -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 (;;)