summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-11-23 17:23:20 +0000
committerzherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-11-23 17:23:20 +0000
commit950a27a0fd444ac862e956d0438d2d196519bd1a (patch)
tree853c03ed7471be8a477eb83285f02667b8bdb394
parente999fd0968252b446d0c5f88282767cd5b6c208a (diff)
downloadpcre-950a27a0fd444ac862e956d0438d2d196519bd1a.tar.gz
PRIV macro added, several new files added
git-svn-id: svn://vcs.exim.org/pcre/code/branches/pcre16@764 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--Makefile.am13
-rw-r--r--dftables.c2
-rw-r--r--pcre16_chartables.c45
-rw-r--r--pcre16_exec.c45
-rw-r--r--pcre16_jit_compile.c45
-rw-r--r--pcre16_newline.c45
-rw-r--r--pcre16_string_utils.c45
-rw-r--r--pcre16_study.c45
-rw-r--r--pcre16_tables.c45
-rw-r--r--pcre16_try_flipped.c45
-rw-r--r--pcre16_utf16_utils.c (renamed from pcre16_convert_utf16.c)2
-rw-r--r--pcre16_valid_utf16.c4
-rw-r--r--pcre_chartables.c.dist2
-rw-r--r--pcre_compile.c158
-rw-r--r--pcre_dfa_exec.c68
-rw-r--r--pcre_exec.c60
-rw-r--r--pcre_fullinfo.c4
-rw-r--r--pcre_info.c2
-rw-r--r--pcre_internal.h146
-rw-r--r--pcre_jit_compile.c72
-rw-r--r--pcre_newline.c4
-rw-r--r--pcre_ord2utf8.c8
-rw-r--r--pcre_printint.src26
-rw-r--r--pcre_string_utils.c (renamed from pcre_str_utils.c)12
-rw-r--r--pcre_study.c30
-rw-r--r--pcre_tables.c24
-rw-r--r--pcre_try_flipped.c2
-rw-r--r--pcre_ucd.c12
-rw-r--r--pcre_ucp_searchfuncs.c4
-rw-r--r--pcre_valid_utf8.c4
-rw-r--r--pcre_xclass.c16
31 files changed, 729 insertions, 306 deletions
diff --git a/Makefile.am b/Makefile.am
index 94cab77..440d699 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -189,7 +189,7 @@ libpcre_la_SOURCES = \
pcre_newline.c \
pcre_ord2utf8.c \
pcre_refcount.c \
- pcre_str_utils.c \
+ pcre_string_utils.c \
pcre_study.c \
pcre_tables.c \
pcre_try_flipped.c \
@@ -209,9 +209,16 @@ endif # WITH_PCRE8
if WITH_PCRE16
lib_LTLIBRARIES += libpcre16.la
libpcre16_la_SOURCES = \
- pcre_str_utils.c \
+ pcre16_chartables.c \
pcre16_compile.c \
- pcre16_convert_utf16.c \
+ pcre16_exec.c \
+ pcre16_jit_compile.c \
+ pcre16_newline.c \
+ pcre16_string_utils.c \
+ pcre16_study.c \
+ pcre16_tables.c \
+ pcre16_try_flipped.c \
+ pcre16_utf16_utils.c \
pcre16_valid_utf16.c
## This file is generated as part of the building process, so don't distribute.
diff --git a/dftables.c b/dftables.c
index 12e1af1..ece9167 100644
--- a/dftables.c
+++ b/dftables.c
@@ -114,7 +114,7 @@ fprintf(f,
"#endif\n\n"
"#include \"pcre_internal.h\"\n\n");
fprintf(f,
- "const unsigned char _pcre_default_tables[] = {\n\n"
+ "const pcre_uint8 PRIV(default_tables)[] = {\n\n"
"/* This table is a lower casing table. */\n\n");
fprintf(f, " ");
diff --git a/pcre16_chartables.c b/pcre16_chartables.c
new file mode 100644
index 0000000..ff14d6f
--- /dev/null
+++ b/pcre16_chartables.c
@@ -0,0 +1,45 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2011 University of Cambridge
+
+-----------------------------------------------------------------------------
+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.
+-----------------------------------------------------------------------------
+*/
+
+/* Generate code with 16 bit character support. */
+#define COMPILE_PCRE16
+
+#include "pcre_chartables.c"
+
+/* End of pcre16_chartables.c */
diff --git a/pcre16_exec.c b/pcre16_exec.c
new file mode 100644
index 0000000..332325b
--- /dev/null
+++ b/pcre16_exec.c
@@ -0,0 +1,45 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2011 University of Cambridge
+
+-----------------------------------------------------------------------------
+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.
+-----------------------------------------------------------------------------
+*/
+
+/* Generate code with 16 bit character support. */
+#define COMPILE_PCRE16
+
+#include "pcre_exec.c"
+
+/* End of pcre16_exec.c */
diff --git a/pcre16_jit_compile.c b/pcre16_jit_compile.c
new file mode 100644
index 0000000..f6af2c3
--- /dev/null
+++ b/pcre16_jit_compile.c
@@ -0,0 +1,45 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2011 University of Cambridge
+
+-----------------------------------------------------------------------------
+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.
+-----------------------------------------------------------------------------
+*/
+
+/* Generate code with 16 bit character support. */
+#define COMPILE_PCRE16
+
+#include "pcre_jit_compile.c"
+
+/* End of pcre16_jit_compile.c */
diff --git a/pcre16_newline.c b/pcre16_newline.c
new file mode 100644
index 0000000..463fe08
--- /dev/null
+++ b/pcre16_newline.c
@@ -0,0 +1,45 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2011 University of Cambridge
+
+-----------------------------------------------------------------------------
+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.
+-----------------------------------------------------------------------------
+*/
+
+/* Generate code with 16 bit character support. */
+#define COMPILE_PCRE16
+
+#include "pcre_newline.c"
+
+/* End of pcre16_newline.c */
diff --git a/pcre16_string_utils.c b/pcre16_string_utils.c
new file mode 100644
index 0000000..f99f0cd
--- /dev/null
+++ b/pcre16_string_utils.c
@@ -0,0 +1,45 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2011 University of Cambridge
+
+-----------------------------------------------------------------------------
+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.
+-----------------------------------------------------------------------------
+*/
+
+/* Generate code with 16 bit character support. */
+#define COMPILE_PCRE16
+
+#include "pcre_string_utils.c"
+
+/* End of pcre16_string_utils.c */
diff --git a/pcre16_study.c b/pcre16_study.c
new file mode 100644
index 0000000..a6b2f59
--- /dev/null
+++ b/pcre16_study.c
@@ -0,0 +1,45 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2011 University of Cambridge
+
+-----------------------------------------------------------------------------
+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.
+-----------------------------------------------------------------------------
+*/
+
+/* Generate code with 16 bit character support. */
+#define COMPILE_PCRE16
+
+#include "pcre_study.c"
+
+/* End of pcre16_study.c */
diff --git a/pcre16_tables.c b/pcre16_tables.c
new file mode 100644
index 0000000..255b0d5
--- /dev/null
+++ b/pcre16_tables.c
@@ -0,0 +1,45 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2011 University of Cambridge
+
+-----------------------------------------------------------------------------
+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.
+-----------------------------------------------------------------------------
+*/
+
+/* Generate code with 16 bit character support. */
+#define COMPILE_PCRE16
+
+#include "pcre_tables.c"
+
+/* End of pcre16_tables.c */
diff --git a/pcre16_try_flipped.c b/pcre16_try_flipped.c
new file mode 100644
index 0000000..b646f28
--- /dev/null
+++ b/pcre16_try_flipped.c
@@ -0,0 +1,45 @@
+/*************************************************
+* Perl-Compatible Regular Expressions *
+*************************************************/
+
+/* PCRE is a library of functions to support regular expressions whose syntax
+and semantics are as close as possible to those of the Perl 5 language.
+
+ Written by Philip Hazel
+ Copyright (c) 1997-2011 University of Cambridge
+
+-----------------------------------------------------------------------------
+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.
+-----------------------------------------------------------------------------
+*/
+
+/* Generate code with 16 bit character support. */
+#define COMPILE_PCRE16
+
+#include "pcre_try_flipped.c"
+
+/* End of pcre16_try_flipped.c */
diff --git a/pcre16_convert_utf16.c b/pcre16_utf16_utils.c
index 34d6965..cd82e26 100644
--- a/pcre16_convert_utf16.c
+++ b/pcre16_utf16_utils.c
@@ -84,4 +84,4 @@ while (input < end)
return length;
}
-/* End of pcre16_convert_utf16.c */
+/* End of pcre16_utf16_utils.c */
diff --git a/pcre16_valid_utf16.c b/pcre16_valid_utf16.c
index 04b2eb9..b64519e 100644
--- a/pcre16_valid_utf16.c
+++ b/pcre16_valid_utf16.c
@@ -66,7 +66,7 @@ PCRE_UTF16_ERR0 No error
PCRE_UTF16_ERR1 Missing low surrogate at the end of the string
PCRE_UTF16_ERR2 Invalid low surrogate
PCRE_UTF16_ERR3 Isolated low surrogate
-PCRE_UTF16_ERR4 Not allowed character.
+PCRE_UTF16_ERR4 Not allowed character
Arguments:
string points to the string
@@ -78,7 +78,7 @@ Returns: = 0 if the string is a valid UTF-16 string
*/
int
-_pcre16_valid_utf16(PCRE_PUCHAR string, int length, int *erroroffset)
+PRIV(valid_utf16)(PCRE_PUCHAR string, int length, int *erroroffset)
{
#ifdef SUPPORT_UTF16
register PCRE_PUCHAR p;
diff --git a/pcre_chartables.c.dist b/pcre_chartables.c.dist
index 9117ae3..2a39e9f 100644
--- a/pcre_chartables.c.dist
+++ b/pcre_chartables.c.dist
@@ -26,7 +26,7 @@ unit might reference this" and so it will always be supplied to the linker. */
#include "pcre_internal.h"
-const unsigned char _pcre_default_tables[] = {
+const pcre_uint8 PRIV(default_tables)[] = {
/* This table is a lower casing table. */
diff --git a/pcre_compile.c b/pcre_compile.c
index e11eca1..38cd815 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -1113,16 +1113,16 @@ else
/* Search for a recognized property name using binary chop */
bot = 0;
-top = _pcre_utt_size;
+top = PRIV(utt_size);
while (bot < top)
{
i = (bot + top) >> 1;
- c = STRCMP_UC_C8(name, _pcre_utt_names + _pcre_utt[i].name_offset);
+ c = STRCMP_UC_C8(name, PRIV(utt_names) + PRIV(utt)[i].name_offset);
if (c == 0)
{
- *dptr = _pcre_utt[i].value;
- return _pcre_utt[i].type;
+ *dptr = PRIV(utt)[i].value;
+ return PRIV(utt)[i].type;
}
if (c > 0) bot = i + 1; else top = i;
}
@@ -1532,7 +1532,7 @@ for (;;)
case OP_ASSERTBACK_NOT:
if (!skipassert) return code;
do code += GET(code, 1); while (*code == OP_ALT);
- code += _pcre_OP_lengths[*code];
+ code += PRIV(OP_lengths)[*code];
break;
case OP_WORD_BOUNDARY:
@@ -1546,7 +1546,7 @@ for (;;)
case OP_RREF:
case OP_NRREF:
case OP_DEF:
- code += _pcre_OP_lengths[*code];
+ code += PRIV(OP_lengths)[*code];
break;
default:
@@ -1670,7 +1670,7 @@ for (;;)
case OP_PRUNE_ARG:
case OP_SKIP_ARG:
case OP_THEN_ARG:
- cc += cc[1] + _pcre_OP_lengths[*cc];
+ cc += cc[1] + PRIV(OP_lengths)[*cc];
break;
case OP_CALLOUT:
@@ -1697,7 +1697,7 @@ for (;;)
case OP_SOM:
case OP_THEN:
case OP_WORD_BOUNDARY:
- cc += _pcre_OP_lengths[*cc];
+ cc += PRIV(OP_lengths)[*cc];
break;
/* Handle literal characters */
@@ -1709,7 +1709,7 @@ for (;;)
branchlength++;
cc += 2;
#ifdef SUPPORT_UTF8
- if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
break;
@@ -1723,7 +1723,7 @@ for (;;)
branchlength += GET2(cc,1);
cc += 4;
#ifdef SUPPORT_UTF8
- if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
break;
@@ -1910,7 +1910,7 @@ Returns: pointer to the opcode for the bracket, or NULL if not found
*/
const pcre_uchar *
-_pcre_find_bracket(const pcre_uchar *code, BOOL utf8, int number)
+PRIV(find_bracket)(const pcre_uchar *code, BOOL utf8, int number)
{
for (;;)
{
@@ -1929,7 +1929,7 @@ for (;;)
else if (c == OP_REVERSE)
{
if (number < 0) return (pcre_uchar *)code;
- code += _pcre_OP_lengths[c];
+ code += PRIV(OP_lengths)[c];
}
/* Handle capturing bracket */
@@ -1939,7 +1939,7 @@ for (;;)
{
int n = GET2(code, 1+LINK_SIZE);
if (n == number) return (pcre_uchar *)code;
- code += _pcre_OP_lengths[c];
+ code += PRIV(OP_lengths)[c];
}
/* Otherwise, we can get the item's length from the table, except that for
@@ -1983,7 +1983,7 @@ for (;;)
/* Add in the fixed length from the table */
- code += _pcre_OP_lengths[c];
+ code += PRIV(OP_lengths)[c];
/* In UTF-8 mode, opcodes that are followed by a character may be followed by
a multi-byte character. The length in the table is a minimum, so we have to
@@ -2020,7 +2020,7 @@ for (;;)
case OP_MINQUERYI:
case OP_POSQUERY:
case OP_POSQUERYI:
- if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f];
+ if (code[-1] >= 0xc0) code += PRIV(utf8_table4)[code[-1] & 0x3f];
break;
}
#else
@@ -2102,7 +2102,7 @@ for (;;)
/* Add in the fixed length from the table */
- code += _pcre_OP_lengths[c];
+ code += PRIV(OP_lengths)[c];
/* In UTF-8 mode, opcodes that are followed by a character may be followed
by a multi-byte character. The length in the table is a minimum, so we have
@@ -2139,7 +2139,7 @@ for (;;)
case OP_MINQUERYI:
case OP_POSQUERY:
case OP_POSQUERYI:
- if (code[-1] >= 0xc0) code += _pcre_utf8_table4[code[-1] & 0x3f];
+ if (code[-1] >= 0xc0) code += PRIV(utf8_table4)[code[-1] & 0x3f];
break;
}
#else
@@ -2177,9 +2177,9 @@ could_be_empty_branch(const pcre_uchar *code, const pcre_uchar *endcode,
BOOL utf8, compile_data *cd)
{
register int c;
-for (code = first_significant_code(code + _pcre_OP_lengths[*code], TRUE);
+for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
code < endcode;
- code = first_significant_code(code + _pcre_OP_lengths[c], TRUE))
+ code = first_significant_code(code + PRIV(OP_lengths)[c], TRUE))
{
const pcre_uchar *ccode;
@@ -2240,7 +2240,7 @@ for (code = first_significant_code(code + _pcre_OP_lengths[*code], TRUE);
if (c == OP_BRAZERO || c == OP_BRAMINZERO || c == OP_SKIPZERO ||
c == OP_BRAPOSZERO)
{
- code += _pcre_OP_lengths[c];
+ code += PRIV(OP_lengths)[c];
do code += GET(code, 1); while (*code == OP_ALT);
c = *code;
continue;
@@ -2296,7 +2296,7 @@ for (code = first_significant_code(code + _pcre_OP_lengths[*code], TRUE);
{
/* Check for quantifiers after a class. XCLASS is used for classes that
cannot be represented just by a bit map. This includes negated single
- high-valued characters. The length in _pcre_OP_lengths[] is zero; the
+ high-valued characters. The length in PRIV(OP_lengths)[] is zero; the
actual length is stored in the compiled code, so we must update "code"
here. */
@@ -2411,7 +2411,7 @@ for (code = first_significant_code(code + _pcre_OP_lengths[*code], TRUE);
case OP_MINQUERYI:
case OP_POSQUERY:
case OP_POSQUERYI:
- if (utf8 && code[1] >= 0xc0) code += _pcre_utf8_table4[code[1] & 0x3f];
+ if (utf8 && code[1] >= 0xc0) code += PRIV(utf8_table4)[code[1] & 0x3f];
break;
case OP_UPTO:
@@ -2420,7 +2420,7 @@ for (code = first_significant_code(code + _pcre_OP_lengths[*code], TRUE);
case OP_MINUPTOI:
case OP_POSUPTO:
case OP_POSUPTOI:
- if (utf8 && code[3] >= 0xc0) code += _pcre_utf8_table4[code[3] & 0x3f];
+ if (utf8 && code[3] >= 0xc0) code += PRIV(utf8_table4)[code[3] & 0x3f];
break;
#endif
@@ -2784,7 +2784,7 @@ switch(ptype)
prop->chartype == ucp_Lt) == negated;
case PT_GC:
- return (pdata == _pcre_ucp_gentype[prop->chartype]) == negated;
+ return (pdata == PRIV(ucp_gentype)[prop->chartype]) == negated;
case PT_PC:
return (pdata == prop->chartype) == negated;
@@ -2795,23 +2795,23 @@ switch(ptype)
/* These are specials */
case PT_ALNUM:
- return (_pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N) == negated;
+ return (PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N) == negated;
case PT_SPACE: /* Perl space */
- return (_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR)
== negated;
case PT_PXSPACE: /* POSIX space */
- return (_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ return (PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
c == CHAR_FF || c == CHAR_CR)
== negated;
case PT_WORD:
- return (_pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N ||
+ return (PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
c == CHAR_UNDERSCORE) == negated;
}
return FALSE;
@@ -3898,18 +3898,18 @@ for (;; ptr++)
{
class_utf8 = TRUE;
*class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x1680, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x1680, class_utf8data);
*class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x180e, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x180e, class_utf8data);
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2000, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x200A, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x2000, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x200A, class_utf8data);
*class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x202f, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x202f, class_utf8data);
*class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x205f, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x205f, class_utf8data);
*class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(0x3000, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x3000, class_utf8data);
}
#endif
continue;
@@ -3933,26 +3933,26 @@ for (;; ptr++)
{
class_utf8 = TRUE;
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x0100, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x167f, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x0100, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x167f, class_utf8data);
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x1681, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x180d, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x1681, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x180d, class_utf8data);
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x180f, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x1fff, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x180f, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x1fff, class_utf8data);
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x200B, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x202e, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x200B, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x202e, class_utf8data);
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2030, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x205e, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x2030, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x205e, class_utf8data);
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2060, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x2fff, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x2060, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x2fff, class_utf8data);
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x3001, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x7fffffff, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x3001, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x7fffffff, class_utf8data);
}
#endif
continue;
@@ -3968,8 +3968,8 @@ for (;; ptr++)
{
class_utf8 = TRUE;
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2028, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x2029, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x2028, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x2029, class_utf8data);
}
#endif
continue;
@@ -3996,11 +3996,11 @@ for (;; ptr++)
{
class_utf8 = TRUE;
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x0100, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x2027, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x0100, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x2027, class_utf8data);
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(0x2029, class_utf8data);
- class_utf8data += _pcre_ord2utf8(0x7fffffff, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x2029, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(0x7fffffff, class_utf8data);
}
#endif
continue;
@@ -4178,9 +4178,9 @@ for (;; ptr++)
else
{
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(occ, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(occ, class_utf8data);
}
- class_utf8data += _pcre_ord2utf8(ocd, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(ocd, class_utf8data);
}
}
#endif /* SUPPORT_UCP */
@@ -4189,8 +4189,8 @@ for (;; ptr++)
overlapping ranges. */
*class_utf8data++ = XCL_RANGE;
- class_utf8data += _pcre_ord2utf8(c, class_utf8data);
- class_utf8data += _pcre_ord2utf8(d, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(c, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(d, class_utf8data);
/* With UCP support, we are done. Without UCP support, there is no
caseless matching for UTF-8 characters > 127; we can use the bit map
@@ -4244,7 +4244,7 @@ for (;; ptr++)
{
class_utf8 = TRUE;
*class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(c, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(c, class_utf8data);
#ifdef SUPPORT_UCP
if ((options & PCRE_CASELESS) != 0)
@@ -4253,7 +4253,7 @@ for (;; ptr++)
if ((othercase = UCD_OTHERCASE(c)) != c)
{
*class_utf8data++ = XCL_SINGLE;
- class_utf8data += _pcre_ord2utf8(othercase, class_utf8data);
+ class_utf8data += PRIV(ord2utf8)(othercase, class_utf8data);
}
}
#endif /* SUPPORT_UCP */
@@ -4334,7 +4334,7 @@ for (;; ptr++)
#ifdef SUPPORT_UTF8
if (utf8 && class_lastchar > 127)
- mclength = _pcre_ord2utf8(class_lastchar, mcbuffer);
+ mclength = PRIV(ord2utf8)(class_lastchar, mcbuffer);
else
#endif
{
@@ -5180,15 +5180,15 @@ for (;; ptr++)
int len;
if (*tempcode == OP_TYPEEXACT)
- tempcode += _pcre_OP_lengths[*tempcode] +
+ tempcode += PRIV(OP_lengths)[*tempcode] +
((tempcode[3] == OP_PROP || tempcode[3] == OP_NOTPROP)? 2 : 0);
else if (*tempcode == OP_EXACT || *tempcode == OP_NOTEXACT)
{
- tempcode += _pcre_OP_lengths[*tempcode];
+ tempcode += PRIV(OP_lengths)[*tempcode];
#ifdef SUPPORT_UTF8
if (utf8 && tempcode[-1] >= 0xc0)
- tempcode += _pcre_utf8_table4[tempcode[-1] & 0x3f];
+ tempcode += PRIV(utf8_table4)[tempcode[-1] & 0x3f];
#endif
}
@@ -6010,7 +6010,7 @@ for (;; ptr++)
{
*code = OP_END;
if (recno != 0)
- called = _pcre_find_bracket(cd->start_code, utf8, recno);
+ called = PRIV(find_bracket)(cd->start_code, utf8, recno);
/* Forward reference */
@@ -6551,7 +6551,7 @@ for (;; ptr++)
#ifdef SUPPORT_UTF8
if (utf8 && c > 127)
- mclength = _pcre_ord2utf8(c, mcbuffer);
+ mclength = PRIV(ord2utf8)(c, mcbuffer);
else
#endif
@@ -6984,7 +6984,7 @@ is_anchored(register const pcre_uchar *code, unsigned int bracket_map,
{
do {
const pcre_uchar *scode = first_significant_code(
- code + _pcre_OP_lengths[*code], FALSE);
+ code + PRIV(OP_lengths)[*code], FALSE);
register int op = *scode;
/* Non-capturing brackets */
@@ -7061,7 +7061,7 @@ is_startline(const pcre_uchar *code, unsigned int bracket_map,
{
do {
const pcre_uchar *scode = first_significant_code(
- code + _pcre_OP_lengths[*code], FALSE);
+ code + PRIV(OP_lengths)[*code], FALSE);
register int op = *scode;
/* If we are at the start of a conditional assertion group, *both* the
@@ -7072,7 +7072,7 @@ do {
if (op == OP_COND)
{
scode += 1 + LINK_SIZE;
- if (*scode == OP_CALLOUT) scode += _pcre_OP_lengths[OP_CALLOUT];
+ if (*scode == OP_CALLOUT) scode += PRIV(OP_lengths)[OP_CALLOUT];
switch (*scode)
{
case OP_CREF:
@@ -7325,7 +7325,7 @@ if (erroroffset == NULL)
/* Set up pointers to the individual character tables */
-if (tables == NULL) tables = _pcre_default_tables;
+if (tables == NULL) tables = PRIV(default_tables);
cd->lcc = tables + lcc_offset;
cd->fcc = tables + fcc_offset;
cd->cbits = tables + cbits_offset;
@@ -7381,13 +7381,13 @@ while (ptr[skipatstart] == CHAR_LEFT_PARENTHESIS &&
utf8 = (options & PCRE_UTF8) != 0;
/* Can't support UTF8 unless PCRE has been compiled to include the code. The
-return of an error code from _pcre_valid_utf8() is a new feature, introduced in
+return of an error code from PRIV(valid_utf8)() is a new feature, introduced in
release 8.13. It is passed back from pcre_[dfa_]exec(), but at the moment is
not used here. */
#ifdef SUPPORT_UTF8
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 &&
- (errorcode = _pcre_valid_utf8((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0)
+ (errorcode = PRIV(valid_utf8)((PCRE_PUCHAR)pattern, -1, erroroffset)) != 0)
{
errorcode = ERR44;
goto PCRE_EARLY_ERROR_RETURN2;
@@ -7545,7 +7545,7 @@ re->name_table_offset = sizeof(real_pcre);
re->name_entry_size = cd->name_entry_size;
re->name_count = cd->names_found;
re->ref_count = 0;
-re->tables = (tables == _pcre_default_tables)? NULL : tables;
+re->tables = (tables == PRIV(default_tables))? NULL : tables;
re->nullpad = NULL;
/* The starting points of the name/number translation table and of the code are
@@ -7605,7 +7605,7 @@ while (errorcode == 0 && cd->hwm > cworkspace)
cd->hwm -= LINK_SIZE;
offset = GET(cd->hwm, 0);
recno = GET(codestart, offset);
- groupptr = _pcre_find_bracket(codestart, utf8, recno);
+ groupptr = PRIV(find_bracket)(codestart, utf8, recno);
if (groupptr == NULL) errorcode = ERR53;
else PUT(((pcre_uchar *)codestart), offset, (int)(groupptr - codestart));
}
@@ -7632,9 +7632,9 @@ if (cd->check_lookbehind)
of zero, but that is a pathological case, and it does no harm.) When we find
one, we temporarily terminate the branch it is in while we scan it. */
- for (cc = (pcre_uchar *)_pcre_find_bracket(codestart, utf8, -1);
+ for (cc = (pcre_uchar *)PRIV(find_bracket)(codestart, utf8, -1);
cc != NULL;
- cc = (pcre_uchar *)_pcre_find_bracket(cc, utf8, -1))
+ cc = (pcre_uchar *)PRIV(find_bracket)(cc, utf8, -1))
{
if (GET(cc, 1) == 0)
{
diff --git a/pcre_dfa_exec.c b/pcre_dfa_exec.c
index d94cead..28f4f5b 100644
--- a/pcre_dfa_exec.c
+++ b/pcre_dfa_exec.c
@@ -1024,7 +1024,7 @@ for (;;)
break;
case PT_GC:
- OK = _pcre_ucp_gentype[prop->chartype] == code[2];
+ OK = PRIV(ucp_gentype)[prop->chartype] == code[2];
break;
case PT_PC:
@@ -1038,24 +1038,24 @@ for (;;)
/* These are specials for combination cases. */
case PT_ALNUM:
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N;
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N;
break;
case PT_SPACE: /* Perl space */
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
break;
case PT_PXSPACE: /* POSIX space */
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
c == CHAR_FF || c == CHAR_CR;
break;
case PT_WORD:
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
c == CHAR_UNDERSCORE;
break;
@@ -1218,7 +1218,7 @@ for (;;)
break;
case PT_GC:
- OK = _pcre_ucp_gentype[prop->chartype] == code[3];
+ OK = PRIV(ucp_gentype)[prop->chartype] == code[3];
break;
case PT_PC:
@@ -1232,24 +1232,24 @@ for (;;)
/* These are specials for combination cases. */
case PT_ALNUM:
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N;
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N;
break;
case PT_SPACE: /* Perl space */
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
break;
case PT_PXSPACE: /* POSIX space */
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
c == CHAR_FF || c == CHAR_CR;
break;
case PT_WORD:
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
c == CHAR_UNDERSCORE;
break;
@@ -1465,7 +1465,7 @@ for (;;)
break;
case PT_GC:
- OK = _pcre_ucp_gentype[prop->chartype] == code[3];
+ OK = PRIV(ucp_gentype)[prop->chartype] == code[3];
break;
case PT_PC:
@@ -1479,24 +1479,24 @@ for (;;)
/* These are specials for combination cases. */
case PT_ALNUM:
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N;
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N;
break;
case PT_SPACE: /* Perl space */
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
break;
case PT_PXSPACE: /* POSIX space */
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
c == CHAR_FF || c == CHAR_CR;
break;
case PT_WORD:
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
c == CHAR_UNDERSCORE;
break;
@@ -1737,7 +1737,7 @@ for (;;)
break;
case PT_GC:
- OK = _pcre_ucp_gentype[prop->chartype] == code[5];
+ OK = PRIV(ucp_gentype)[prop->chartype] == code[5];
break;
case PT_PC:
@@ -1751,24 +1751,24 @@ for (;;)
/* These are specials for combination cases. */
case PT_ALNUM:
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N;
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N;
break;
case PT_SPACE: /* Perl space */
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
break;
case PT_PXSPACE: /* POSIX space */
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
c == CHAR_FF || c == CHAR_CR;
break;
case PT_WORD:
- OK = _pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N ||
+ OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
c == CHAR_UNDERSCORE;
break;
@@ -2440,7 +2440,7 @@ for (;;)
else
{
ecode = code + GET(code, 1);
- if (clen > 0) isinclass = _pcre_xclass(c, code + 1 + LINK_SIZE);
+ if (clen > 0) isinclass = PRIV(xclass)(c, code + 1 + LINK_SIZE);
}
/* At this point, isinclass is set for all kinds of class, and ecode
@@ -2566,7 +2566,7 @@ for (;;)
if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc; /* Abandon */
}
if (rrc > 0) break; /* Fail this thread */
- code += _pcre_OP_lengths[OP_CALLOUT]; /* Skip callout data */
+ code += PRIV(OP_lengths)[OP_CALLOUT]; /* Skip callout data */
}
condcode = code[LINK_SIZE+1];
@@ -2899,7 +2899,7 @@ for (;;)
if ((rrc = (*pcre_callout)(&cb)) < 0) return rrc; /* Abandon */
}
if (rrc == 0)
- { ADD_ACTIVE(state_offset + _pcre_OP_lengths[OP_CALLOUT], 0); }
+ { ADD_ACTIVE(state_offset + PRIV(OP_lengths)[OP_CALLOUT], 0); }
break;
@@ -3059,7 +3059,7 @@ study data too. */
if (re->magic_number != MAGIC_NUMBER)
{
- re = _pcre_try_flipped(re, &internal_re, study, &internal_study);
+ re = PRIV(try_flipped)(re, &internal_re, study, &internal_study);
if (re == NULL) return PCRE_ERROR_BADMAGIC;
if (study != NULL) study = &internal_study;
}
@@ -3148,7 +3148,7 @@ back the character offset. */
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
{
int erroroffset;
- int errorcode = _pcre_valid_utf8((pcre_uchar *)subject, length, &erroroffset);
+ int errorcode = PRIV(valid_utf8)((pcre_uchar *)subject, length, &erroroffset);
if (errorcode != 0)
{
if (offsetcount >= 2)
@@ -3169,7 +3169,7 @@ if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
is a feature that makes it possible to save compiled regex and re-use them
in other programs later. */
-if (md->tables == NULL) md->tables = _pcre_default_tables;
+if (md->tables == NULL) md->tables = PRIV(default_tables);
/* The lower casing table and the "must be at the start of a line" flag are
used in a loop when finding where to start. */
diff --git a/pcre_exec.c b/pcre_exec.c
index 8fc8339..4d69630 100644
--- a/pcre_exec.c
+++ b/pcre_exec.c
@@ -702,7 +702,7 @@ for (;;)
{
case OP_MARK:
markptr = ecode + 2;
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
eptrb, RM55);
/* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an
@@ -728,7 +728,7 @@ for (;;)
/* COMMIT overrides PRUNE, SKIP, and THEN */
case OP_COMMIT:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
eptrb, RM52);
if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE &&
rrc != MATCH_SKIP && rrc != MATCH_SKIP_ARG &&
@@ -739,13 +739,13 @@ for (;;)
/* PRUNE overrides THEN */
case OP_PRUNE:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
eptrb, RM51);
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
MRRETURN(MATCH_PRUNE);
case OP_PRUNE_ARG:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
eptrb, RM56);
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
md->mark = ecode + 2;
@@ -754,7 +754,7 @@ for (;;)
/* SKIP overrides PRUNE and THEN */
case OP_SKIP:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
eptrb, RM53);
if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN)
RRETURN(rrc);
@@ -762,7 +762,7 @@ for (;;)
MRRETURN(MATCH_SKIP);
case OP_SKIP_ARG:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md,
eptrb, RM57);
if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN)
RRETURN(rrc);
@@ -780,14 +780,14 @@ for (;;)
match pointer to do this. */
case OP_THEN:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
eptrb, RM54);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
md->start_match_ptr = ecode;
MRRETURN(MATCH_THEN);
case OP_THEN_ARG:
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top,
md, eptrb, RM58);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
md->start_match_ptr = ecode;
@@ -916,7 +916,7 @@ for (;;)
for (;;)
{
if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP;
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
eptrb, RM1);
if (rrc == MATCH_ONCE) break; /* Backing up through an atomic group */
@@ -1004,13 +1004,13 @@ for (;;)
else if (!md->hasthen && ecode[GET(ecode, 1)] != OP_ALT)
{
- ecode += _pcre_OP_lengths[*ecode];
+ ecode += PRIV(OP_lengths)[*ecode];
goto TAIL_RECURSE;
}
/* In all other cases, we have to make another call to match(). */
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, eptrb,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, eptrb,
RM2);
/* See comment in the code for capturing groups above about handling
@@ -1094,7 +1094,7 @@ for (;;)
md->offset_vector[md->offset_end - number] =
(int)(eptr - md->start_subject);
if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP;
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
eptrb, RM63);
if (rrc == MATCH_KETRPOS)
{
@@ -1167,7 +1167,7 @@ for (;;)
for (;;)
{
if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP;
- RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
+ RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md,
eptrb, RM48);
if (rrc == MATCH_KETRPOS)
{
@@ -1236,7 +1236,7 @@ for (;;)
if ((rrc = (*pcre_callout)(&cb)) > 0) MRRETURN(MATCH_NOMATCH);
if (rrc < 0) RRETURN(rrc);
}
- ecode += _pcre_OP_lengths[OP_CALLOUT];
+ ecode += PRIV(OP_lengths)[OP_CALLOUT];
}
condcode = ecode[LINK_SIZE+1];
@@ -1718,7 +1718,7 @@ for (;;)
do
{
if (cbegroup) md->match_function_type = MATCH_CBEGROUP;
- RMATCH(eptr, callpat + _pcre_OP_lengths[*callpat], offset_top,
+ RMATCH(eptr, callpat + PRIV(OP_lengths)[*callpat], offset_top,
md, eptrb, RM6);
memcpy(md->offset_vector, new_recursive.offset_save,
new_recursive.saved_max * sizeof(int));
@@ -2478,7 +2478,7 @@ for (;;)
break;
case PT_GC:
- if ((ecode[2] != _pcre_ucp_gentype[prop->chartype]) == (op == OP_PROP))
+ if ((ecode[2] != PRIV(ucp_gentype)[prop->chartype]) == (op == OP_PROP))
MRRETURN(MATCH_NOMATCH);
break;
@@ -2495,20 +2495,20 @@ for (;;)
/* These are specials */
case PT_ALNUM:
- if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N) == (op == OP_NOTPROP))
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N) == (op == OP_NOTPROP))
MRRETURN(MATCH_NOMATCH);
break;
case PT_SPACE: /* Perl space */
- if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR)
== (op == OP_NOTPROP))
MRRETURN(MATCH_NOMATCH);
break;
case PT_PXSPACE: /* POSIX space */
- if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
c == CHAR_FF || c == CHAR_CR)
== (op == OP_NOTPROP))
@@ -2516,8 +2516,8 @@ for (;;)
break;
case PT_WORD:
- if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N ||
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
c == CHAR_UNDERSCORE) == (op == OP_NOTPROP))
MRRETURN(MATCH_NOMATCH);
break;
@@ -2949,7 +2949,7 @@ for (;;)
MRRETURN(MATCH_NOMATCH);
}
GETCHARINCTEST(c, eptr);
- if (!_pcre_xclass(c, data)) MRRETURN(MATCH_NOMATCH);
+ if (!PRIV(xclass)(c, data)) MRRETURN(MATCH_NOMATCH);
}
/* If max == min we can continue with the main loop without the
@@ -2973,7 +2973,7 @@ for (;;)
MRRETURN(MATCH_NOMATCH);
}
GETCHARINCTEST(c, eptr);
- if (!_pcre_xclass(c, data)) MRRETURN(MATCH_NOMATCH);
+ if (!PRIV(xclass)(c, data)) MRRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
}
@@ -2992,7 +2992,7 @@ for (;;)
break;
}
GETCHARLENTEST(c, eptr, len);
- if (!_pcre_xclass(c, data)) break;
+ if (!PRIV(xclass)(c, data)) break;
eptr += len;
}
for(;;)
@@ -3184,7 +3184,7 @@ for (;;)
unsigned int othercase;
if (op >= OP_STARI && /* Caseless */
(othercase = UCD_OTHERCASE(fc)) != fc)
- oclength = _pcre_ord2utf8(othercase, occhars);
+ oclength = PRIV(ord2utf8)(othercase, occhars);
else oclength = 0;
#endif /* SUPPORT_UCP */
@@ -5983,7 +5983,7 @@ code for an invalid string if a results vector is available. */
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
{
int erroroffset;
- int errorcode = _pcre_valid_utf8((PCRE_PUCHAR)subject, length, &erroroffset);
+ int errorcode = PRIV(valid_utf8)((PCRE_PUCHAR)subject, length, &erroroffset);
if (errorcode != 0)
{
if (offsetcount >= 2)
@@ -6015,7 +6015,7 @@ if (extra_data != NULL
&& (extra_data->flags & PCRE_EXTRA_TABLES) == 0
&& (options & ~(PCRE_NO_UTF8_CHECK | PCRE_NOTBOL | PCRE_NOTEOL |
PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART)) == 0)
- return _pcre_jit_exec(re, extra_data->executable_jit, subject, length,
+ return PRIV(jit_exec)(re, extra_data->executable_jit, subject, length,
start_offset, options, ((extra_data->flags & PCRE_EXTRA_MATCH_LIMIT) == 0)
? MATCH_LIMIT : extra_data->match_limit, offsets, offsetcount);
#endif
@@ -6057,7 +6057,7 @@ if (extra_data != NULL)
is a feature that makes it possible to save compiled regex and re-use them
in other programs later. */
-if (tables == NULL) tables = _pcre_default_tables;
+if (tables == NULL) tables = PRIV(default_tables);
/* Check that the first field in the block is the magic number. If it is not,
test for a regex that was compiled on a host of opposite endianness. If this is
@@ -6066,7 +6066,7 @@ study data too. */
if (re->magic_number != MAGIC_NUMBER)
{
- re = _pcre_try_flipped(re, &internal_re, study, &internal_study);
+ re = PRIV(try_flipped)(re, &internal_re, study, &internal_study);
if (re == NULL) return PCRE_ERROR_BADMAGIC;
if (study != NULL) study = &internal_study;
}
diff --git a/pcre_fullinfo.c b/pcre_fullinfo.c
index bfb3156..7e7e238 100644
--- a/pcre_fullinfo.c
+++ b/pcre_fullinfo.c
@@ -81,7 +81,7 @@ if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0)
if (re->magic_number != MAGIC_NUMBER)
{
- re = _pcre_try_flipped(re, &internal_re, study, &internal_study);
+ re = PRIV(try_flipped)(re, &internal_re, study, &internal_study);
if (re == NULL) return PCRE_ERROR_BADMAGIC;
if (study != NULL) study = &internal_study;
}
@@ -153,7 +153,7 @@ switch (what)
break;
case PCRE_INFO_DEFAULT_TABLES:
- *((const pcre_uint8 **)where) = (const pcre_uint8 *)(_pcre_default_tables);
+ *((const pcre_uint8 **)where) = (const pcre_uint8 *)(PRIV(default_tables));
break;
/* From release 8.00 this will always return TRUE because NOPARTIAL is
diff --git a/pcre_info.c b/pcre_info.c
index f35f398..1362bc1 100644
--- a/pcre_info.c
+++ b/pcre_info.c
@@ -80,7 +80,7 @@ const real_pcre *re = (const real_pcre *)argument_re;
if (re == NULL) return PCRE_ERROR_NULL;
if (re->magic_number != MAGIC_NUMBER)
{
- re = _pcre_try_flipped(re, &internal_re, NULL, NULL);
+ re = PRIV(try_flipped)(re, &internal_re, NULL, NULL);
if (re == NULL) return PCRE_ERROR_BADMAGIC;
}
if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_COMPILE_OPTIONS);
diff --git a/pcre_internal.h b/pcre_internal.h
index bbea84f..2ca7698 100644
--- a/pcre_internal.h
+++ b/pcre_internal.h
@@ -40,7 +40,8 @@ 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_". */
+functions whose names all begin with "_pcre_" or "_pcre16_" depending on
+the PRIV macro. */
#ifndef PCRE_INTERNAL_H
#define PCRE_INTERNAL_H
@@ -251,7 +252,7 @@ start/end of string field names are. */
#define IS_NEWLINE(p) \
((NLBLOCK->nltype != NLTYPE_FIXED)? \
((p) < NLBLOCK->PSEND && \
- _pcre_is_newline((p), NLBLOCK->nltype, NLBLOCK->PSEND, &(NLBLOCK->nllen),\
+ PRIV(is_newline)((p), NLBLOCK->nltype, NLBLOCK->PSEND, &(NLBLOCK->nllen),\
utf8)) \
: \
((p) <= NLBLOCK->PSEND - NLBLOCK->nllen && \
@@ -265,7 +266,7 @@ start/end of string field names are. */
#define WAS_NEWLINE(p) \
((NLBLOCK->nltype != NLTYPE_FIXED)? \
((p) > NLBLOCK->PSSTART && \
- _pcre_was_newline((p), NLBLOCK->nltype, NLBLOCK->PSSTART, \
+ PRIV(was_newline)((p), NLBLOCK->nltype, NLBLOCK->PSSTART, \
&(NLBLOCK->nllen), utf8)) \
: \
((p) >= NLBLOCK->PSSTART + NLBLOCK->nllen && \
@@ -359,6 +360,8 @@ The macros are controlled by the value of LINK_SIZE. This defaults to 2 in
the config.h file, but can be overridden by using -D on the command line. This
is automated on Unix systems via the "configure" command. */
+#ifdef COMPILE_PCRE8
+
#if LINK_SIZE == 2
#define PUT(a,n,d) \
@@ -395,13 +398,51 @@ is automated on Unix systems via the "configure" command. */
#define GET(a,n) \
(((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3])
-#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */
+/* Keep it positive */
+#define MAX_PATTERN_SIZE (1 << 30)
+
+#else
+#error LINK_SIZE must be either 2, 3, or 4
+#endif
+
+#else /* COMPILE_PCRE8 */
+
+#ifdef COMPILE_PCRE16
+
+#if LINK_SIZE == 2
+
+#undef LINK_SIZE
+#define LINK_SIZE 1
+
+#define PUT(a,n,d) \
+ (a[n] = (d))
+
+#define GET(a,n) \
+ (a[n])
+
+#define MAX_PATTERN_SIZE (1 << 16)
+
+#elif LINK_SIZE == 3 || LINK_SIZE == 4
+
+#define PUT(a,n,d) \
+ (a[n] = (d) >> 16), \
+ (a[(n)+1] = (d) & 65536)
+
+#define GET(a,n) \
+ (((a)[n] << 16) | (a)[(n)+1])
+/* Keep it positive */
+#define MAX_PATTERN_SIZE (1 << 30)
#else
#error LINK_SIZE must be either 2, 3, or 4
#endif
+#else
+#error Unsupported compiling mode
+#endif /* COMPILE_PCRE16 */
+
+#endif /* COMPILE_PCRE8 */
/* Convenience macro defined in terms of the others */
@@ -423,8 +464,9 @@ capturing parenthesis numbers in back references. */
#define GET2(a,n) \
(((a)[n] << 8) | (a)[(n)+1])
+#else /* COMPILE_PCRE8 */
-#elif defined(COMPILE_PCRE16)
+#ifdef COMPILE_PCRE16
#define IMM2_SIZE 1
@@ -436,6 +478,8 @@ capturing parenthesis numbers in back references. */
#else
#error Unsupported compiling mode
+#endif /* COMPILE_PCRE16 */
+
#endif /* COMPILE_PCRE8 */
#define PUT2INC(a,n,d) PUT2(a,n,d), a += IMM2_SIZE
@@ -459,7 +503,7 @@ UTF-8 support is omitted, we don't even define them. */
#else /* SUPPORT_UTF8 */
/* These macros were originally written in the form of loops that used data
-from the tables whose names start with _pcre_utf8_table. They were rewritten by
+from the tables whose names start with PRIV(utf8_table). They were rewritten by
a user so as not to use loops, because in some environments this gives a
significant performance advantage, and it seems never to do any harm. */
@@ -1929,6 +1973,18 @@ total length. */
#define ctypes_offset (cbits_offset + cbit_length)
#define tables_length (ctypes_offset + 256)
+/* Internal function prefix */
+
+#ifdef COMPILE_PCRE8
+#define PRIV(name) _pcre_##name
+#else
+#ifdef COMPILE_PCRE16
+#define PRIV(name) _pcre16_##name
+#else
+#error Unsupported compiling mode
+#endif /* COMPILE_PCRE16 */
+#endif /* COMPILE_PCRE8 */
+
/* Layout of the UCP type table that translates property names into types and
codes. Each entry used to point directly to a name, but to reduce the number of
relocations in shared libraries, it now has an offset into a single string
@@ -1946,20 +2002,20 @@ of the exported public functions. They have to be "external" in the C sense,
but are not part of the PCRE public API. The data for these tables is in the
pcre_tables.c module. */
-extern const int _pcre_utf8_table1[];
-extern const int _pcre_utf8_table2[];
-extern const int _pcre_utf8_table3[];
-extern const pcre_uint8 _pcre_utf8_table4[];
+extern const int PRIV(utf8_table1)[];
+extern const int PRIV(utf8_table2)[];
+extern const int PRIV(utf8_table3)[];
+extern const pcre_uint8 PRIV(utf8_table4)[];
-extern const int _pcre_utf8_table1_size;
+extern const int PRIV(utf8_table1_size);
-extern const char _pcre_utt_names[];
-extern const ucp_type_table _pcre_utt[];
-extern const int _pcre_utt_size;
+extern const char PRIV(utt_names)[];
+extern const ucp_type_table PRIV(utt)[];
+extern const int PRIV(utt_size);
-extern const pcre_uint8 _pcre_default_tables[];
+extern const pcre_uint8 PRIV(default_tables)[];
-extern const pcre_uint8 _pcre_OP_lengths[];
+extern const pcre_uint8 PRIV(OP_lengths)[];
/* Internal shared functions. These are functions that are used by more than
@@ -1981,48 +2037,48 @@ sense, but are not part of the PCRE public API. */
#else
-extern int _pcre_strcmp_uc_uc(const pcre_uchar *,
+extern int PRIV(strcmp_uc_uc)(const pcre_uchar *,
const pcre_uchar *);
-extern int _pcre_strcmp_uc_c8(const pcre_uchar *,
+extern int PRIV(strcmp_uc_c8)(const pcre_uchar *,
const char *);
-extern int _pcre_strncmp_uc_uc(const pcre_uchar *,
+extern int PRIV(strncmp_uc_uc)(const pcre_uchar *,
const pcre_uchar *, unsigned int num);
-extern int _pcre_strncmp_uc_c8(const pcre_uchar *,
+extern int PRIV(strncmp_uc_c8)(const pcre_uchar *,
const char *, unsigned int num);
-extern unsigned int _pcre_strlen_uc(const pcre_uchar *str);
+extern unsigned int PRIV(strlen_uc)(const pcre_uchar *str);
#define STRCMP_UC_UC(str1, str2) \
- _pcre_strcmp_uc_uc((str1), (str2))
+ PRIV(strcmp_uc_uc)((str1), (str2))
#define STRCMP_UC_C8(str1, str2) \
- _pcre_strcmp_uc_c8((str1), (str2))
+ PRIV(strcmp_uc_c8)((str1), (str2))
#define STRNCMP_UC_UC(str1, str2, num) \
- _pcre_strncmp_uc_uc((str1), (str2), (num))
+ PRIV(strncmp_uc_uc)((str1), (str2), (num))
#define STRNCMP_UC_C8(str1, str2, num) \
- _pcre_strncmp_uc_c8((str1), (str2), (num))
-#define STRLEN_UC(str) _pcre_strlen_uc(str)
+ PRIV(strncmp_uc_c8)((str1), (str2), (num))
+#define STRLEN_UC(str) PRIV(strlen_uc)(str)
#endif /* COMPILE_PCRE8 */
-extern const pcre_uchar *_pcre_find_bracket(const pcre_uchar *, BOOL, int);
-extern BOOL _pcre_is_newline(PCRE_PUCHAR, int, PCRE_PUCHAR,
+extern const pcre_uchar *PRIV(find_bracket)(const pcre_uchar *, BOOL, int);
+extern BOOL PRIV(is_newline)(PCRE_PUCHAR, int, PCRE_PUCHAR,
int *, BOOL);
-extern int _pcre_ord2utf8(int, pcre_uint8 *);
-extern real_pcre *_pcre_try_flipped(const real_pcre *, real_pcre *,
+extern int PRIV(ord2utf8)(int, pcre_uint8 *);
+extern real_pcre *PRIV(try_flipped)(const real_pcre *, real_pcre *,
const pcre_study_data *, pcre_study_data *);
#ifndef COMPILE_PCRE16
-extern int _pcre_valid_utf8(PCRE_PUCHAR, int, int *);
+extern int PRIV(valid_utf8)(PCRE_PUCHAR, int, int *);
#else
-extern int _pcre16_valid_utf16(PCRE_PUCHAR, int, int *);
+extern int PRIV(valid_utf16)(PCRE_PUCHAR, int, int *);
#endif
-extern BOOL _pcre_was_newline(PCRE_PUCHAR, int, PCRE_PUCHAR,
+extern BOOL PRIV(was_newline)(PCRE_PUCHAR, int, PCRE_PUCHAR,
int *, BOOL);
-extern BOOL _pcre_xclass(int, const pcre_uchar *);
+extern BOOL PRIV(xclass)(int, const pcre_uchar *);
#ifdef SUPPORT_JIT
-extern void _pcre_jit_compile(const real_pcre *, pcre_extra *);
-extern int _pcre_jit_exec(const real_pcre *, void *, PCRE_SPTR,
+extern void PRIV(jit_compile)(const real_pcre *, pcre_extra *);
+extern int PRIV(jit_exec)(const real_pcre *, void *, PCRE_SPTR,
int, int, int, int, int *, int);
-extern void _pcre_jit_free(void *);
+extern void PRIV(jit_free)(void *);
#endif
/* Unicode character database (UCD) */
@@ -2033,24 +2089,24 @@ typedef struct {
pcre_int32 other_case;
} ucd_record;
-extern const ucd_record _pcre_ucd_records[];
-extern const pcre_uint8 _pcre_ucd_stage1[];
-extern const pcre_uint16 _pcre_ucd_stage2[];
-extern const int _pcre_ucp_gentype[];
+extern const ucd_record PRIV(ucd_records)[];
+extern const pcre_uint8 PRIV(ucd_stage1)[];
+extern const pcre_uint16 PRIV(ucd_stage2)[];
+extern const int PRIV(ucp_gentype)[];
#ifdef SUPPORT_JIT
-extern const int _pcre_ucp_typerange[];
+extern const int PRIV(ucp_typerange)[];
#endif
/* UCD access macros */
#define UCD_BLOCK_SIZE 128
-#define GET_UCD(ch) (_pcre_ucd_records + \
- _pcre_ucd_stage2[_pcre_ucd_stage1[(ch) / UCD_BLOCK_SIZE] * \
+#define GET_UCD(ch) (PRIV(ucd_records) + \
+ PRIV(ucd_stage2)[PRIV(ucd_stage1)[(ch) / UCD_BLOCK_SIZE] * \
UCD_BLOCK_SIZE + (ch) % UCD_BLOCK_SIZE])
#define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype
#define UCD_SCRIPT(ch) GET_UCD(ch)->script
-#define UCD_CATEGORY(ch) _pcre_ucp_gentype[UCD_CHARTYPE(ch)]
+#define UCD_CATEGORY(ch) PRIV(ucp_gentype)[UCD_CHARTYPE(ch)]
#define UCD_OTHERCASE(ch) (ch + GET_UCD(ch)->other_case)
#endif
diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c
index 998c709..17e70c4 100644
--- a/pcre_jit_compile.c
+++ b/pcre_jit_compile.c
@@ -373,7 +373,7 @@ the start pointers when the end of the capturing group has not yet reached. */
#define OVECTOR_START (8 * sizeof(sljit_w))
#define OVECTOR(i) (OVECTOR_START + (i) * sizeof(sljit_w))
#define OVECTOR_PRIV(i) (common->cbraptr + (i) * sizeof(sljit_w))
-#define PRIV(cc) (common->localptrs[(cc) - common->start])
+#define PRIV_DATA(cc) (common->localptrs[(cc) - common->start])
/* Shortcuts. */
#define DEFINE_COMPILER \
@@ -522,7 +522,7 @@ switch(*cc)
case OP_NOTPOSQUERYI:
cc += 2;
#ifdef SUPPORT_UTF8
- if (common->utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
return cc;
@@ -544,7 +544,7 @@ switch(*cc)
case OP_NOTPOSUPTOI:
cc += 4;
#ifdef SUPPORT_UTF8
- if (common->utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
return cc;
@@ -938,7 +938,7 @@ while (status != end)
case OP_SBRAPOS:
case OP_SCOND:
count = 1;
- srcw[0] = PRIV(cc);
+ srcw[0] = PRIV_DATA(cc);
SLJIT_ASSERT(srcw[0] != 0);
cc += 1 + LINK_SIZE;
break;
@@ -954,7 +954,7 @@ while (status != end)
case OP_SCBRAPOS:
count = 2;
srcw[1] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE));
- srcw[0] = PRIV(cc);
+ srcw[0] = PRIV_DATA(cc);
SLJIT_ASSERT(srcw[0] != 0);
cc += 1 + LINK_SIZE + 2;
break;
@@ -965,7 +965,7 @@ while (status != end)
if (*alternative == OP_KETRMAX || *alternative == OP_KETRMIN)
{
count = 1;
- srcw[0] = PRIV(cc);
+ srcw[0] = PRIV_DATA(cc);
SLJIT_ASSERT(srcw[0] != 0);
}
cc += 1 + LINK_SIZE;
@@ -1320,7 +1320,7 @@ if (!ispowerof2(bit))
#ifdef SUPPORT_UTF8
if (common->utf8 && c > 127)
{
- n = _pcre_utf8_table4[*cc & 0x3f];
+ n = PRIV(utf8_table4)[*cc & 0x3f];
while ((bit & 0x3f) == 0)
{
n--;
@@ -1565,7 +1565,7 @@ sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
JUMPHERE(jump);
/* We only have types for characters less than 256. */
-OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_w)_pcre_utf8_table4 - 0xc0);
+OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), (sljit_w)PRIV(utf8_table4) - 0xc0);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 0);
sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
@@ -1589,13 +1589,13 @@ SLJIT_ASSERT(UCD_BLOCK_SIZE == 128 && sizeof(ucd_record) == 8);
sljit_emit_fast_enter(compiler, RETURN_ADDR, 0, 1, 5, 5, common->localsize);
OP2(SLJIT_LSHR, TMP2, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
-OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_w)_pcre_ucd_stage1);
+OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP2), (sljit_w)PRIV(ucd_stage1));
OP2(SLJIT_AND, TMP1, 0, TMP1, 0, SLJIT_IMM, UCD_BLOCK_MASK);
OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, UCD_BLOCK_SHIFT);
OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
-OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_w)_pcre_ucd_stage2);
+OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_w)PRIV(ucd_stage2));
OP1(SLJIT_MOV_UH, TMP2, 0, SLJIT_MEM2(TMP2, TMP1), 1);
-OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_w)_pcre_ucd_records + SLJIT_OFFSETOF(ucd_record, chartype));
+OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_w)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, chartype));
OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM2(TMP1, TMP2), 3);
sljit_emit_fast_return(compiler, RETURN_ADDR, 0);
}
@@ -1687,7 +1687,7 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);
if (common->utf8)
{
singlebyte = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
- OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)_pcre_utf8_table4 - 0xc0);
+ OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
JUMPHERE(singlebyte);
}
@@ -1748,7 +1748,7 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);
if (common->utf8)
{
CMPTO(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0, start);
- OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)_pcre_utf8_table4 - 0xc0);
+ OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
}
#endif
@@ -1875,7 +1875,7 @@ OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);
if (common->utf8)
{
CMPTO(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0, start);
- OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)_pcre_utf8_table4 - 0xc0);
+ OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
}
#endif
@@ -2287,7 +2287,7 @@ if (context->sourcereg == -1)
#ifdef SUPPORT_UTF8
utf8length = 1;
if (common->utf8 && *cc >= 0xc0)
- utf8length += _pcre_utf8_table4[*cc & 0x3f];
+ utf8length += PRIV(utf8_table4)[*cc & 0x3f];
do
{
@@ -2449,7 +2449,7 @@ while (*cc != XCL_END)
{
cc += 2;
#ifdef SUPPORT_UTF8
- if (common->utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
#ifdef SUPPORT_UCP
needschar = TRUE;
@@ -2459,11 +2459,11 @@ while (*cc != XCL_END)
{
cc += 2;
#ifdef SUPPORT_UTF8
- if (common->utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
cc++;
#ifdef SUPPORT_UTF8
- if (common->utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
#ifdef SUPPORT_UCP
needschar = TRUE;
@@ -2533,13 +2533,13 @@ if (needstype || needsscript)
{
if (scriptreg == TMP1)
{
- OP1(SLJIT_MOV, scriptreg, 0, SLJIT_IMM, (sljit_w)_pcre_ucd_records + SLJIT_OFFSETOF(ucd_record, script));
+ OP1(SLJIT_MOV, scriptreg, 0, SLJIT_IMM, (sljit_w)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script));
OP1(SLJIT_MOV_UB, scriptreg, 0, SLJIT_MEM2(scriptreg, TMP2), 3);
}
else
{
OP2(SLJIT_SHL, TMP2, 0, TMP2, 0, SLJIT_IMM, 3);
- OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, (sljit_w)_pcre_ucd_records + SLJIT_OFFSETOF(ucd_record, script));
+ OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, SLJIT_IMM, (sljit_w)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, script));
OP1(SLJIT_MOV_UB, scriptreg, 0, SLJIT_MEM1(TMP2), 0);
}
}
@@ -2660,9 +2660,9 @@ while (*cc != XCL_END)
break;
case PT_GC:
- c = _pcre_ucp_typerange[(int)cc[1] * 2];
+ c = PRIV(ucp_typerange)[(int)cc[1] * 2];
SET_TYPE_OFFSET(c);
- jump = CMP(SLJIT_C_LESS_EQUAL ^ invertcmp, typereg, 0, SLJIT_IMM, _pcre_ucp_typerange[(int)cc[1] * 2 + 1] - c);
+ jump = CMP(SLJIT_C_LESS_EQUAL ^ invertcmp, typereg, 0, SLJIT_IMM, PRIV(ucp_typerange)[(int)cc[1] * 2 + 1] - c);
break;
case PT_PC:
@@ -2806,7 +2806,7 @@ switch(type)
OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);
jump[0] = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
- OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)_pcre_utf8_table4 - 0xc0);
+ OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
JUMPHERE(jump[0]);
return cc;
@@ -3021,7 +3021,7 @@ switch(type)
case OP_CHARI:
length = 1;
#ifdef SUPPORT_UTF8
- if (common->utf8 && *cc >= 0xc0) length += _pcre_utf8_table4[*cc & 0x3f];
+ if (common->utf8 && *cc >= 0xc0) length += PRIV(utf8_table4)[*cc & 0x3f];
#endif
if (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0)
{
@@ -3058,7 +3058,7 @@ switch(type)
#ifdef SUPPORT_UTF8
if (common->utf8)
{
- if (*cc >= 0xc0) length += _pcre_utf8_table4[*cc & 0x3f];
+ if (*cc >= 0xc0) length += PRIV(utf8_table4)[*cc & 0x3f];
check_input_end(common, fallbacks);
GETCHAR(c, cc);
@@ -3077,7 +3077,7 @@ switch(type)
/* Skip the variable-length character. */
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);
jump[0] = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
- OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)_pcre_utf8_table4 - 0xc0);
+ OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);
OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
JUMPHERE(jump[0]);
return cc + length;
@@ -3192,7 +3192,7 @@ do
size = 1;
#ifdef SUPPORT_UTF8
if (common->utf8 && cc[1] >= 0xc0)
- size += _pcre_utf8_table4[cc[1] & 0x3f];
+ size += PRIV(utf8_table4)[cc[1] & 0x3f];
#endif
}
else if (*cc == OP_CHARI)
@@ -3204,7 +3204,7 @@ do
if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0)
size = 0;
else if (cc[1] >= 0xc0)
- size += _pcre_utf8_table4[cc[1] & 0x3f];
+ size += PRIV(utf8_table4)[cc[1] & 0x3f];
}
else
#endif
@@ -3557,7 +3557,7 @@ if (*cc == OP_BRAZERO || *cc == OP_BRAMINZERO)
bra = *cc;
cc++;
}
-localptr = PRIV(cc);
+localptr = PRIV_DATA(cc);
SLJIT_ASSERT(localptr != 0);
framesize = get_framesize(common, cc, FALSE);
fallback->framesize = framesize;
@@ -4043,7 +4043,7 @@ if (opcode == OP_CBRA || opcode == OP_SCBRA)
else if (opcode == OP_ONCE || opcode == OP_SBRA || opcode == OP_SCOND)
{
/* Other brackets simply allocate the next entry. */
- localptr = PRIV(ccbegin);
+ localptr = PRIV_DATA(ccbegin);
SLJIT_ASSERT(localptr != 0);
FALLBACK_AS(bracket_fallback)->localptr = localptr;
if (opcode == OP_ONCE)
@@ -4429,7 +4429,7 @@ if (*cc == OP_BRAPOSZERO)
}
opcode = *cc;
-localptr = PRIV(cc);
+localptr = PRIV_DATA(cc);
SLJIT_ASSERT(localptr != 0);
FALLBACK_AS(bracketpos_fallback)->localptr = localptr;
switch(opcode)
@@ -4709,7 +4709,7 @@ if (end != NULL)
{
*end = cc + 1;
#ifdef SUPPORT_UTF8
- if (common->utf8 && *cc >= 0xc0) *end += _pcre_utf8_table4[*cc & 0x3f];
+ if (common->utf8 && *cc >= 0xc0) *end += PRIV(utf8_table4)[*cc & 0x3f];
#endif
}
return cc;
@@ -6088,7 +6088,7 @@ sljit_emit_fast_return(compiler, SLJIT_MEM1(STACK_TOP), 0);
#undef CURRENT_AS
void
-_pcre_jit_compile(const real_pcre *re, pcre_extra *extra)
+PRIV(jit_compile)(const real_pcre *re, pcre_extra *extra)
{
struct sljit_compiler *compiler;
fallback_common rootfallback;
@@ -6111,7 +6111,7 @@ SLJIT_ASSERT((extra->flags & PCRE_EXTRA_STUDY_DATA) != 0);
study = extra->study_data;
if (!tables)
- tables = _pcre_default_tables;
+ tables = PRIV(default_tables);
memset(&rootfallback, 0, sizeof(fallback_common));
rootfallback.cc = (pcre_uchar *)re + re->name_table_offset + re->name_count * re->name_entry_size;
@@ -6467,7 +6467,7 @@ return convert_executable_func.call_executable_func(arguments);
}
int
-_pcre_jit_exec(const real_pcre *re, void *executable_func,
+PRIV(jit_exec)(const real_pcre *re, void *executable_func,
PCRE_SPTR subject, int length, int start_offset, int options,
int match_limit, int *offsets, int offsetcount)
{
@@ -6523,7 +6523,7 @@ return retval;
}
void
-_pcre_jit_free(void *executable_func)
+PRIV(jit_free)(void *executable_func)
{
executable_function *function = (executable_function*)executable_func;
sljit_free_code(function->executable_func);
diff --git a/pcre_newline.c b/pcre_newline.c
index 804a2fd..92b81d1 100644
--- a/pcre_newline.c
+++ b/pcre_newline.c
@@ -73,7 +73,7 @@ Returns: TRUE or FALSE
*/
BOOL
-_pcre_is_newline(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR endptr, int *lenptr,
+PRIV(is_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR endptr, int *lenptr,
BOOL utf8)
{
int c;
@@ -123,7 +123,7 @@ Returns: TRUE or FALSE
*/
BOOL
-_pcre_was_newline(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR startptr, int *lenptr,
+PRIV(was_newline)(PCRE_PUCHAR ptr, int type, PCRE_PUCHAR startptr, int *lenptr,
BOOL utf8)
{
int c;
diff --git a/pcre_ord2utf8.c b/pcre_ord2utf8.c
index 5ae60b8..354adc0 100644
--- a/pcre_ord2utf8.c
+++ b/pcre_ord2utf8.c
@@ -63,19 +63,19 @@ Returns: number of characters placed in the buffer
*/
int
-_pcre_ord2utf8(int cvalue, pcre_uint8 *buffer)
+PRIV(ord2utf8)(int cvalue, pcre_uint8 *buffer)
{
#ifdef SUPPORT_UTF8
register int i, j;
-for (i = 0; i < _pcre_utf8_table1_size; i++)
- if (cvalue <= _pcre_utf8_table1[i]) break;
+for (i = 0; i < PRIV(utf8_table1_size); i++)
+ if (cvalue <= PRIV(utf8_table1)[i]) break;
buffer += i;
for (j = i; j > 0; j--)
{
*buffer-- = 0x80 | (cvalue & 0x3f);
cvalue >>= 6;
}
-*buffer = _pcre_utf8_table2[i] | cvalue;
+*buffer = PRIV(utf8_table2)[i] | cvalue;
return i + 1;
#else
(void)(cvalue); /* Keep compiler happy; this function won't ever be */
diff --git a/pcre_printint.src b/pcre_printint.src
index 3182ecd..faa5e06 100644
--- a/pcre_printint.src
+++ b/pcre_printint.src
@@ -90,9 +90,9 @@ if (!utf8 || (c & 0xc0) != 0xc0)
else
{
int i;
- int a = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */
+ int a = PRIV(utf8_table4)[c & 0x3f]; /* Number of additional bytes */
int s = 6*a;
- c = (c & _pcre_utf8_table3[a]) << s;
+ c = (c & PRIV(utf8_table3)[a]) << s;
for (i = 1; i <= a; i++)
{
/* This is a check for malformed UTF-8; it should only occur if the sanity
@@ -127,11 +127,11 @@ get_ucpname(int ptype, int pvalue)
{
#ifdef SUPPORT_UCP
int i;
-for (i = _pcre_utt_size - 1; i >= 0; i--)
+for (i = PRIV(utt_size) - 1; i >= 0; i--)
{
- if (ptype == _pcre_utt[i].type && pvalue == _pcre_utt[i].value) break;
+ if (ptype == PRIV(utt)[i].type && pvalue == PRIV(utt)[i].value) break;
}
-return (i >= 0)? _pcre_utt_names + _pcre_utt[i].name_offset : "??";
+return (i >= 0)? PRIV(utt_names) + PRIV(utt)[i].name_offset : "??";
#else
/* It gets harder and harder to shut off unwanted compiler warnings. */
ptype = ptype * pvalue;
@@ -193,19 +193,19 @@ for(;;)
{
/* ========================================================================== */
/* These cases are never obeyed. This is a fudge that causes a compile-
- time error if the vectors OP_names or _pcre_OP_lengths, which are indexed
+ time error if the vectors OP_names or PRIV(OP_lengths), which are indexed
by opcode, are not the correct length. It seems to be the only way to do
such a check at compile time, as the sizeof() operator does not work in
the C preprocessor. We do this while compiling pcretest, because that
- #includes pcre_tables.c, which holds _pcre_OP_lengths. We can't do this
+ #includes pcre_tables.c, which holds PRIV(OP_lengths). We can't do this
when building pcre_compile.c with PCRE_DEBUG set, because it doesn't then
- know the size of _pcre_OP_lengths. */
+ know the size of PRIV(OP_lengths). */
#ifdef COMPILING_PCRETEST
case OP_TABLE_LENGTH:
case OP_TABLE_LENGTH +
((sizeof(OP_names)/sizeof(const char *) == OP_TABLE_LENGTH) &&
- (sizeof(_pcre_OP_lengths) == OP_TABLE_LENGTH)):
+ (sizeof(PRIV(OP_lengths)) == OP_TABLE_LENGTH)):
break;
#endif
/* ========================================================================== */
@@ -445,7 +445,7 @@ for(;;)
/* Fall through */
case OP_REF:
fprintf(f, " %s \\%d", flag, GET2(code,1));
- ccode = code + _pcre_OP_lengths[*code];
+ ccode = code + PRIV(OP_lengths)[*code];
goto CLASS_REF_REPEAT;
case OP_CALLOUT:
@@ -558,7 +558,7 @@ for(;;)
case OP_CRQUERY:
case OP_CRMINQUERY:
fprintf(f, "%s", OP_names[*ccode]);
- extra += _pcre_OP_lengths[*ccode];
+ extra += PRIV(OP_lengths)[*ccode];
break;
case OP_CRRANGE:
@@ -568,7 +568,7 @@ for(;;)
if (max == 0) fprintf(f, "{%d,}", min);
else fprintf(f, "{%d,%d}", min, max);
if (*ccode == OP_CRMINRANGE) fprintf(f, "?");
- extra += _pcre_OP_lengths[*ccode];
+ extra += PRIV(OP_lengths)[*ccode];
break;
/* Do nothing if it's not a repeat; this code stops picky compilers
@@ -608,7 +608,7 @@ for(;;)
break;
}
- code += _pcre_OP_lengths[*code] + extra;
+ code += PRIV(OP_lengths)[*code] + extra;
fprintf(f, "\n");
}
}
diff --git a/pcre_str_utils.c b/pcre_string_utils.c
index 9bd8002..0648c1a 100644
--- a/pcre_str_utils.c
+++ b/pcre_string_utils.c
@@ -65,7 +65,7 @@ Returns: 0 if both string are equal (like strcmp), 1 otherwise
*/
int
-_pcre_strcmp_uc_uc(const pcre_uchar *str1, const pcre_uchar *str2)
+PRIV(strcmp_uc_uc)(const pcre_uchar *str1, const pcre_uchar *str2)
{
pcre_uchar c1;
pcre_uchar c2;
@@ -82,7 +82,7 @@ return 0;
}
int
-_pcre_strcmp_uc_c8(const pcre_uchar *str1, const char *str2)
+PRIV(strcmp_uc_c8)(const pcre_uchar *str1, const char *str2)
{
const pcre_uint8 *ustr2 = (pcre_uint8 *)str2;
pcre_uchar c1;
@@ -111,7 +111,7 @@ Returns: 0 if both string are equal (like strcmp), 1 otherwise
*/
int
-_pcre_strncmp_uc_uc(const pcre_uchar *str1, const pcre_uchar *str2, unsigned int num)
+PRIV(strncmp_uc_uc)(const pcre_uchar *str1, const pcre_uchar *str2, unsigned int num)
{
pcre_uchar c1;
pcre_uchar c2;
@@ -128,7 +128,7 @@ return 0;
}
int
-_pcre_strncmp_uc_c8(const pcre_uchar *str1, const char *str2, unsigned int num)
+PRIV(strncmp_uc_c8)(const pcre_uchar *str1, const char *str2, unsigned int num)
{
const pcre_uint8 *ustr2 = (pcre_uint8 *)str2;
pcre_uchar c1;
@@ -155,7 +155,7 @@ Returns: length of the string
*/
unsigned int
-_pcre_strlen_uc(const pcre_uchar *str)
+PRIV(strlen_uc)(const pcre_uchar *str)
{
unsigned int len = 0;
while (*str++ != 0)
@@ -165,4 +165,4 @@ return len;
#endif /* COMPILE_PCRE8 */
-/* End of pcre_str_utils.c */
+/* End of pcre_string_utils.c */
diff --git a/pcre_study.c b/pcre_study.c
index cc515ac..92cf32b 100644
--- a/pcre_study.c
+++ b/pcre_study.c
@@ -189,7 +189,7 @@ for (;;)
case OP_DOLLM:
case OP_NOT_WORD_BOUNDARY:
case OP_WORD_BOUNDARY:
- cc += _pcre_OP_lengths[*cc];
+ cc += PRIV(OP_lengths)[*cc];
break;
/* Skip over a subpattern that has a {0} or {0,x} quantifier */
@@ -198,7 +198,7 @@ for (;;)
case OP_BRAMINZERO:
case OP_BRAPOSZERO:
case OP_SKIPZERO:
- cc += _pcre_OP_lengths[*cc];
+ cc += PRIV(OP_lengths)[*cc];
do cc += GET(cc, 1); while (*cc == OP_ALT);
cc += 1 + LINK_SIZE;
break;
@@ -224,7 +224,7 @@ for (;;)
branchlength++;
cc += 2;
#ifdef SUPPORT_UTF8
- if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
break;
@@ -245,7 +245,7 @@ for (;;)
branchlength += GET2(cc,1);
cc += 4;
#ifdef SUPPORT_UTF8
- if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
break;
@@ -308,14 +308,14 @@ for (;;)
case OP_TYPEPOSSTAR:
case OP_TYPEPOSQUERY:
if (cc[1] == OP_PROP || cc[1] == OP_NOTPROP) cc += 2;
- cc += _pcre_OP_lengths[op];
+ cc += PRIV(OP_lengths)[op];
break;
case OP_TYPEUPTO:
case OP_TYPEMINUPTO:
case OP_TYPEPOSUPTO:
if (cc[3] == OP_PROP || cc[3] == OP_NOTPROP) cc += 2;
- cc += _pcre_OP_lengths[op];
+ cc += PRIV(OP_lengths)[op];
break;
/* Check a class for variable quantification */
@@ -372,7 +372,7 @@ for (;;)
case OP_REFI:
if ((options & PCRE_JAVASCRIPT_COMPAT) == 0)
{
- ce = cs = (pcre_uchar *)_pcre_find_bracket(startcode, utf8, GET2(cc, 1));
+ ce = cs = (pcre_uchar *)PRIV(find_bracket)(startcode, utf8, GET2(cc, 1));
if (cs == NULL) return -2;
do ce += GET(ce, 1); while (*ce == OP_ALT);
if (cc > cs && cc < ce)
@@ -482,9 +482,9 @@ for (;;)
case OP_NOTPOSQUERY:
case OP_NOTPOSQUERYI:
- cc += _pcre_OP_lengths[op];
+ cc += PRIV(OP_lengths)[op];
#ifdef SUPPORT_UTF8
- if (utf8 && cc[-1] >= 0xc0) cc += _pcre_utf8_table4[cc[-1] & 0x3f];
+ if (utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
#endif
break;
@@ -494,7 +494,7 @@ for (;;)
case OP_PRUNE_ARG:
case OP_SKIP_ARG:
case OP_THEN_ARG:
- cc += _pcre_OP_lengths[op] + cc[1];
+ cc += PRIV(OP_lengths)[op] + cc[1];
break;
/* The remaining opcodes are just skipped over. */
@@ -506,7 +506,7 @@ for (;;)
case OP_SET_SOM:
case OP_SKIP:
case OP_THEN:
- cc += _pcre_OP_lengths[op];
+ cc += PRIV(OP_lengths)[op];
break;
/* This should not occur: we list all opcodes explicitly so that when
@@ -557,7 +557,7 @@ if (utf8 && c > 127)
{
pcre_uint8 buff[8];
c = UCD_OTHERCASE(c);
- (void)_pcre_ord2utf8(c, buff);
+ (void)PRIV(ord2utf8)(c, buff);
SET_BIT(buff[0]);
}
#endif
@@ -605,7 +605,7 @@ for (c = 128; c < 256; c++)
if ((cd->cbits[c/8] & (1 << (c&7))) != 0)
{
pcre_uint8 buff[8];
- (void)_pcre_ord2utf8(c, buff);
+ (void)PRIV(ord2utf8)(c, buff);
SET_BIT(buff[0]);
}
}
@@ -1346,7 +1346,7 @@ if (bits_set || min > 0
#ifdef SUPPORT_JIT
extra->executable_jit = NULL;
- if ((options & PCRE_STUDY_JIT_COMPILE) != 0) _pcre_jit_compile(re, extra);
+ if ((options & PCRE_STUDY_JIT_COMPILE) != 0) PRIV(jit_compile)(re, extra);
if (study->flags == 0 && (extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) == 0)
{
pcre_free_study(extra);
@@ -1375,7 +1375,7 @@ pcre_free_study(pcre_extra *extra)
#ifdef SUPPORT_JIT
if ((extra->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 &&
extra->executable_jit != NULL)
- _pcre_jit_free(extra->executable_jit);
+ PRIV(jit_free)(extra->executable_jit);
#endif
pcre_free(extra);
}
diff --git a/pcre_tables.c b/pcre_tables.c
index 1d48c5d..7c52961 100644
--- a/pcre_tables.c
+++ b/pcre_tables.c
@@ -54,7 +54,7 @@ clashes with the library. */
/* Table of sizes for the fixed-length opcodes. It's defined in a macro so that
the definition is next to the definition of the opcodes in pcre_internal.h. */
-const pcre_uint8 _pcre_OP_lengths[] = { OP_LENGTHS };
+const pcre_uint8 PRIV(OP_lengths)[] = { OP_LENGTHS };
@@ -67,21 +67,21 @@ character. */
#ifdef SUPPORT_UTF8
-const int _pcre_utf8_table1[] =
+const int PRIV(utf8_table1)[] =
{ 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff};
-const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int);
+const int PRIV(utf8_table1_size) = sizeof(PRIV(utf8_table1)) / sizeof(int);
/* These are the indicator bits and the mask for the data bits to set in the
first byte of a character, indexed by the number of additional bytes. */
-const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
-const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01};
+const int PRIV(utf8_table2)[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
+const int PRIV(utf8_table3)[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01};
/* Table of the number of extra bytes, indexed by the first byte masked with
0x3f. The highest number for a valid UTF-8 first byte is in fact 0x3d. */
-const pcre_uint8 _pcre_utf8_table4[] = {
+const pcre_uint8 PRIV(utf8_table4)[] = {
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
@@ -89,7 +89,7 @@ const pcre_uint8 _pcre_utf8_table4[] = {
/* Table to translate from particular type value to the general value. */
-const int _pcre_ucp_gentype[] = {
+const int PRIV(ucp_gentype)[] = {
ucp_C, ucp_C, ucp_C, ucp_C, ucp_C, /* Cc, Cf, Cn, Co, Cs */
ucp_L, ucp_L, ucp_L, ucp_L, ucp_L, /* Ll, Lu, Lm, Lo, Lt */
ucp_M, ucp_M, ucp_M, /* Mc, Me, Mn */
@@ -101,10 +101,10 @@ const int _pcre_ucp_gentype[] = {
};
#ifdef SUPPORT_JIT
-/* This table reverses _pcre_ucp_gentype. We can save the cost
+/* This table reverses PRIV(ucp_gentype). We can save the cost
of a memory load. */
-const int _pcre_ucp_typerange[] = {
+const int PRIV(ucp_typerange)[] = {
ucp_Cc, ucp_Cs,
ucp_Ll, ucp_Lu,
ucp_Mc, ucp_Mn,
@@ -271,7 +271,7 @@ strings to make sure that UTF-8 support works on EBCDIC platforms. */
#define STRING_Zp0 STR_Z STR_p "\0"
#define STRING_Zs0 STR_Z STR_s "\0"
-const char _pcre_utt_names[] =
+const char PRIV(utt_names)[] =
STRING_Any0
STRING_Arabic0
STRING_Armenian0
@@ -411,7 +411,7 @@ const char _pcre_utt_names[] =
STRING_Zp0
STRING_Zs0;
-const ucp_type_table _pcre_utt[] = {
+const ucp_type_table PRIV(utt)[] = {
{ 0, PT_ANY, 0 },
{ 4, PT_SC, ucp_Arabic },
{ 11, PT_SC, ucp_Armenian },
@@ -552,7 +552,7 @@ const ucp_type_table _pcre_utt[] = {
{ 961, PT_PC, ucp_Zs }
};
-const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table);
+const int PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);
#endif /* SUPPORT_UTF8 */
diff --git a/pcre_try_flipped.c b/pcre_try_flipped.c
index 606504c..7309876 100644
--- a/pcre_try_flipped.c
+++ b/pcre_try_flipped.c
@@ -99,7 +99,7 @@ Returns: the new block if is is indeed a byte-flipped regex
*/
real_pcre *
-_pcre_try_flipped(const real_pcre *re, real_pcre *internal_re,
+PRIV(try_flipped)(const real_pcre *re, real_pcre *internal_re,
const pcre_study_data *study, pcre_study_data *internal_study)
{
if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER)
diff --git a/pcre_ucd.c b/pcre_ucd.c
index c7c7e3d..b25574e 100644
--- a/pcre_ucd.c
+++ b/pcre_ucd.c
@@ -18,9 +18,9 @@
/* Instead, just supply small dummy tables. */
#ifndef SUPPORT_UCP
-const ucd_record _pcre_ucd_records[] = {{0,0,0 }};
-const pcre_uint8 _pcre_ucd_stage1[] = {0};
-const pcre_uint16 _pcre_ucd_stage2[] = {0};
+const ucd_record PRIV(ucd_records)[] = {{0,0,0 }};
+const pcre_uint8 PRIV(ucd_stage1)[] = {0};
+const pcre_uint16 PRIV(ucd_stage2)[] = {0};
#else
/* When recompiling tables with a new Unicode version,
@@ -32,7 +32,7 @@ pcre_int32 property_2;
} ucd_record; */
-const ucd_record _pcre_ucd_records[] = { /* 4320 bytes, record size 8 */
+const ucd_record PRIV(ucd_records)[] = { /* 4320 bytes, record size 8 */
{ 9, 0, 0, }, /* 0 */
{ 9, 29, 0, }, /* 1 */
{ 9, 21, 0, }, /* 2 */
@@ -575,7 +575,7 @@ const ucd_record _pcre_ucd_records[] = { /* 4320 bytes, record size 8 */
{ 26, 26, 0, }, /* 539 */
};
-const pcre_uint8 _pcre_ucd_stage1[] = { /* 8704 bytes */
+const pcre_uint8 PRIV(ucd_stage1)[] = { /* 8704 bytes */
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* U+0000 */
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, /* U+0800 */
32, 33, 34, 34, 35, 36, 37, 38, 39, 40, 40, 40, 41, 42, 43, 44, /* U+1000 */
@@ -1122,7 +1122,7 @@ const pcre_uint8 _pcre_ucd_stage1[] = { /* 8704 bytes */
114,114,114,114,114,114,114,114,114,114,114,114,114,114,114,184, /* U+10F800 */
};
-const pcre_uint16 _pcre_ucd_stage2[] = { /* 47360 bytes, block = 128 */
+const pcre_uint16 PRIV(ucd_stage2)[] = { /* 47360 bytes, block = 128 */
/* block 0 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/pcre_ucp_searchfuncs.c b/pcre_ucp_searchfuncs.c
index a11b35c..91d5a47 100644
--- a/pcre_ucp_searchfuncs.c
+++ b/pcre_ucp_searchfuncs.c
@@ -92,7 +92,7 @@ Returns: the character type category
*/
int
-_pcre_ucp_findprop(const unsigned int c, int *type_ptr, int *script_ptr)
+PRIV(ucp_findprop)(const unsigned int c, int *type_ptr, int *script_ptr)
{
int bot = 0;
int top = sizeof(ucp_table)/sizeof(cnode);
@@ -148,7 +148,7 @@ Returns: the other case or NOTACHAR if none
*/
unsigned int
-_pcre_ucp_othercase(const unsigned int c)
+PRIV(ucp_othercase)(const unsigned int c)
{
int bot = 0;
int top = sizeof(ucp_table)/sizeof(cnode);
diff --git a/pcre_valid_utf8.c b/pcre_valid_utf8.c
index 1861a4b..8d13014 100644
--- a/pcre_valid_utf8.c
+++ b/pcre_valid_utf8.c
@@ -103,7 +103,7 @@ Returns: = 0 if the string is a valid UTF-8 string
*/
int
-_pcre_valid_utf8(PCRE_PUCHAR string, int length, int *erroroffset)
+PRIV(valid_utf8)(PCRE_PUCHAR string, int length, int *erroroffset)
{
#ifdef SUPPORT_UTF8
register PCRE_PUCHAR p;
@@ -133,7 +133,7 @@ for (p = string; length-- > 0; p++)
return PCRE_UTF8_ERR21;
}
- ab = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */
+ ab = PRIV(utf8_table4)[c & 0x3f]; /* Number of additional bytes */
if (length < ab)
{
*erroroffset = p - string; /* Missing bytes */
diff --git a/pcre_xclass.c b/pcre_xclass.c
index 76c1767..024d71d 100644
--- a/pcre_xclass.c
+++ b/pcre_xclass.c
@@ -64,7 +64,7 @@ Returns: TRUE if character matches, else FALSE
*/
BOOL
-_pcre_xclass(int c, const pcre_uchar *data)
+PRIV(xclass)(int c, const pcre_uchar *data)
{
int t;
BOOL negated = (*data & XCL_NOT) != 0;
@@ -117,7 +117,7 @@ while ((t = *data++) != XCL_END)
break;
case PT_GC:
- if ((data[1] == _pcre_ucp_gentype[prop->chartype]) == (t == XCL_PROP))
+ if ((data[1] == PRIV(ucp_gentype)[prop->chartype]) == (t == XCL_PROP))
return !negated;
break;
@@ -130,28 +130,28 @@ while ((t = *data++) != XCL_END)
break;
case PT_ALNUM:
- if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N) == (t == XCL_PROP))
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N) == (t == XCL_PROP))
return !negated;
break;
case PT_SPACE: /* Perl space */
- if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR)
== (t == XCL_PROP))
return !negated;
break;
case PT_PXSPACE: /* POSIX space */
- if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
c == CHAR_FF || c == CHAR_CR) == (t == XCL_PROP))
return !negated;
break;
case PT_WORD:
- if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||
- _pcre_ucp_gentype[prop->chartype] == ucp_N || c == CHAR_UNDERSCORE)
+ if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
+ PRIV(ucp_gentype)[prop->chartype] == ucp_N || c == CHAR_UNDERSCORE)
== (t == XCL_PROP))
return !negated;
break;