You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@locus.apache.org on 2000/07/07 21:14:55 UTC

cvs commit: apache-2.0/src/lib/apr/mmap/unix Makefile.in common.c mmap.c mmap_h.h

rbb         00/07/07 12:14:54

  Modified:    src/lib/apr/include apr_mmap.h
               src/lib/apr/mmap/unix Makefile.in common.c mmap.c
  Removed:     src/lib/apr/mmap/unix mmap_h.h
  Log:
  Stop using an incomplete type for MMAP files.  The only sane way to really
  store an MMAP file as far as I can see is as a void * and a length.  BeOS
  requires another variable, but it doesn't do any harm to expose that too.
  This cleans up some code for Apache, and it makes sense IMHO.
  
  Revision  Changes    Path
  1.11      +14 -1     apache-2.0/src/lib/apr/include/apr_mmap.h
  
  Index: apr_mmap.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_mmap.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- apr_mmap.h	2000/04/16 04:46:55	1.10
  +++ apr_mmap.h	2000/07/07 19:14:52	1.11
  @@ -64,8 +64,21 @@
   extern "C" {
   #endif /* __cplusplus */
   
  -
   typedef struct ap_mmap_t            ap_mmap_t;
  +/* As far as I can tell the only really sane way to store an MMAP is as a
  + * void * and a length.  BeOS requires this area_id, but that's just a little
  + * something extra.  I am exposing this type, because it doesn't make much
  + * sense to keep it private, and opening it up makes some stuff easier in
  + * Apache.
  + */
  +struct ap_mmap_t {
  +    ap_pool_t *cntxt;
  +#ifdef BEOS
  +    area_id area;
  +#endif
  +    void *mm;
  +    size_t size;
  +};
   
   /*   Function definitions */
   
  
  
  
  1.14      +13 -15    apache-2.0/src/lib/apr/mmap/unix/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/mmap/unix/Makefile.in,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Makefile.in	2000/06/11 19:57:30	1.13
  +++ Makefile.in	2000/07/07 19:14:53	1.14
  @@ -49,19 +49,17 @@
   	    && rm Makefile.new
   
   # DO NOT REMOVE
  -common.o: common.c mmap_h.h $(INCDIR)/apr_private.h \
  - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \
  - $(INCDIR)/apr_errno.h $(INCDIR)/apr_mmap.h \
  - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_file_io.h \
  - $(INCDIR)/apr_time.h $(INCDIR)/apr_portable.h \
  - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lock.h \
  +common.o: common.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \
  + $(INCDIR)/apr_mmap.h $(INCDIR)/apr_general.h \
  + $(INCDIR)/apr_errno.h $(INCDIR)/apr_network_io.h \
  + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \
  + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \
  + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h
  +mmap.o: mmap.c $(INCDIR)/apr.h $(INCDIR)/apr_private.h \
  + $(INCDIR)/apr_general.h $(INCDIR)/apr_errno.h \
  + $(INCDIR)/apr_mmap.h $(INCDIR)/apr_network_io.h \
  + $(INCDIR)/apr_file_io.h $(INCDIR)/apr_time.h \
  + $(INCDIR)/apr_portable.h $(INCDIR)/apr_thread_proc.h \
  + $(INCDIR)/apr_lock.h $(INCDIR)/apr_dso.h \
    ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \
  - $(INCDIR)/apr_tables.h
  -mmap.o: mmap.c mmap_h.h $(INCDIR)/apr_private.h \
  - $(INCDIR)/apr_general.h $(INCDIR)/apr.h \
  - $(INCDIR)/apr_errno.h $(INCDIR)/apr_mmap.h \
  - $(INCDIR)/apr_network_io.h $(INCDIR)/apr_file_io.h \
  - $(INCDIR)/apr_time.h $(INCDIR)/apr_portable.h \
  - $(INCDIR)/apr_thread_proc.h $(INCDIR)/apr_lock.h \
  - ../../file_io/unix/fileio.h $(INCDIR)/apr_lib.h \
  - $(INCDIR)/apr_tables.h
  + $(INCDIR)/apr_pools.h $(INCDIR)/apr_tables.h
  
  
  
  1.16      +4 -1      apache-2.0/src/lib/apr/mmap/unix/common.c
  
  Index: common.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/mmap/unix/common.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- common.c	2000/06/22 16:05:36	1.15
  +++ common.c	2000/07/07 19:14:54	1.16
  @@ -61,7 +61,10 @@
    *
    */
   
  -#include "mmap_h.h"
  +#include "apr.h"
  +#include "apr_private.h"
  +#include "apr_mmap.h"
  +#include "apr_errno.h"
   
   #if APR_HAS_MMAP || defined(BEOS)
   
  
  
  
  1.25      +23 -1     apache-2.0/src/lib/apr/mmap/unix/mmap.c
  
  Index: mmap.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/mmap/unix/mmap.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- mmap.c	2000/06/22 16:05:37	1.24
  +++ mmap.c	2000/07/07 19:14:54	1.25
  @@ -52,8 +52,30 @@
    * <http://www.apache.org/>.
    */
   
  -#include "mmap_h.h"
  +#include "apr.h"
  +#include "apr_private.h"
  +#include "apr_general.h"
  +#include "apr_mmap.h"
  +#include "apr_errno.h"
  +#include "../../file_io/unix/fileio.h"
   #include "apr_portable.h"
  +
  +/* System headers required for the mmap library */
  +#ifdef BEOS
  +#include <kernel/OS.h>
  +#endif
  +#if HAVE_STRING_H
  +#include <string.h>
  +#endif
  +#if APR_HAVE_STDIO_H
  +#include <stdio.h>
  +#endif
  +#if HAVE_SYS_STAT_H
  +#include <sys/stat.h>
  +#endif
  +#if HAVE_SYS_MMAN_H
  +#include <sys/mman.h>
  +#endif
   
   #if APR_HAS_MMAP || defined(BEOS)