]> granicus.if.org Git - apache/commitdiff
use more speaking names
authorAndré Malo <nd@apache.org>
Sun, 17 Oct 2004 15:44:21 +0000 (15:44 +0000)
committerAndré Malo <nd@apache.org>
Sun, 17 Oct 2004 15:44:21 +0000 (15:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105501 13f79535-47bb-0310-9956-ffa450edef68

include/util_filter.h
modules/experimental/mod_filter.c

index 134c803a8c030345970fa4d71c645853b62f6ed6..7d422369e282ba9b214dcb1f214af2d1f0b74795 100644 (file)
@@ -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 */
index fe36d2b8138682d2109704f1bd08f882857e30a8..bf8a1c1975f7fb76190789e8944c802df39ad306 100644 (file)
@@ -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;