[Pcre-svn] [846] code/trunk/src: Put back pcre2_set_recursi…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [846] code/trunk/src: Put back pcre2_set_recursion_limit() as a real function, synonym for
Revision: 846
          http://www.exim.org/viewvc/pcre2?view=rev&revision=846
Author:   ph10
Date:     2017-07-21 09:53:02 +0100 (Fri, 21 Jul 2017)
Log Message:
-----------
Put back pcre2_set_recursion_limit() as a real function, synonym for 
pcre2_set_depth_limit() in order to preserve the ABI.


Modified Paths:
--------------
    code/trunk/src/pcre2.h
    code/trunk/src/pcre2.h.generic
    code/trunk/src/pcre2.h.in
    code/trunk/src/pcre2_context.c


Modified: code/trunk/src/pcre2.h
===================================================================
--- code/trunk/src/pcre2.h    2017-07-21 08:41:21 UTC (rev 845)
+++ code/trunk/src/pcre2.h    2017-07-21 08:53:02 UTC (rev 846)
@@ -489,6 +489,8 @@
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_offset_limit(pcre2_match_context *, PCRE2_SIZE); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+  pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_recursion_memory_management(pcre2_match_context *, \
     void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *);


@@ -760,7 +762,7 @@
 #define pcre2_substring_number_from_name      PCRE2_SUFFIX(pcre2_substring_number_from_name_)


/* Keep this old function name for backwards compatibility */
-#define pcre2_set_recursion_limit pcre2_set_depth_limit
+#define pcre2_set_recursion_limit PCRE2_SUFFIX(pcre2_set_recursion_limit_)

/* Keep this obsolete function for backwards compatibility: it is now a noop. */
#define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)

Modified: code/trunk/src/pcre2.h.generic
===================================================================
--- code/trunk/src/pcre2.h.generic    2017-07-21 08:41:21 UTC (rev 845)
+++ code/trunk/src/pcre2.h.generic    2017-07-21 08:53:02 UTC (rev 846)
@@ -489,6 +489,8 @@
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_offset_limit(pcre2_match_context *, PCRE2_SIZE); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+  pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_recursion_memory_management(pcre2_match_context *, \
     void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *);


@@ -760,7 +762,7 @@
 #define pcre2_substring_number_from_name      PCRE2_SUFFIX(pcre2_substring_number_from_name_)


/* Keep this old function name for backwards compatibility */
-#define pcre2_set_recursion_limit pcre2_set_depth_limit
+#define pcre2_set_recursion_limit PCRE2_SUFFIX(pcre2_set_recursion_limit_)

/* Keep this obsolete function for backwards compatibility: it is now a noop. */
#define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)

Modified: code/trunk/src/pcre2.h.in
===================================================================
--- code/trunk/src/pcre2.h.in    2017-07-21 08:41:21 UTC (rev 845)
+++ code/trunk/src/pcre2.h.in    2017-07-21 08:53:02 UTC (rev 846)
@@ -489,6 +489,8 @@
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_offset_limit(pcre2_match_context *, PCRE2_SIZE); \
 PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
+  pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \
+PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
   pcre2_set_recursion_memory_management(pcre2_match_context *, \
     void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *);


@@ -760,7 +762,7 @@
 #define pcre2_substring_number_from_name      PCRE2_SUFFIX(pcre2_substring_number_from_name_)


/* Keep this old function name for backwards compatibility */
-#define pcre2_set_recursion_limit pcre2_set_depth_limit
+#define pcre2_set_recursion_limit PCRE2_SUFFIX(pcre2_set_recursion_limit_)

/* Keep this obsolete function for backwards compatibility: it is now a noop. */
#define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)

Modified: code/trunk/src/pcre2_context.c
===================================================================
--- code/trunk/src/pcre2_context.c    2017-07-21 08:41:21 UTC (rev 845)
+++ code/trunk/src/pcre2_context.c    2017-07-21 08:53:02 UTC (rev 846)
@@ -431,10 +431,16 @@
 return 0;
 }


-/* This function became obsolete at release 10.30. It is kept as a no-op for
+/* This function became obsolete at release 10.30. It is kept as a synonym for
backwards compatibility. */

PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
+pcre2_set_recursion_limit(pcre2_match_context *mcontext, uint32_t limit)
+{
+return pcre2_set_depth_limit(mcontext, limit);
+}
+
+PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_recursion_memory_management(pcre2_match_context *mcontext,
void *(*mymalloc)(size_t, void *), void (*myfree)(void *, void *),
void *mydata)