apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Miguel Camargo" <migapa...@hotmail.com>
Subject Re: APR_HAVE_ vs APR_HAS_ (was Re: APR doubts)
Date Wed, 12 Jun 2002 17:39:56 GMT
First of all,thank you Cliff and Ryan for your answers!

The feature i want to add is a trick inside the APR just to could manage an 
parallel file system or not depending on some parameters.

So i first need to add a header file into ../apr/include/arch/unix/fileio.h 
and after that check into the struct apr_file_t if my feature exist to add a 
new field to that structure, an so on into ../apr/misc/unix/start.c (to 
initialize my data fields), into ../apr/fileio/open.c an 
../apr/fileio/readwrite.c. So i supose that i have to add in 
../apr/include/arch/unix/fileio.h:

at the begining:

#if APR_HAVE_NEWFEATURE_H
#include <newfeature.h>
#endif

APR code...

#if APR_HAS_NEWFEATURE ? /* or also APR_HAVE_NEWFEATURE_H */
	my code
#endif

APR code...


if APR_HAVE_FEATURE is 1 then APR HAS my new feature (they are related) and 
it´s also evaluated as 1, so i don´t know if is correct to define the 2 
macros or if i only have to define one, and in that case what would be the 
correct? I supose that i need the 2 ones, and the second one would be 
evaluated deppending on the first one. Excuse me for my explanation.


>From: Cliff Woolley <jwoolley@virginia.edu>
>To: dev@apr.apache.org
>Subject: APR_HAVE_ vs APR_HAS_ (was Re: APR doubts)
>Date: Wed, 12 Jun 2002 12:59:11 -0400 (EDT)
>
>On Wed, 12 Jun 2002, Cliff Woolley wrote:
>
> > There are a *few* cases where we use HAVE where we should be using HAS,
> > and those ought to be cleaned up.  But we're mostly consistent.  :)
>
>Responding to this message caused me to take a second and actually go look
>at how consistently we're using this naming convention.  We're *very*
>close to consistent, I think.  There are just a few cases where I believe
>it should be APR_HAS and instead it's APR_HAVE.  Here's a stub of a patch
>that illustrates the ones I think should be changed.  Obviously a real
>patch would be much much bigger, in that configure.in and a million
>"users" of these macros would need to change.  But anyway, what do you
>think of this?
>
>--Cliff
>
>
>Index: apr.h.in
>===================================================================
>RCS file: /home/cvs/apr/include/apr.h.in,v
>retrieving revision 1.108
>diff -u -d -r1.108 apr.h.in
>--- apr.h.in    7 May 2002 04:12:44 -0000       1.108
>+++ apr.h.in    12 Jun 2002 16:59:54 -0000
>@@ -65,14 +65,6 @@
>  #define APR_HAVE_TIME_H          @timeh@
>  #define APR_HAVE_UNISTD_H        @unistdh@
>
>-#define APR_HAVE_SHMEM_MMAP_TMP     @havemmaptmp@
>-#define APR_HAVE_SHMEM_MMAP_SHM     @havemmapshm@
>-#define APR_HAVE_SHMEM_MMAP_ZERO    @havemmapzero@
>-#define APR_HAVE_SHMEM_SHMGET_ANON  @haveshmgetanon@
>-#define APR_HAVE_SHMEM_SHMGET       @haveshmget@
>-#define APR_HAVE_SHMEM_MMAP_ANON    @havemmapanon@
>-#define APR_HAVE_SHMEM_BEOS         @havebeosarea@
>-
>  #define APR_USE_SHMEM_MMAP_TMP     @usemmaptmp@
>  #define APR_USE_SHMEM_MMAP_SHM     @usemmapshm@
>  #define APR_USE_SHMEM_MMAP_ZERO    @usemmapzero@
>@@ -81,6 +73,14 @@
>  #define APR_USE_SHMEM_MMAP_ANON    @usemmapanon@
>  #define APR_USE_SHMEM_BEOS         @usebeosarea@
>
>+#define APR_HAS_SHMEM_MMAP_TMP     @hasmmaptmp@
>+#define APR_HAS_SHMEM_MMAP_SHM     @hasmmapshm@
>+#define APR_HAS_SHMEM_MMAP_ZERO    @hasmmapzero@
>+#define APR_HAS_SHMEM_SHMGET_ANON  @hasshmgetanon@
>+#define APR_HAS_SHMEM_SHMGET       @hasshmget@
>+#define APR_HAS_SHMEM_MMAP_ANON    @hasmmapanon@
>+#define APR_HAS_SHMEM_BEOS         @hasbeosarea@
>+
>  #define APR_USE_FLOCK_SERIALIZE           @flockser@
>  #define APR_USE_SYSVSEM_SERIALIZE         @sysvser@
>  #define APR_USE_POSIXSEM_SERIALIZE        @posixser@
>@@ -97,12 +97,10 @@
>
>  #define APR_PROCESS_LOCK_IS_GLOBAL        @proclockglobal@
>
>-#define APR_HAVE_CORKABLE_TCP   @have_corkable_tcp@
>  #define APR_HAVE_GETRLIMIT      @have_getrlimit@
>  #define APR_HAVE_IN_ADDR        @have_in_addr@
>  #define APR_HAVE_INET_ADDR      @have_inet_addr@
>  #define APR_HAVE_INET_NETWORK   @have_inet_network@
>-#define APR_HAVE_IPV6           @have_ipv6@
>  #define APR_HAVE_MEMMOVE        @have_memmove@
>  #define APR_HAVE_SETRLIMIT      @have_setrlimit@
>  #define APR_HAVE_SIGACTION      @have_sigaction@
>@@ -131,6 +129,8 @@
>  #endif
>
>  /*  APR Feature Macros */
>+#define APR_HAS_CORKABLE_TCP      @has_corkable_tcp@
>+#define APR_HAS_IPV6              @has_ipv6@
>  #define APR_HAS_SHARED_MEMORY     @sharedmem@
>  #define APR_HAS_THREADS           @threads@
>  #define APR_HAS_SENDFILE          @sendfile@






_________________________________________________________________
Únase con MSN Hotmail al servicio de correo electrónico más grande del 
mundo. http://www.hotmail.com


Mime
View raw message