httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/os/win32 os.h
Date Fri, 09 Jun 2000 21:19:53 GMT
rbb         00/06/09 14:19:53

  Modified:    src      configure.in
               src/include httpd.h
               src/lib/apr configure.in
               src/lib/apr/include apr.h.in apr_general.h
               src/lib/apr/lib apr_cpystrn.c
               src/main util.c
               src/os/win32 os.h
  Log:
  Remove a bunch of string functions from Apache.  These are basically
  standard string functions like strstr, strcasecmp, etc that Apache used
  to define for platforms that don't have them.  These functions and the
  feature tests have moved down to APR where they really belong.  In doing
  this, I am also able to remove a bunch of tests from the Apache configure
  process.
  
  Revision  Changes    Path
  1.51      +0 -4      apache-2.0/src/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/configure.in,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- configure.in	2000/06/09 18:57:12	1.50
  +++ configure.in	2000/06/09 21:19:45	1.51
  @@ -100,10 +100,6 @@
   dnl See Comment #Spoon
   
   AC_CHECK_FUNCS( \
  -strdup \
  -strcasecmp \
  -strncasecmp \
  -strstr \
   initgroups \
   waitpid \
   memmove \
  
  
  
  1.56      +0 -8      apache-2.0/src/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/httpd.h,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- httpd.h	2000/06/05 22:57:20	1.55
  +++ httpd.h	2000/06/09 21:19:47	1.56
  @@ -969,14 +969,6 @@
   API_EXPORT(char *) ap_uudecode(ap_pool_t *p, const char *bufcoded);
   API_EXPORT(char *) ap_uuencode(ap_pool_t *p, char *string); 
   
  -#ifndef HAVE_STRCASECMP
  -int strcasecmp(const char *a, const char *b);
  -#endif
  -
  -#ifndef HAVE_STRNCASECMP
  -int strncasecmp(const char *a, const char *b, size_t n);
  -#endif
  -
   #include "pcreposix.h"
   
   API_EXPORT(regex_t *) ap_pregcomp(ap_pool_t *p, const char *pattern,
  
  
  
  1.102     +15 -0     apache-2.0/src/lib/apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/configure.in,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- configure.in	2000/06/07 12:36:51	1.101
  +++ configure.in	2000/06/09 21:19:47	1.102
  @@ -321,6 +321,21 @@
   AC_SUBST(ssize_t_fmt) 
   AC_SUBST(off_t_fmt) 
   
  +dnl #----------------------------- Checking for string functions
  +AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0")
  +AC_CHECK_FUNCS(strncasecmp, have_strncasecmp="1", have_strncasecmp="0")
  +AC_CHECK_FUNCS(stricmp, have_stricmp="1", have_stricmp="0")
  +AC_CHECK_FUNCS(strcasecmp, have_strcasecmp="1", have_strcasecmp="0")
  +AC_CHECK_FUNCS(strdup, have_strdup="1", have_strdup="0")
  +AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0")
  +
  +AC_SUBST(have_strnicmp)
  +AC_SUBST(have_strncasecmp)
  +AC_SUBST(have_stricmp)
  +AC_SUBST(have_strcasecmp)
  +AC_SUBST(have_strdup)
  +AC_SUBST(have_strstr)
  +
   dnl #----------------------------- Checking for DSO support
   echo $ac_n "${nl}Checking for DSO...${nl}"
   AC_ARG_ENABLE(dso,
  
  
  
  1.30      +6 -0      apache-2.0/src/lib/apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr.h.in,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- apr.h.in	2000/06/06 21:45:10	1.29
  +++ apr.h.in	2000/06/09 21:19:48	1.30
  @@ -52,6 +52,12 @@
   #define APR_HAVE_INET_NETWORK   @inet_network@
   #define APR_HAVE_UNION_SEMUN    @have_union_semun@
   #define APR_HAVE_STRUCT_RLIMIT  @struct_rlimit@
  +#define APR_HAVE_STRICMP        @have_strcasecmp@
  +#define APR_HAVE_STRNICMP       @have_strncasecmp@
  +#define APR_HAVE_STRCASECMP     @have_strcasecmp@
  +#define APR_HAVE_STRNCASECMP    @have_strncasecmp@
  +#define APR_HAVE_STRDUP         @have_strdup@
  +#define APR_HAVE_STRSTR         @have_strstr@
   
   #if APR_HAVE_SYS_TYPES_H
   #include <sys/types.h>
  
  
  
  1.33      +16 -0     apache-2.0/src/lib/apr/include/apr_general.h
  
  Index: apr_general.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_general.h,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- apr_general.h	2000/04/28 18:31:20	1.32
  +++ apr_general.h	2000/06/09 21:19:48	1.33
  @@ -215,6 +215,22 @@
   #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
   #endif
   
  +/* A couple of prototypes for functions in case some platform doesn't 
  + * have it
  + */
  +#if (!APR_HAVE_STRCASECMP) && (APR_HAVE_STRICMP) 
  +#define strcasecmp(s1, s2) stricmp(s1, s2)
  +#elif (!APR_HAVE_STRCASECMP)
  +int strcasecmp(const char *a, const char *b);
  +#endif
  +
  +#if (!APR_HAVE_STRNCASECMP) && (APR_HAVE_STRNICMP)
  +#define strncasecmp(s1, s2) strnicmp(s1, s2)
  +#elif (!APR_HAVE_STRNCASECMP)
  +int strncasecmp(const char *a, const char *b, size_t n);
  +#endif
  +
  +
   #if APR_HAS_RANDOM
   /*
   
  
  
  
  1.21      +86 -0     apache-2.0/src/lib/apr/lib/apr_cpystrn.c
  
  Index: apr_cpystrn.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/lib/apr_cpystrn.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- apr_cpystrn.c	2000/05/26 18:53:54	1.20
  +++ apr_cpystrn.c	2000/06/09 21:19:50	1.21
  @@ -242,3 +242,89 @@
       *dest = 0;
       return (dest);
   }
  +
  +#ifndef HAVE_STRDUP
  +char *strdup(const char *str)
  +{
  +    char *sdup;
  +    if (!(sdup = (char *) malloc(strlen(str) + 1))) {
  +        ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Ouch!
  + Out of memory in our strdup()!");
  +        return NULL;
  +    }
  +    sdup = strcpy(sdup, str);
  +
  +    return sdup;
  +}
  +#endif
  +
  +/* The following two routines were donated for SVR4 by Andreas Vogel */
  +#ifndef HAVE_STRCASECMP
  +int strcasecmp(const char *a, const char *b)
  +{
  +    const char *p = a;
  +    const char *q = b;
  +    for (p = a, q = b; *p && *q; p++, q++) {
  +        int diff = ap_tolower(*p) - ap_tolower(*q);
  +        if (diff)
  +            return diff;
  +    }
  +    if (*p)
  +        return 1;               /* p was longer than q */
  +    if (*q)
  +        return -1;              /* p was shorter than q */
  +    return 0;                   /* Exact match */
  +}
  +
  +#endif
  +
  +#ifndef HAVE_STRNCASECMP
  +int strncasecmp(const char *a, const char *b, size_t n)
  +{
  +    const char *p = a;
  +    const char *q = b;
  +
  +    for (p = a, q = b; /*NOTHING */ ; p++, q++) {
  +        int diff;
  +        if (p == a + n)
  +            return 0;           /*   Match up to n characters */
  +        if (!(*p && *q))
  +            return *p - *q;
  +        diff = ap_tolower(*p) - ap_tolower(*q);
  +        if (diff)
  +            return diff;
  +    }
  +    /*NOTREACHED */
  +}
  +#endif
  +
  +/* The following routine was donated for UTS21 by dwd@bell-labs.com */
  +#ifndef HAVE_STRSTR
  +char *strstr(char *s1, char *s2)
  +{
  +    char *p1, *p2;
  +    if (*s2 == '\0') {
  +        /* an empty s2 */
  +        return(s1);
  +    }
  +    while((s1 = strchr(s1, *s2)) != NULL) {
  +        /* found first character of s2, see if the rest matches */
  +        p1 = s1;
  +        p2 = s2;
  +        while (*++p1 == *++p2) {
  +            if (*p1 == '\0') {
  +                /* both strings ended together */
  +                return(s1);
  +            }
  +        }
  +        if (*p2 == '\0') {
  +            /* second string ended, a match */
  +            break;
  +        }
  +        /* didn't find a match here, try starting at next character in s1 */
  +        s1++;
  +    }
  +    return(s1);
  +}
  +#endif
  +
  
  
  
  1.48      +0 -85     apache-2.0/src/main/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/util.c,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- util.c	2000/06/09 18:57:13	1.47
  +++ util.c	2000/06/09 21:19:51	1.48
  @@ -1689,91 +1689,6 @@
       return (x ? 1 : 0);		/* If the first character is ':', it's broken, too */
   }
   
  -#ifndef HAVE_STRDUP
  -char *strdup(const char *str)
  -{
  -    char *sdup;
  -
  -    if (!(sdup = (char *) malloc(strlen(str) + 1))) {
  -	ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Ouch!  Out of memory
in our strdup()!");
  -	return NULL;
  -    }
  -    sdup = strcpy(sdup, str);
  -
  -    return sdup;
  -}
  -#endif
  -
  -/* The following two routines were donated for SVR4 by Andreas Vogel */
  -#ifndef HAVE_STRCASECMP
  -int strcasecmp(const char *a, const char *b)
  -{
  -    const char *p = a;
  -    const char *q = b;
  -    for (p = a, q = b; *p && *q; p++, q++) {
  -	int diff = ap_tolower(*p) - ap_tolower(*q);
  -	if (diff)
  -	    return diff;
  -    }
  -    if (*p)
  -	return 1;		/* p was longer than q */
  -    if (*q)
  -	return -1;		/* p was shorter than q */
  -    return 0;			/* Exact match */
  -}
  -
  -#endif
  -
  -#ifndef HAVE_STRNCASECMP
  -int strncasecmp(const char *a, const char *b, size_t n)
  -{
  -    const char *p = a;
  -    const char *q = b;
  -
  -    for (p = a, q = b; /*NOTHING */ ; p++, q++) {
  -	int diff;
  -	if (p == a + n)
  -	    return 0;		/*   Match up to n characters */
  -	if (!(*p && *q))
  -	    return *p - *q;
  -	diff = ap_tolower(*p) - ap_tolower(*q);
  -	if (diff)
  -	    return diff;
  -    }
  -    /*NOTREACHED */
  -}
  -#endif
  -
  -/* The following routine was donated for UTS21 by dwd@bell-labs.com */
  -#ifndef HAVE_STRSTR
  -char *strstr(char *s1, char *s2)
  -{
  -    char *p1, *p2;
  -    if (*s2 == '\0') {
  -	/* an empty s2 */
  -        return(s1);
  -    }
  -    while((s1 = strchr(s1, *s2)) != NULL) {
  -	/* found first character of s2, see if the rest matches */
  -        p1 = s1;
  -        p2 = s2;
  -        while (*++p1 == *++p2) {
  -            if (*p1 == '\0') {
  -                /* both strings ended together */
  -                return(s1);
  -            }
  -        }
  -        if (*p2 == '\0') {
  -            /* second string ended, a match */
  -            break;
  -        }
  -	/* didn't find a match here, try starting at next character in s1 */
  -        s1++;
  -    }
  -    return(s1);
  -}
  -#endif
  -
   #ifndef HAVE_INITGROUPS
   int initgroups(const char *name, gid_t basegid)
   {
  
  
  
  1.34      +0 -7      apache-2.0/src/os/win32/os.h
  
  Index: os.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/os/win32/os.h,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- os.h	2000/06/09 18:57:16	1.33
  +++ os.h	2000/06/09 21:19:52	1.34
  @@ -116,13 +116,6 @@
   typedef char * caddr_t;
   
   #define HAVE_MEMMOVE
  -#define HAVE_STRCASECMP
  -#define HAVE_STRNCASECMP
  -#define HAVE_STRDUP
  -#define HAVE_STRSTR
  -
  -#define strcasecmp(s1, s2) stricmp(s1, s2)
  -#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
   
   #define HAVE_SYS_STAT_H
   #define lstat(x, y) stat(x, y)
  
  
  

Mime
View raw message