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 *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: {
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;
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;
;
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;
}