You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Greg Stein <gs...@lyra.org> on 2000/06/11 11:13:54 UTC

Re: cvs commit: apache-2.0/src/lib/apr/include apr.h.in

On Sun, Jun 11, 2000 at 09:08:06AM -0000, bjh@locus.apache.org wrote:
> bjh         00/06/11 02:08:06
> 
>   Modified:    src/lib/apr/include apr.h.in
>   Log:
>   Fix definition of APR_HAVE_STRICMP & APR_HAVE_STRNICMP.
>   
>   Revision  Changes    Path
>   1.32      +2 -2      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.31
>   retrieving revision 1.32
>   diff -u -r1.31 -r1.32
>   --- apr.h.in	2000/06/10 16:08:37	1.31
>   +++ apr.h.in	2000/06/11 09:08:05	1.32
>   @@ -62,8 +62,8 @@
>    #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_STRICMP        @have_stricmp@
>   +#define APR_HAVE_STRNICMP       @have_strnicmp@
>    #define APR_HAVE_STRCASECMP     @have_strcasecmp@
>    #define APR_HAVE_STRNCASECMP    @have_strncasecmp@
>    #define APR_HAVE_STRDUP         @have_strdup@

Actually, this points out something weird:

why does APR define STRICMP *and* STRCASECMP? shouldn't we decide on one or
the other and stick with that one?

IIRC, the "exported" form is strcasecmp()

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: cvs commit: apache-2.0/src/lib/apr/include apr.h.in

Posted by Greg Stein <gs...@lyra.org>.
On Sun, Jun 11, 2000 at 11:29:55AM -0500, William A. Rowe, Jr. wrote:
> > From: Greg Stein [mailto:gstein@lyra.org]
> > Sent: Sunday, June 11, 2000 4:14 AM
>...
> > Actually, this points out something weird:
> > 
> > why does APR define STRICMP *and* STRCASECMP? shouldn't we 
> > decide on one or the other and stick with that one?
> 
> We did, it's strcasecmp.
> 
>   Index: apr_general.h
>   ===================================================================
>    #if (!APR_HAVE_STRNCASECMP) && (APR_HAVE_STRNICMP)
>   -#define strncasecmp(s1, s2) strnicmp(s1, s2)
>   +#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
>    #elif (!APR_HAVE_STRNCASECMP)
>    int strncasecmp(const char *a, const char *b, size_t n);
>    #endif
> 
> APR_HAVE_STRICMP and APR_HAVE_STRNICMP allow us to create the macro
> equivilants for strcasecmp and strncasecmp.  

Ah. Cuz we want to have a macro in the header. We can't use HAVE_STRNICMP
because that is private to APR. Therefore, we must export APR_HAVE_STRNICMP

Okee dokee... Thanx for the clarification!

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: cvs commit: apache-2.0/src/lib/apr/include apr.h.in

Posted by rb...@covalent.net.
> Actually, this points out something weird:
> 
> why does APR define STRICMP *and* STRCASECMP? shouldn't we decide on one or
> the other and stick with that one?
> 
> IIRC, the "exported" form is strcasecmp()

Actually, APR does export strcasecmp.  APR checks for atricmp, so that it
can redefine it to strcasecmp in cases where the platform provides stricmp
but not strcasecmp.  Think Windows, this is a valid example of a platform
that is broken it this way.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


RE: cvs commit: apache-2.0/src/lib/apr/include apr.h.in

Posted by "William A. Rowe, Jr." <wr...@lnd.com>.
> From: Greg Stein [mailto:gstein@lyra.org]
> Sent: Sunday, June 11, 2000 4:14 AM
> 
> On Sun, Jun 11, 2000 at 09:08:06AM -0000, bjh@locus.apache.org wrote:
> > bjh         00/06/11 02:08:06
> > 
> >   Modified:    src/lib/apr/include apr.h.in
> >   Log:
> >   Fix definition of APR_HAVE_STRICMP & APR_HAVE_STRNICMP.
> >   
> >   Revision  Changes    Path
> >   1.32      +2 -2      apache-2.0/src/lib/apr/include/apr.h.in
> >   
> >   Index: apr.h.in
> >   
> >   -#define APR_HAVE_STRICMP        @have_strcasecmp@
> >   -#define APR_HAVE_STRNICMP       @have_strncasecmp@
> >   +#define APR_HAVE_STRICMP        @have_stricmp@
> >   +#define APR_HAVE_STRNICMP       @have_strnicmp@
> 
> Actually, this points out something weird:
> 
> why does APR define STRICMP *and* STRCASECMP? shouldn't we 
> decide on one or the other and stick with that one?

We did, it's strcasecmp.

  Index: apr_general.h
  ===================================================================
   #if (!APR_HAVE_STRNCASECMP) && (APR_HAVE_STRNICMP)
  -#define strncasecmp(s1, s2) strnicmp(s1, s2)
  +#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
   #elif (!APR_HAVE_STRNCASECMP)
   int strncasecmp(const char *a, const char *b, size_t n);
   #endif

APR_HAVE_STRICMP and APR_HAVE_STRNICMP allow us to create the macro
equivilants for strcasecmp and strncasecmp.