From 551b03d1fbecc9337f0044ffb40c45c333e9e28d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Malo?= Date: Sun, 17 Oct 2004 15:44:21 +0000 Subject: [PATCH] use more speaking names git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105501 13f79535-47bb-0310-9956-ffa450edef68 --- include/util_filter.h | 6 ++--- modules/experimental/mod_filter.c | 37 ++++++++++++++++--------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/include/util_filter.h b/include/util_filter.h index 134c803a8c..7d422369e2 100644 --- a/include/util_filter.h +++ b/include/util_filter.h @@ -284,9 +284,9 @@ struct ap_filter_provider_t { /** The dispatch match itself - union member depends on match_type */ union { - const char *c; - regex_t *r; - int i; + const char *string; + regex_t *regex; + int number; } match; /** The filter that implements this provider */ diff --git a/modules/experimental/mod_filter.c b/modules/experimental/mod_filter.c index fe36d2b813..bf8a1c1975 100644 --- a/modules/experimental/mod_filter.c +++ b/modules/experimental/mod_filter.c @@ -132,46 +132,46 @@ static ap_out_filter_func filter_lookup(request_rec *r, ap_filter_rec_t *filter) * Not sure if there's anything better to do with them */ if (!str) { - if (provider->match_type == DEFINED && provider->match.c) { + if (provider->match_type == DEFINED && provider->match.string) { match = 0; } } - else if (!provider->match.c) { + else if (!provider->match.string) { match = 0; } else { /* Now we have no nulls, so we can do string and regexp matching */ switch (provider->match_type) { case STRING_MATCH: - if (strcasecmp(str, provider->match.c)) { + if (strcasecmp(str, provider->match.string)) { match = 0; } break; case STRING_CONTAINS: str1 = apr_pstrdup(r->pool, str); ap_str_tolower(str1); - if (!strstr(str1, provider->match.c)) { + if (!strstr(str1, provider->match.string)) { match = 0; } break; case REGEX_MATCH: - if (ap_regexec(provider->match.r, str, 0, NULL, 0) + if (ap_regexec(provider->match.regex, str, 0, NULL, 0) == REG_NOMATCH) { match = 0; } break; case INT_EQ: - if (atoi(str) != provider->match.i) { + if (atoi(str) != provider->match.number) { match = 0; } break; case INT_LT: - if (atoi(str) < provider->match.i) { + if (atoi(str) < provider->match.number) { match = 0; } break; case INT_GT: - if (atoi(str) > provider->match.i) { + if (atoi(str) > provider->match.number) { match = 0; } break; @@ -487,15 +487,15 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, switch (match[0]) { case '<': provider->match_type = INT_LT; - provider->match.i = atoi(match+1); + provider->match.number = atoi(match+1); break; case '>': provider->match_type = INT_GT; - provider->match.i = atoi(match+1); + provider->match.number = atoi(match+1); break; case '=': provider->match_type = INT_EQ; - provider->match.i = atoi(match+1); + provider->match.number = atoi(match+1); break; case '/': provider->match_type = REGEX_MATCH; @@ -510,24 +510,25 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, case 'x': flags |= REG_EXTENDED; break; } } - provider->match.r = ap_pregcomp(cmd->pool, - apr_pstrndup(cmd->pool, match+1, - rxend-match-1), - flags); + provider->match.regex = ap_pregcomp(cmd->pool, + apr_pstrndup(cmd->pool, + match+1, + rxend-match-1), + flags); break; case '*': provider->match_type = DEFINED; - provider->match.i = -1; + provider->match.number = -1; break; case '$': provider->match_type = STRING_CONTAINS; str = apr_pstrdup(cmd->pool, match+1); ap_str_tolower(str); - provider->match.c = str; + provider->match.string = str; break; default: provider->match_type = STRING_MATCH; - provider->match.c = apr_pstrdup(cmd->pool, match); + provider->match.string = apr_pstrdup(cmd->pool, match); break; } provider->frec = provider_frec; -- 2.50.1