tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guenter Knauf <efl...@gmx.net>
Subject [PATCH] use ap_ prefixed PCRE functions - take 2
Date Wed, 25 Feb 2004 23:36:44 GMT
Hi all,
the previous patch seems to break non-Apache connectors, so here's another patch which shouldnt
break anything unless you set the HAVE_AP_PCRE.

I would like to get this patch into CVS in order to use PCRE on NetWare where only the ap_
prefixed pcre functions are exported. I have tested that the patch below compiles fine with
NetWare, Linux and Win32.
As a positive side effect on Win32 the binary is about 24 kb smaller.
Also this time tested that the isapi redirector still compiles fine.

thanks, Guenter.

http://www.gknw.com/test/pcre_patch2

###############################################################################
--- ./jk/native2/common/jk_uriEnv.c.orig	2004-02-24 12:30:10.000000000 +0100
+++ ./jk/native2/common/jk_uriEnv.c	2004-02-26 00:12:57.000000000 +0100
@@ -29,8 +29,16 @@
 #include "jk_registry.h"
 
 #ifdef HAS_PCRE
-#include "pcre.h"
-#include "pcreposix.h"
+  #ifdef HAS_AP_PCRE
+    #include "httpd.h"
+    #undef regcomp
+    #define regcomp ap_pregcomp
+    #define REGEX_POOL apr_pool_t
+  #else
+    #include "pcre.h"
+    #include "pcreposix.h"
+    #define REGEX_POOL regex_t
+  #endif
 #endif
 
 /* return non-zero if pattern has any glob chars in it */
@@ -73,7 +81,7 @@
                     "uriEnv.parseName() parsing %s regexp\n",
                     name);
         {
-            regex_t *preg = (regex_t *)uriEnv->pool->calloc( env, uriEnv->pool,
sizeof(regex_t));
+            REGEX_POOL *preg = (REGEX_POOL *)uriEnv->pool->calloc( env, uriEnv->pool,
sizeof(regex_t));
             if (regcomp(preg, uriEnv->uri, REG_EXTENDED)) {
                 env->l->jkLog(env, env->l, JK_LOG_DEBUG,
                               "uriEnv.parseName() error compiling regexp %s\n",
@@ -138,7 +146,7 @@
                     "uriEnv.parseName() parsing regexp %s\n",
                     uri);
         {
-            regex_t *preg = (regex_t *)uriEnv->pool->calloc( env, uriEnv->pool,
sizeof(regex_t));
+            REGEX_POOL *preg = (REGEX_POOL *)uriEnv->pool->calloc( env, uriEnv->pool,
sizeof(regex_t));
             if (regcomp(preg, uriEnv->uri, REG_EXTENDED)) {
                 env->l->jkLog(env, env->l, JK_LOG_DEBUG,
                               "uriEnv.parseName() error compiling regexp %s\n",
###############################################################################
--- ./jk/native2/common/jk_uriMap.c.orig	2004-02-24 12:30:10.000000000 +0100
+++ ./jk/native2/common/jk_uriMap.c	2004-02-26 00:13:09.000000000 +0100
@@ -35,8 +35,14 @@
 #include "jk_registry.h"
 
 #ifdef HAS_PCRE
-#include "pcre.h"
-#include "pcreposix.h"
+  #ifdef HAS_AP_PCRE
+    #include "httpd.h"
+    #undef regexec
+    #define regexec ap_regexec
+  #else
+    #include "pcre.h"
+    #include "pcreposix.h"
+  #endif
 #endif
 
 static INLINE const char *jk2_findExtension(jk_env_t *env, const char *uri);



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message