From: Mark Baker <mark@mnb.org.uk>
Description: Restore obsolete pcre_info() API for compatiblity

--- a/Makefile.am
+++ b/Makefile.am
@@ -233,6 +233,7 @@
   pcre_fullinfo.c \
   pcre_get.c \
   pcre_globals.c \
+  pcre_info.c \
   pcre_internal.h \
   pcre_jit_compile.c \
   pcre_maketables.c \
@@ -647,7 +648,7 @@
 # nice DLL for Windows use". (It is used by the pcre.dll target.)
 DLL_OBJS= pcre_byte_order.o pcre_compile.o pcre_config.o \
 	pcre_dfa_exec.o pcre_exec.o pcre_fullinfo.o pcre_get.o \
-	pcre_globals.o pcre_jit_compile.o pcre_maketables.o \
+	pcre_globals.o pcre_info.o pcre_jit_compile.o pcre_maketables.o \
 	pcre_newline.o pcre_ord2utf8.o pcre_refcount.o \
 	pcre_study.o pcre_tables.o pcre_ucd.o \
 	pcre_valid_utf8.o pcre_version.o pcre_chartables.o \
--- a/Makefile.in
+++ b/Makefile.in
@@ -216,11 +216,11 @@
 libpcre_la_DEPENDENCIES =
 am__libpcre_la_SOURCES_DIST = pcre_byte_order.c pcre_compile.c \
 	pcre_config.c pcre_dfa_exec.c pcre_exec.c pcre_fullinfo.c \
-	pcre_get.c pcre_globals.c pcre_internal.h pcre_jit_compile.c \
-	pcre_maketables.c pcre_newline.c pcre_ord2utf8.c \
-	pcre_refcount.c pcre_string_utils.c pcre_study.c pcre_tables.c \
-	pcre_ucd.c pcre_valid_utf8.c pcre_version.c pcre_xclass.c \
-	ucp.h
+	pcre_get.c pcre_globals.c pcre_info.c pcre_internal.h \
+	pcre_jit_compile.c pcre_maketables.c pcre_newline.c \
+	pcre_ord2utf8.c pcre_refcount.c pcre_string_utils.c \
+	pcre_study.c pcre_tables.c pcre_ucd.c pcre_valid_utf8.c \
+	pcre_version.c pcre_xclass.c ucp.h
 @WITH_PCRE8_TRUE@am_libpcre_la_OBJECTS =  \
 @WITH_PCRE8_TRUE@	libpcre_la-pcre_byte_order.lo \
 @WITH_PCRE8_TRUE@	libpcre_la-pcre_compile.lo \
@@ -230,6 +230,7 @@
 @WITH_PCRE8_TRUE@	libpcre_la-pcre_fullinfo.lo \
 @WITH_PCRE8_TRUE@	libpcre_la-pcre_get.lo \
 @WITH_PCRE8_TRUE@	libpcre_la-pcre_globals.lo \
+@WITH_PCRE8_TRUE@	libpcre_la-pcre_info.lo \
 @WITH_PCRE8_TRUE@	libpcre_la-pcre_jit_compile.lo \
 @WITH_PCRE8_TRUE@	libpcre_la-pcre_maketables.lo \
 @WITH_PCRE8_TRUE@	libpcre_la-pcre_newline.lo \
@@ -1076,6 +1077,7 @@
 @WITH_PCRE8_TRUE@  pcre_fullinfo.c \
 @WITH_PCRE8_TRUE@  pcre_get.c \
 @WITH_PCRE8_TRUE@  pcre_globals.c \
+@WITH_PCRE8_TRUE@  pcre_info.c \
 @WITH_PCRE8_TRUE@  pcre_internal.h \
 @WITH_PCRE8_TRUE@  pcre_jit_compile.c \
 @WITH_PCRE8_TRUE@  pcre_maketables.c \
@@ -1210,7 +1212,7 @@
 # nice DLL for Windows use". (It is used by the pcre.dll target.)
 DLL_OBJS = pcre_byte_order.o pcre_compile.o pcre_config.o \
 	pcre_dfa_exec.o pcre_exec.o pcre_fullinfo.o pcre_get.o \
-	pcre_globals.o pcre_jit_compile.o pcre_maketables.o \
+	pcre_globals.o pcre_info.o pcre_jit_compile.o pcre_maketables.o \
 	pcre_newline.o pcre_ord2utf8.o pcre_refcount.o \
 	pcre_study.o pcre_tables.o pcre_ucd.o \
 	pcre_valid_utf8.o pcre_version.o pcre_chartables.o \
@@ -1607,6 +1609,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_fullinfo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_get.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_globals.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_info.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_jit_compile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_maketables.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpcre_la-pcre_newline.Plo@am__quote@
@@ -1710,6 +1713,13 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_globals.lo `test -f 'pcre_globals.c' || echo '$(srcdir)/'`pcre_globals.c
 
+libpcre_la-pcre_info.lo: pcre_info.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_info.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_info.Tpo -c -o libpcre_la-pcre_info.lo `test -f 'pcre_info.c' || echo '$(srcdir)/'`pcre_info.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_info.Tpo $(DEPDIR)/libpcre_la-pcre_info.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='pcre_info.c' object='libpcre_la-pcre_info.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre_la_CFLAGS) $(CFLAGS) -c -o libpcre_la-pcre_info.lo `test -f 'pcre_info.c' || echo '$(srcdir)/'`pcre_info.c
+
 libpcre_la-pcre_jit_compile.lo: pcre_jit_compile.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre_la_CFLAGS) $(CFLAGS) -MT libpcre_la-pcre_jit_compile.lo -MD -MP -MF $(DEPDIR)/libpcre_la-pcre_jit_compile.Tpo -c -o libpcre_la-pcre_jit_compile.lo `test -f 'pcre_jit_compile.c' || echo '$(srcdir)/'`pcre_jit_compile.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libpcre_la-pcre_jit_compile.Tpo $(DEPDIR)/libpcre_la-pcre_jit_compile.Plo
--- /dev/null
+++ b/pcre_info.c
@@ -0,0 +1,90 @@
+/*************************************************
+*      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 the external function pcre_info(), which gives some
+information about a compiled pattern. However, use of this function is now
+deprecated, as it has been superseded by pcre_fullinfo(). */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "pcre_internal.h"
+
+
+/*************************************************
+* (Obsolete) Return info about compiled pattern  *
+*************************************************/
+
+/* This is the original "info" function. It picks potentially useful data out
+of the private structure, but its interface was too rigid. It remains for
+backwards compatibility. The public options are passed back in an int - though
+the re->options field has been expanded to a long int, all the public options
+at the low end of it, and so even on 16-bit systems this will still be OK.
+Therefore, I haven't changed the API for pcre_info().
+
+Arguments:
+  argument_re   points to compiled code
+  optptr        where to pass back the options
+  first_byte    where to pass back the first character,
+                or -1 if multiline and all branches start ^,
+                or -2 otherwise
+
+Returns:        number of capturing subpatterns
+                or negative values on error
+*/
+
+PCRE_EXP_DEFN int PCRE_CALL_CONVENTION
+pcre_info(const pcre *argument_re, int *optptr, int *first_byte)
+{
+const real_pcre *re = (const real_pcre *)argument_re;
+if (re == NULL) return PCRE_ERROR_NULL;
+if (re->magic_number != MAGIC_NUMBER)
+  return PCRE_ERROR_BADMAGIC;
+
+if (optptr != NULL) *optptr = (int)(re->options & PUBLIC_COMPILE_OPTIONS);
+if (first_byte != NULL)
+  *first_byte = ((re->flags & PCRE_FIRSTSET) != 0)? re->first_char :
+     ((re->flags & PCRE_STARTLINE) != 0)? -1 : -2;
+return re->top_bracket;
+}
+
+/* End of pcre_info.c */
