]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Move the POSIX reg* implementations into the ap_* namespace;
authorJoe Orton <jorton@apache.org>
Fri, 11 Feb 2005 12:00:41 +0000 (12:00 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 11 Feb 2005 12:00:41 +0000 (12:00 +0000)
internalise the ap_reg*<->PCRE wrapper:

* configure.in: Add srclib/pcre to the include path.

* include/ap_regex.h: Renamed from include/pcreposix.h.  Prefix all
constants with AP_; prefix all functions and types with ap_.  Define
AP_DECLARE to nothing if necessary.  Remove regcomp error codes.

* include/httpd.h: Include ap_regex.h not pcreposix.h.
(ap_pregcomp, ap_regexec, ap_regfree): s/regex_t/ap_regex_t/.
(ap_regexec, ap_regerror): Prototypes moved to ap_regex.h.

* server/util.c (regex_cleanup, ap_pregcomp, ap_pregsub, ap_pregfree):
Adjust for ap_ prefixed types.  (ap_regexec, ap_regerror): Removed.

* server/Makefile.in: Build util_pcre.c.

* server/util_pcre.c: Copied from srclib/pcre/pcreposix.c; remove use
of PCRE-internals to do error mapping; rename types to add AP_/ap_
prefixes as above.  Use APR includes.  (ap_regerror): Use apr_snprintf.

* srclib/pcre/Makefile.in: Don't build pcreposix.c into libpcre.la.

* modules/*: Update to use new type and constant names.

PR: 27750 (part one)
Submitted by: Andres Salomon <dilinger voxel.net>, Joe Orton

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@153384 13f79535-47bb-0310-9956-ffa450edef68

ssl_expr_eval.c
ssl_expr_parse.c
ssl_expr_parse.y

index d57200abdff95009669a1c1cc6be1e24254fa13f..2b3adc8402f4f9920bb4938976faa4ff15c55716 100644 (file)
@@ -126,24 +126,24 @@ static BOOL ssl_expr_eval_comp(request_rec *r, ssl_expr *node)
             ssl_expr *e1;
             ssl_expr *e2;
             char *word;
-            regex_t *regex;
+            ap_regex_t *regex;
 
             e1 = (ssl_expr *)node->node_arg1;
             e2 = (ssl_expr *)node->node_arg2;
             word = ssl_expr_eval_word(r, e1);
-            regex = (regex_t *)(e2->node_arg1);
+            regex = (ap_regex_t *)(e2->node_arg1);
             return (ap_regexec(regex, word, 0, NULL, 0) == 0);
         }
         case op_NRE: {
             ssl_expr *e1;
             ssl_expr *e2;
             char *word;
-            regex_t *regex;
+            ap_regex_t *regex;
 
             e1 = (ssl_expr *)node->node_arg1;
             e2 = (ssl_expr *)node->node_arg2;
             word = ssl_expr_eval_word(r, e1);
-            regex = (regex_t *)(e2->node_arg1);
+            regex = (ap_regex_t *)(e2->node_arg1);
             return !(ap_regexec(regex, word, 0, NULL, 0) == 0);
         }
         default: {
index 967d4da4dd459ab3923baa4a6ee7b184aaa58f26..6abb56fdfdd8fbfd552f9af1b5334a43e9d6fc62 100644 (file)
@@ -818,9 +818,9 @@ case 23:
 case 24:
 #line 148 "ssl_expr_parse.y"
 { 
-                regex_t *regex;
+                ap_regex_t *regex;
                 if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, 
-                                         REG_EXTENDED|REG_NOSUB)) == NULL) {
+                                         AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) {
                     ssl_expr_error = "Failed to compile regular expression";
                     YYERROR;
                     regex = NULL;
@@ -831,9 +831,9 @@ case 24:
 case 25:
 #line 158 "ssl_expr_parse.y"
 {
-                regex_t *regex;
+                ap_regex_t *regex;
                 if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, 
-                                         REG_EXTENDED|REG_NOSUB|REG_ICASE)) == NULL) {
+                                         AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) {
                     ssl_expr_error = "Failed to compile regular expression";
                     YYERROR;
                     regex = NULL;
index dab095f0dc985a9bffe44a9bb8586220180d6686..3daf31ac4ecf26f719990e888593cec00003dba3 100644 (file)
@@ -112,18 +112,18 @@ word      : T_DIGIT                      { $$ = ssl_expr_make(op_Digit,  $1, NUL
           ;
 
 regex     : T_REGEX { 
-                regex_t *regex;
+                ap_regex_t *regex;
                 if ((regex = ap_pregcomp(ssl_expr_info.pool, $1, 
-                                         REG_EXTENDED|REG_NOSUB)) == NULL) {
+                                         AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) {
                     ssl_expr_error = "Failed to compile regular expression";
                     YYERROR;
                 }
                 $$ = ssl_expr_make(op_Regex, regex, NULL);
             }
           | T_REGEX_I {
-                regex_t *regex;
+                ap_regex_t *regex;
                 if ((regex = ap_pregcomp(ssl_expr_info.pool, $1, 
-                                         REG_EXTENDED|REG_NOSUB|REG_ICASE)) == NULL) {
+                                         AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) {
                     ssl_expr_error = "Failed to compile regular expression";
                     YYERROR;
                 }