From: Joe Orton Date: Fri, 11 Feb 2005 12:00:41 +0000 (+0000) Subject: Move the POSIX reg* implementations into the ap_* namespace; X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46a5131bddcc6b9ee383529dce072430d2d44ae7;p=thirdparty%2Fapache%2Fhttpd.git Move the POSIX reg* implementations into the ap_* namespace; 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 , Joe Orton git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@153384 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/ssl_expr_eval.c b/ssl_expr_eval.c index d57200abdff..2b3adc8402f 100644 --- a/ssl_expr_eval.c +++ b/ssl_expr_eval.c @@ -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: { diff --git a/ssl_expr_parse.c b/ssl_expr_parse.c index 967d4da4dd4..6abb56fdfdd 100644 --- a/ssl_expr_parse.c +++ b/ssl_expr_parse.c @@ -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; diff --git a/ssl_expr_parse.y b/ssl_expr_parse.y index dab095f0dc9..3daf31ac4ec 100644 --- a/ssl_expr_parse.y +++ b/ssl_expr_parse.y @@ -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; }