apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/network_io/win32 sockopt.c
Date Mon, 24 Feb 2003 23:13:30 GMT
wrowe       2003/02/24 15:13:30

  Modified:    strings  apr_fnmatch.c
               network_io/os2 sockopt.c
               network_io/unix sockopt.c
               network_io/win32 sockopt.c
  Log:
    Namespace protection, thanks to Craig Rodrigues <rodrigc@attbi.com>
    for the original patch.  Use the new symbols in all internals, taking
    us one step closer to being ready to just chop out the old defines.
  
  Revision  Changes    Path
  1.7       +32 -32    apr/strings/apr_fnmatch.c
  
  Index: apr_fnmatch.c
  ===================================================================
  RCS file: /home/cvs/apr/strings/apr_fnmatch.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apr_fnmatch.c	8 Jul 2002 17:41:25 -0000	1.6
  +++ apr_fnmatch.c	24 Feb 2003 23:13:28 -0000	1.7
  @@ -64,18 +64,18 @@
       for (stringstart = string;;) {
   	switch (c = *pattern++) {
   	case EOS:
  -	    return (*string == EOS ? APR_SUCCESS : FNM_NOMATCH);
  +	    return (*string == EOS ? APR_SUCCESS : APR_FNM_NOMATCH);
   	case '?':
   	    if (*string == EOS) {
  -		return (FNM_NOMATCH);
  +		return (APR_FNM_NOMATCH);
   	    }
  -	    if (*string == '/' && (flags & FNM_PATHNAME)) {
  -		return (FNM_NOMATCH);
  +	    if (*string == '/' && (flags & APR_FNM_PATHNAME)) {
  +		return (APR_FNM_NOMATCH);
   	    }
  -	    if (*string == '.' && (flags & FNM_PERIOD) &&
  +	    if (*string == '.' && (flags & APR_FNM_PERIOD) &&
   		(string == stringstart ||
  -		 ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) {
  -		return (FNM_NOMATCH);
  +		 ((flags & APR_FNM_PATHNAME) && *(string - 1) == '/'))) {
  +		return (APR_FNM_NOMATCH);
   	    }
   	    ++string;
   	    break;
  @@ -86,58 +86,58 @@
   		c = *++pattern;
   	    }
   
  -	    if (*string == '.' && (flags & FNM_PERIOD) &&
  +	    if (*string == '.' && (flags & APR_FNM_PERIOD) &&
   		(string == stringstart ||
  -		 ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) {
  -		return (FNM_NOMATCH);
  +		 ((flags & APR_FNM_PATHNAME) && *(string - 1) == '/'))) {
  +		return (APR_FNM_NOMATCH);
   	    }
   
   	    /* Optimize for pattern with * at end or before /. */
   	    if (c == EOS) {
  -		if (flags & FNM_PATHNAME) {
  -		    return (strchr(string, '/') == NULL ? APR_SUCCESS : FNM_NOMATCH);
  +		if (flags & APR_FNM_PATHNAME) {
  +		    return (strchr(string, '/') == NULL ? APR_SUCCESS : APR_FNM_NOMATCH);
   		}
   		else {
   		    return (APR_SUCCESS);
   		}
   	    }
  -	    else if (c == '/' && flags & FNM_PATHNAME) {
  +	    else if (c == '/' && flags & APR_FNM_PATHNAME) {
   	        if ((string = strchr(string, '/')) == NULL) {
  -		    return (FNM_NOMATCH);
  +		    return (APR_FNM_NOMATCH);
   		}
   		break;
   	    }
   
   	    /* General case, use recursion. */
   	    while ((test = *string) != EOS) {
  -	        if (!apr_fnmatch(pattern, string, flags & ~FNM_PERIOD)) {
  +	        if (!apr_fnmatch(pattern, string, flags & ~APR_FNM_PERIOD)) {
   		    return (APR_SUCCESS);
   		}
  -		if (test == '/' && flags & FNM_PATHNAME) {
  +		if (test == '/' && flags & APR_FNM_PATHNAME) {
   		    break;
   		}
   		++string;
   	    }
  -	    return (FNM_NOMATCH);
  +	    return (APR_FNM_NOMATCH);
   	case '[':
   	    if (*string == EOS) {
  -		return (FNM_NOMATCH);
  +		return (APR_FNM_NOMATCH);
   	    }
  -	    if (*string == '/' && flags & FNM_PATHNAME) {
  -		return (FNM_NOMATCH);
  +	    if (*string == '/' && flags & APR_FNM_PATHNAME) {
  +		return (APR_FNM_NOMATCH);
   	    }
  -	    if (*string == '.' && (flags & FNM_PERIOD) &&
  +	    if (*string == '.' && (flags & APR_FNM_PERIOD) &&
   		(string == stringstart ||
  -		 ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) {
  -	        return (FNM_NOMATCH);
  +		 ((flags & APR_FNM_PATHNAME) && *(string - 1) == '/'))) {
  +	        return (APR_FNM_NOMATCH);
   	    }
   	    if ((pattern = rangematch(pattern, *string, flags)) == NULL) {
  -		return (FNM_NOMATCH);
  +		return (APR_FNM_NOMATCH);
   	    }
   	    ++string;
   	    break;
   	case '\\':
  -	    if (!(flags & FNM_NOESCAPE)) {
  +	    if (!(flags & APR_FNM_NOESCAPE)) {
   		if ((c = *pattern++) == EOS) {
   		    c = '\\';
   		    --pattern;
  @@ -145,13 +145,13 @@
   	    }
   	    /* FALLTHROUGH */
   	default:
  -	    if (flags & FNM_CASE_BLIND) {
  +	    if (flags & APR_FNM_CASE_BLIND) {
   	        if (apr_tolower(c) != apr_tolower(*string)) {
  -		    return (FNM_NOMATCH);
  +		    return (APR_FNM_NOMATCH);
   		}
   	    }
   	    else if (c != *string) {
  -	        return (FNM_NOMATCH);
  +	        return (APR_FNM_NOMATCH);
   	    }
   	    string++;
   	    break;
  @@ -177,7 +177,7 @@
       }
   
       for (ok = 0; (c = *pattern++) != ']';) {
  -        if (c == '\\' && !(flags & FNM_NOESCAPE)) {
  +        if (c == '\\' && !(flags & APR_FNM_NOESCAPE)) {
   	    c = *pattern++;
   	}
   	if (c == EOS) {
  @@ -185,21 +185,21 @@
   	}
   	if (*pattern == '-' && (c2 = *(pattern + 1)) != EOS && c2 != ']') {
   	    pattern += 2;
  -	    if (c2 == '\\' && !(flags & FNM_NOESCAPE)) {
  +	    if (c2 == '\\' && !(flags & APR_FNM_NOESCAPE)) {
   		c2 = *pattern++;
   	    }
   	    if (c2 == EOS) {
   		return (NULL);
   	    }
   	    if ((c <= test && test <= c2)
  -		|| ((flags & FNM_CASE_BLIND)
  +		|| ((flags & APR_FNM_CASE_BLIND)
   		    && ((apr_tolower(c) <= apr_tolower(test))
   			&& (apr_tolower(test) <= apr_tolower(c2))))) {
   		ok = 1;
   	    }
   	}
   	else if ((c == test)
  -		 || ((flags & FNM_CASE_BLIND)
  +		 || ((flags & APR_FNM_CASE_BLIND)
   		     && (apr_tolower(c) == apr_tolower(test)))) {
   	    ok = 1;
   	}
  
  
  
  1.33      +1 -1      apr/network_io/os2/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/os2/sockopt.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- sockopt.c	6 Jan 2003 23:44:34 -0000	1.32
  +++ sockopt.c	24 Feb 2003 23:13:29 -0000	1.33
  @@ -115,7 +115,7 @@
       }
       if (opt & APR_SO_LINGER) {
           li.l_onoff = on;
  -        li.l_linger = MAX_SECS_TO_LINGER;
  +        li.l_linger = APR_MAX_SECS_TO_LINGER;
           if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct
linger)) == -1) {
               return APR_OS2_STATUS(sock_errno());
           }
  
  
  
  1.67      +1 -1      apr/network_io/unix/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockopt.c,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- sockopt.c	7 Feb 2003 20:34:27 -0000	1.66
  +++ sockopt.c	24 Feb 2003 23:13:29 -0000	1.67
  @@ -216,7 +216,7 @@
           if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on) {
               struct linger li;
               li.l_onoff = on;
  -            li.l_linger = MAX_SECS_TO_LINGER;
  +            li.l_linger = APR_MAX_SECS_TO_LINGER;
               if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, (char *) &li,
sizeof(struct linger)) == -1) {
                   return errno;
               }
  
  
  
  1.52      +1 -1      apr/network_io/win32/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/win32/sockopt.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- sockopt.c	6 Jan 2003 23:44:36 -0000	1.51
  +++ sockopt.c	24 Feb 2003 23:13:30 -0000	1.52
  @@ -183,7 +183,7 @@
           if (apr_is_option_set(sock->netmask, APR_SO_LINGER) != on) {
               struct linger li;
               li.l_onoff = on;
  -            li.l_linger = MAX_SECS_TO_LINGER;
  +            li.l_linger = APR_MAX_SECS_TO_LINGER;
               if (setsockopt(sock->socketdes, SOL_SOCKET, SO_LINGER, 
                              (char *) &li, sizeof(struct linger)) == -1) {
                   return apr_get_netos_error();
  
  
  

Mime
View raw message