[Pcre-svn] [764] code/branches/pcre16: PRIV macro added, sev…

Startseite
Nachricht löschen
Autor: Subversion repository
Datum:  
To: pcre-svn
Betreff: [Pcre-svn] [764] code/branches/pcre16: PRIV macro added, several new files added
Revision: 764
          http://vcs.pcre.org/viewvc?view=rev&revision=764
Author:   zherczeg
Date:     2011-11-23 17:23:20 +0000 (Wed, 23 Nov 2011)


Log Message:
-----------
PRIV macro added, several new files added

Modified Paths:
--------------
    code/branches/pcre16/Makefile.am
    code/branches/pcre16/dftables.c
    code/branches/pcre16/pcre16_valid_utf16.c
    code/branches/pcre16/pcre_chartables.c.dist
    code/branches/pcre16/pcre_compile.c
    code/branches/pcre16/pcre_dfa_exec.c
    code/branches/pcre16/pcre_exec.c
    code/branches/pcre16/pcre_fullinfo.c
    code/branches/pcre16/pcre_info.c
    code/branches/pcre16/pcre_internal.h
    code/branches/pcre16/pcre_jit_compile.c
    code/branches/pcre16/pcre_newline.c
    code/branches/pcre16/pcre_ord2utf8.c
    code/branches/pcre16/pcre_printint.src
    code/branches/pcre16/pcre_study.c
    code/branches/pcre16/pcre_tables.c
    code/branches/pcre16/pcre_try_flipped.c
    code/branches/pcre16/pcre_ucd.c
    code/branches/pcre16/pcre_ucp_searchfuncs.c
    code/branches/pcre16/pcre_valid_utf8.c
    code/branches/pcre16/pcre_xclass.c


Added Paths:
-----------
    code/branches/pcre16/pcre16_chartables.c
    code/branches/pcre16/pcre16_exec.c
    code/branches/pcre16/pcre16_jit_compile.c
    code/branches/pcre16/pcre16_newline.c
    code/branches/pcre16/pcre16_string_utils.c
    code/branches/pcre16/pcre16_study.c
    code/branches/pcre16/pcre16_tables.c
    code/branches/pcre16/pcre16_try_flipped.c
    code/branches/pcre16/pcre16_utf16_utils.c
    code/branches/pcre16/pcre_string_utils.c


Removed Paths:
-------------
    code/branches/pcre16/pcre16_convert_utf16.c
    code/branches/pcre16/pcre_str_utils.c


Modified: code/branches/pcre16/Makefile.am
===================================================================
--- code/branches/pcre16/Makefile.am    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/Makefile.am    2011-11-23 17:23:20 UTC (rev 764)
@@ -189,7 +189,7 @@
   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 @@
 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.

Modified: code/branches/pcre16/dftables.c
===================================================================
--- code/branches/pcre16/dftables.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/dftables.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -114,7 +114,7 @@
   "#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, " ");

Added: code/branches/pcre16/pcre16_chartables.c
===================================================================
--- code/branches/pcre16/pcre16_chartables.c                            (rev 0)
+++ code/branches/pcre16/pcre16_chartables.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -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 */


Deleted: code/branches/pcre16/pcre16_convert_utf16.c
===================================================================
--- code/branches/pcre16/pcre16_convert_utf16.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre16_convert_utf16.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -1,87 +0,0 @@
-/*************************************************
-*      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-2009 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.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains a function for converting any UTF-16 character
-strings to host byte order. */
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "pcre_internal.h"
-
-int
-pcre16_utf16_to_host_byte_order(PCRE_SCHAR16 *output, PCRE_SPTR16 input, int length, int keep_boms)
-{
-#ifdef SUPPORT_UTF16
-/* This function converts any UTF-16 string to host byte order and optionally removes
-any Byte Order Marks (BOMS). Returns with the remainig length. */
-BOOL same_bo = TRUE;
-PCRE_SPTR16 end = input + length;
-/* The c variable must be unsigned. */
-register uschar c;
-
-while (input < end)
-  {
-  c = *input++;
-  if (c == 0xfeff || c == 0xfffe)
-    {
-    /* Detecting the byte order of the machine is unnecessary, it is
-    enough to know that the UTF-16 string has the same byte order or not. */
-    same_bo = c == 0xfeff;
-    if (keep_boms != 0)
-      *output++ = 0xfeff;
-    else
-      length--;
-    }
-  else
-    *output++ = same_bo ? c : ((c >> 8) | (c << 8)); /* Flip bytes if needed. */
-  }
-
-#else
-(void)(output);  /* Keep picky compilers happy */
-(void)(input);
-(void)(keep_boms);
-#endif
-return length;
-}
-
-/* End of pcre16_convert_utf16.c */


Added: code/branches/pcre16/pcre16_exec.c
===================================================================
--- code/branches/pcre16/pcre16_exec.c                            (rev 0)
+++ code/branches/pcre16/pcre16_exec.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -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 */


Added: code/branches/pcre16/pcre16_jit_compile.c
===================================================================
--- code/branches/pcre16/pcre16_jit_compile.c                            (rev 0)
+++ code/branches/pcre16/pcre16_jit_compile.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -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 */


Added: code/branches/pcre16/pcre16_newline.c
===================================================================
--- code/branches/pcre16/pcre16_newline.c                            (rev 0)
+++ code/branches/pcre16/pcre16_newline.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -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 */


Added: code/branches/pcre16/pcre16_string_utils.c
===================================================================
--- code/branches/pcre16/pcre16_string_utils.c                            (rev 0)
+++ code/branches/pcre16/pcre16_string_utils.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -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 */


Added: code/branches/pcre16/pcre16_study.c
===================================================================
--- code/branches/pcre16/pcre16_study.c                            (rev 0)
+++ code/branches/pcre16/pcre16_study.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -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 */


Added: code/branches/pcre16/pcre16_tables.c
===================================================================
--- code/branches/pcre16/pcre16_tables.c                            (rev 0)
+++ code/branches/pcre16/pcre16_tables.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -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 */


Added: code/branches/pcre16/pcre16_try_flipped.c
===================================================================
--- code/branches/pcre16/pcre16_try_flipped.c                            (rev 0)
+++ code/branches/pcre16/pcre16_try_flipped.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -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 */


Copied: code/branches/pcre16/pcre16_utf16_utils.c (from rev 763, code/branches/pcre16/pcre16_convert_utf16.c)
===================================================================
--- code/branches/pcre16/pcre16_utf16_utils.c                            (rev 0)
+++ code/branches/pcre16/pcre16_utf16_utils.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -0,0 +1,87 @@
+/*************************************************
+*      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-2009 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.
+-----------------------------------------------------------------------------
+*/
+
+
+/* This module contains a function for converting any UTF-16 character
+strings to host byte order. */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "pcre_internal.h"
+
+int
+pcre16_utf16_to_host_byte_order(PCRE_SCHAR16 *output, PCRE_SPTR16 input, int length, int keep_boms)
+{
+#ifdef SUPPORT_UTF16
+/* This function converts any UTF-16 string to host byte order and optionally removes
+any Byte Order Marks (BOMS). Returns with the remainig length. */
+BOOL same_bo = TRUE;
+PCRE_SPTR16 end = input + length;
+/* The c variable must be unsigned. */
+register uschar c;
+
+while (input < end)
+  {
+  c = *input++;
+  if (c == 0xfeff || c == 0xfffe)
+    {
+    /* Detecting the byte order of the machine is unnecessary, it is
+    enough to know that the UTF-16 string has the same byte order or not. */
+    same_bo = c == 0xfeff;
+    if (keep_boms != 0)
+      *output++ = 0xfeff;
+    else
+      length--;
+    }
+  else
+    *output++ = same_bo ? c : ((c >> 8) | (c << 8)); /* Flip bytes if needed. */
+  }
+
+#else
+(void)(output);  /* Keep picky compilers happy */
+(void)(input);
+(void)(keep_boms);
+#endif
+return length;
+}
+
+/* End of pcre16_utf16_utils.c */


Modified: code/branches/pcre16/pcre16_valid_utf16.c
===================================================================
--- code/branches/pcre16/pcre16_valid_utf16.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre16_valid_utf16.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -66,7 +66,7 @@
 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 @@
 */


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;

Modified: code/branches/pcre16/pcre_chartables.c.dist
===================================================================
--- code/branches/pcre16/pcre_chartables.c.dist    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_chartables.c.dist    2011-11-23 17:23:20 UTC (rev 764)
@@ -26,7 +26,7 @@


#include "pcre_internal.h"

-const unsigned char _pcre_default_tables[] = {
+const pcre_uint8 PRIV(default_tables)[] = {

/* This table is a lower casing table. */


Modified: code/branches/pcre16/pcre_compile.c
===================================================================
--- code/branches/pcre16/pcre_compile.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_compile.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -1113,16 +1113,16 @@
 /* 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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
*/

 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 @@
   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 @@
     {
     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 @@

     /* 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 @@
       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 @@


     /* 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 @@
       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 @@
   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 @@
   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 @@
     {
     /* 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 @@
     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 @@
     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 @@
           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 @@
/* 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 @@
               {
               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 @@
               {
               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 @@
               {
               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 @@
               {
               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 @@
               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 @@
           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 @@
         {
         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 @@
           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 @@


 #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 @@
       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 @@
             {
             *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 @@

 #ifdef SUPPORT_UTF8
     if (utf8 && c > 127)
-      mclength = _pcre_ord2utf8(c, mcbuffer);
+      mclength = PRIV(ord2utf8)(c, mcbuffer);
     else
 #endif


@@ -6984,7 +6984,7 @@
 {
 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 @@
 {
 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 @@
    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 @@


/* 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 @@
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_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 @@
   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 @@
   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)
       {


Modified: code/branches/pcre16/pcre_dfa_exec.c
===================================================================
--- code/branches/pcre16/pcre_dfa_exec.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_dfa_exec.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -1024,7 +1024,7 @@
           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 @@
           /* 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 @@
           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 @@
           /* 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 @@
           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 @@
           /* 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 @@
           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 @@
           /* 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 @@
         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 @@
             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 @@
         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 @@

 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 @@
 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 @@
 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. */

Modified: code/branches/pcre16/pcre_exec.c
===================================================================
--- code/branches/pcre16/pcre_exec.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_exec.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -702,7 +702,7 @@
     {
     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 @@
     /* 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 @@
     /* 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 @@
     /* 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 @@
     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 @@
     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 (;;)
         {
         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 @@

       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 @@
         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 (;;)
       {
       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 @@
         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 @@
       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 @@
         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 @@
         /* 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 @@
         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 @@
           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 @@
             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 @@
             break;
             }
           GETCHARLENTEST(c, eptr, len);
-          if (!_pcre_xclass(c, data)) break;
+          if (!PRIV(xclass)(c, data)) break;
           eptr += len;
           }
         for(;;)
@@ -3184,7 +3184,7 @@
         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 @@
 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 @@
     && (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 @@
 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 @@

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;
}

Modified: code/branches/pcre16/pcre_fullinfo.c
===================================================================
--- code/branches/pcre16/pcre_fullinfo.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_fullinfo.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -81,7 +81,7 @@


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 @@
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

Modified: code/branches/pcre16/pcre_info.c
===================================================================
--- code/branches/pcre16/pcre_info.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_info.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -80,7 +80,7 @@
 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);


Modified: code/branches/pcre16/pcre_internal.h
===================================================================
--- code/branches/pcre16/pcre_internal.h    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_internal.h    2011-11-23 17:23:20 UTC (rev 764)
@@ -40,7 +40,8 @@


/* 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 @@
 #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 @@
 #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 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,14 +398,52 @@
#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 */

#define PUTINC(a,n,d) PUT(a,n,d), a += LINK_SIZE
@@ -423,8 +464,9 @@
#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 @@

#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 @@
#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 @@
#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 @@
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 @@

#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 @@
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

Modified: code/branches/pcre16/pcre_jit_compile.c
===================================================================
--- code/branches/pcre16/pcre_jit_compile.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_jit_compile.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -373,7 +373,7 @@
 #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 @@
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 @@
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 @@
       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 @@
       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 @@
       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 @@
 #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 @@
 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_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 @@
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 @@
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 @@
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 @@
#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 @@
     {
     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 @@
     {
     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 (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 @@
       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 @@
     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 @@
   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 @@
 #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 @@
       /* 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 @@
     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 @@
       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 @@
   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 @@
 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 @@
   }


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 @@
{
*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 @@
#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 @@
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 @@
}

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 @@
}

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);

Modified: code/branches/pcre16/pcre_newline.c
===================================================================
--- code/branches/pcre16/pcre_newline.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_newline.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -73,7 +73,7 @@
 */


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 @@
*/

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;

Modified: code/branches/pcre16/pcre_ord2utf8.c
===================================================================
--- code/branches/pcre16/pcre_ord2utf8.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_ord2utf8.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -63,19 +63,19 @@
 */


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 */

Modified: code/branches/pcre16/pcre_printint.src
===================================================================
--- code/branches/pcre16/pcre_printint.src    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_printint.src    2011-11-23 17:23:20 UTC (rev 764)
@@ -90,9 +90,9 @@
 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 @@
 {
 #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 @@
     {
 /* ========================================================================== */
       /* 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 @@
     /* 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 @@
         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 @@
         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 @@
     break;
     }


- code += _pcre_OP_lengths[*code] + extra;
+ code += PRIV(OP_lengths)[*code] + extra;
fprintf(f, "\n");
}
}

Deleted: code/branches/pcre16/pcre_str_utils.c
===================================================================
--- code/branches/pcre16/pcre_str_utils.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_str_utils.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -1,168 +0,0 @@
-/*************************************************
-*      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-2010 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.
------------------------------------------------------------------------------
-*/
-
-
-/* This module contains an internal function that is used to match an extended
-class. It is used by both pcre_exec() and pcre_def_exec(). */
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "pcre_internal.h"
-
-#ifndef COMPILE_PCRE8
-
-/*************************************************
-*           Compare string utilities             *
-*************************************************/
-
-/* The following two functions compares two strings. Basically an strcmp
-for non 8 bit characters.
-
-Arguments:
-  str1        first string
-  str2        second string
-
-Returns:      0 if both string are equal (like strcmp), 1 otherwise
-*/
-
-int
-_pcre_strcmp_uc_uc(const pcre_uchar *str1, const pcre_uchar *str2)
-{
-pcre_uchar c1;
-pcre_uchar c2;
-
-while (*str1 != '\0' || *str2 != '\0')
-  {
-  c1 = *str1++;
-  c2 = *str2++;
-  if (c1 != c2)
-    return ((c1 > c2) << 1) - 1;
-  }
-/* Both length and characters must be equal. */
-return 0;
-}
-
-int
-_pcre_strcmp_uc_c8(const pcre_uchar *str1, const char *str2)
-{
-const pcre_uint8 *ustr2 = (pcre_uint8 *)str2;
-pcre_uchar c1;
-pcre_uchar c2;
-
-while (*str1 != '\0' || *ustr2 != '\0')
-  {
-  c1 = *str1++;
-  c2 = (pcre_uchar)*ustr2++;
-  if (c1 != c2)
-    return ((c1 > c2) << 1) - 1;
-  }
-/* Both length and characters must be equal. */
-return 0;
-}
-
-/* The following two functions compares two, fixed length
-strings. Basically an strncmp for non 8 bit characters.
-
-Arguments:
-  str1        first string
-  str2        second string
-  num         size of the string
-
-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)
-{
-pcre_uchar c1;
-pcre_uchar c2;
-
-while (num-- > 0)
-  {
-  c1 = *str1++;
-  c2 = *str2++;
-  if (c1 != c2)
-    return ((c1 > c2) << 1) - 1;
-  }
-/* Both length and characters must be equal. */
-return 0;
-}
-
-int
-_pcre_strncmp_uc_c8(const pcre_uchar *str1, const char *str2, unsigned int num)
-{
-const pcre_uint8 *ustr2 = (pcre_uint8 *)str2;
-pcre_uchar c1;
-pcre_uchar c2;
-
-while (num-- > 0)
-  {
-  c1 = *str1++;
-  c2 = (pcre_uchar)*ustr2++;
-  if (c1 != c2)
-    return ((c1 > c2) << 1) - 1;
-  }
-/* Both length and characters must be equal. */
-return 0;
-}
-
-/* The following function returns with the length of
-a zero terminated string. Basically an strlen for non 8 bit characters.
-
-Arguments:
-  str         string
-
-Returns:      length of the string
-*/
-
-unsigned int
-_pcre_strlen_uc(const pcre_uchar *str)
-{
-unsigned int len = 0;
-while (*str++ != 0)
-  len++;
-return len;
-}
-
-#endif /* COMPILE_PCRE8 */
-
-/* End of pcre_str_utils.c */


Copied: code/branches/pcre16/pcre_string_utils.c (from rev 763, code/branches/pcre16/pcre_str_utils.c)
===================================================================
--- code/branches/pcre16/pcre_string_utils.c                            (rev 0)
+++ code/branches/pcre16/pcre_string_utils.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -0,0 +1,168 @@
+/*************************************************
+*      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-2010 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.
+-----------------------------------------------------------------------------
+*/
+
+
+/* This module contains an internal function that is used to match an extended
+class. It is used by both pcre_exec() and pcre_def_exec(). */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "pcre_internal.h"
+
+#ifndef COMPILE_PCRE8
+
+/*************************************************
+*           Compare string utilities             *
+*************************************************/
+
+/* The following two functions compares two strings. Basically an strcmp
+for non 8 bit characters.
+
+Arguments:
+  str1        first string
+  str2        second string
+
+Returns:      0 if both string are equal (like strcmp), 1 otherwise
+*/
+
+int
+PRIV(strcmp_uc_uc)(const pcre_uchar *str1, const pcre_uchar *str2)
+{
+pcre_uchar c1;
+pcre_uchar c2;
+
+while (*str1 != '\0' || *str2 != '\0')
+  {
+  c1 = *str1++;
+  c2 = *str2++;
+  if (c1 != c2)
+    return ((c1 > c2) << 1) - 1;
+  }
+/* Both length and characters must be equal. */
+return 0;
+}
+
+int
+PRIV(strcmp_uc_c8)(const pcre_uchar *str1, const char *str2)
+{
+const pcre_uint8 *ustr2 = (pcre_uint8 *)str2;
+pcre_uchar c1;
+pcre_uchar c2;
+
+while (*str1 != '\0' || *ustr2 != '\0')
+  {
+  c1 = *str1++;
+  c2 = (pcre_uchar)*ustr2++;
+  if (c1 != c2)
+    return ((c1 > c2) << 1) - 1;
+  }
+/* Both length and characters must be equal. */
+return 0;
+}
+
+/* The following two functions compares two, fixed length
+strings. Basically an strncmp for non 8 bit characters.
+
+Arguments:
+  str1        first string
+  str2        second string
+  num         size of the string
+
+Returns:      0 if both string are equal (like strcmp), 1 otherwise
+*/
+
+int
+PRIV(strncmp_uc_uc)(const pcre_uchar *str1, const pcre_uchar *str2, unsigned int num)
+{
+pcre_uchar c1;
+pcre_uchar c2;
+
+while (num-- > 0)
+  {
+  c1 = *str1++;
+  c2 = *str2++;
+  if (c1 != c2)
+    return ((c1 > c2) << 1) - 1;
+  }
+/* Both length and characters must be equal. */
+return 0;
+}
+
+int
+PRIV(strncmp_uc_c8)(const pcre_uchar *str1, const char *str2, unsigned int num)
+{
+const pcre_uint8 *ustr2 = (pcre_uint8 *)str2;
+pcre_uchar c1;
+pcre_uchar c2;
+
+while (num-- > 0)
+  {
+  c1 = *str1++;
+  c2 = (pcre_uchar)*ustr2++;
+  if (c1 != c2)
+    return ((c1 > c2) << 1) - 1;
+  }
+/* Both length and characters must be equal. */
+return 0;
+}
+
+/* The following function returns with the length of
+a zero terminated string. Basically an strlen for non 8 bit characters.
+
+Arguments:
+  str         string
+
+Returns:      length of the string
+*/
+
+unsigned int
+PRIV(strlen_uc)(const pcre_uchar *str)
+{
+unsigned int len = 0;
+while (*str++ != 0)
+  len++;
+return len;
+}
+
+#endif /* COMPILE_PCRE8 */
+
+/* End of pcre_string_utils.c */


Modified: code/branches/pcre16/pcre_study.c
===================================================================
--- code/branches/pcre16/pcre_study.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_study.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -189,7 +189,7 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     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 @@
     {
     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 @@
   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 @@


 #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 @@
 #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);
 }


Modified: code/branches/pcre16/pcre_tables.c
===================================================================
--- code/branches/pcre16/pcre_tables.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_tables.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -54,7 +54,7 @@
 /* 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 @@

#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 @@

/* 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 @@
 };


#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 @@
#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 @@
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 @@
{ 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 */


Modified: code/branches/pcre16/pcre_try_flipped.c
===================================================================
--- code/branches/pcre16/pcre_try_flipped.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_try_flipped.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -99,7 +99,7 @@
 */


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)

Modified: code/branches/pcre16/pcre_ucd.c
===================================================================
--- code/branches/pcre16/pcre_ucd.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_ucd.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -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 @@
} 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 @@
   {    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 @@
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,

Modified: code/branches/pcre16/pcre_ucp_searchfuncs.c
===================================================================
--- code/branches/pcre16/pcre_ucp_searchfuncs.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_ucp_searchfuncs.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -92,7 +92,7 @@
 */


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 @@
*/

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);

Modified: code/branches/pcre16/pcre_valid_utf8.c
===================================================================
--- code/branches/pcre16/pcre_valid_utf8.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_valid_utf8.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -103,7 +103,7 @@
 */


 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 @@
     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 */


Modified: code/branches/pcre16/pcre_xclass.c
===================================================================
--- code/branches/pcre16/pcre_xclass.c    2011-11-22 21:46:22 UTC (rev 763)
+++ code/branches/pcre16/pcre_xclass.c    2011-11-23 17:23:20 UTC (rev 764)
@@ -64,7 +64,7 @@
 */


 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 @@
       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 @@
       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;