Hi,

Dunno if it's relevant, or applicable, or even needed (except for me).

I've ported the netbsd's db hash lib to win32 and linux.
The reason is that the only non-gnu hashing package is sdbm, with the
1008 bytes key/value pair size limit, so it's useless for most purposes
where
the larger sizes is required (some caching module, etc...).
I've named the package as bdbm (it's negotiable :-).
It doesn't use apr for i/o (tried to change the original as minimum as
possible using mostly preproc defines).

Tested on win32 and RH9.0 with HEAD apr/apr-util.

Tar file should be unpacked to apr-util/dbm/

MT.

Index: dbm.m4
===================================================================
RCS file: /home/cvspublic/apr-util/build/dbm.m4,v
retrieving revision 1.6
diff -u -r1.6 dbm.m4
--- dbm.m4  18 Nov 2003 22:52:07 -0000  1.6
+++ dbm.m4  2 Dec 2003 13:18:23 -0000
@@ -504,11 +504,13 @@
 dnl
 AC_DEFUN(APU_CHECK_DBM, [
   apu_use_sdbm=0
+  apu_use_bdbm=0
   apu_use_ndbm=0
   apu_use_gdbm=0
   apu_use_db=0
   dnl it's in our codebase
   apu_have_sdbm=1
+  apu_have_bdbm=1
   apu_have_gdbm=0
   apu_have_ndbm=0
   apu_have_db=0
@@ -518,11 +520,11 @@
 
   AC_ARG_WITH(dbm, [
     --with-dbm=DBM          choose the DBM type to use.
-      DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db41,db42}
+      DBM={sdbm,gdbm,ndbm,bdbm,db,db1,db185,db2,db3,db4,db41,db42}
   ], [
     if test "$withval" = "yes"; then
       AC_MSG_ERROR([--with-dbm needs to specify a DBM type to use.
-        One of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, db42])
+        One of: sdbm, gdbm, ndbm, bdbm, db, db1, db185, db2, db3, db4, db41, 
db42])
     fi
     requested="$withval"
   ], [
@@ -668,6 +670,10 @@
       apu_use_ndbm=1
       apu_default_dbm=ndbm
       ;;
+    bdbm)
+      apu_use_bdbm=1
+      apu_default_dbm=bdbm
+      ;;
     db)
       apu_use_db=1
       apu_default_dbm=db
@@ -704,10 +710,11 @@
       dnl ### use more sophisticated DBMs for the default?
       apu_default_dbm="sdbm (default)"
       apu_use_sdbm=1
+      apu_use_bdbm=1
       ;;
     *)
       AC_MSG_ERROR([--with-dbm=$look_for is an unknown DBM type.
-        Use one of: sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4, db41, 
db42])
+        Use one of: sdbm, gdbm, ndbm, bdbm, db, db1, db185, db2, db3, db4, 
db41, db42])
       ;;
   esac
 
@@ -720,11 +727,13 @@
   AC_SUBST(apu_use_sdbm)
   AC_SUBST(apu_use_gdbm)
   AC_SUBST(apu_use_ndbm)
+  AC_SUBST(apu_use_bdbm)
   AC_SUBST(apu_use_db)
 
   AC_SUBST(apu_have_sdbm)
   AC_SUBST(apu_have_gdbm)
   AC_SUBST(apu_have_ndbm)
+  AC_SUBST(apu_have_bdbm)
   AC_SUBST(apu_have_db)
   AC_SUBST(apu_db_header)
   AC_SUBST(apu_db_version)

Index: Makefile.in
===================================================================
RCS file: /home/cvspublic/apr-util/dbm/Makefile.in,v
retrieving revision 1.13
diff -u -r1.13 Makefile.in
--- Makefile.in 21 Aug 2002 21:42:41 -0000  1.13
+++ Makefile.in 2 Dec 2003 13:19:39 -0000
@@ -2,9 +2,9 @@
 
 INCLUDES = @APRUTIL_PRIV_INCLUDES@ @APR_INCLUDES@ @APRUTIL_INCLUDES@
 
-TARGETS = apr_dbm.lo apr_dbm_berkeleydb.lo apr_dbm_gdbm.lo apr_dbm_sdbm.lo 
apr_dbm_ndbm.lo
+TARGETS = apr_dbm.lo apr_dbm_berkeleydb.lo apr_dbm_gdbm.lo apr_dbm_sdbm.lo 
apr_dbm_ndbm.lo apr_dbm_bdbm.lo
 
 # bring in rules.mk for standard functionality
 @INCLUDE_RULES@
 
-SUBDIRS = sdbm .
+SUBDIRS = bdbm sdbm .

Index: apu.h.in
===================================================================
RCS file: /home/cvspublic/apr-util/include/apu.h.in,v
retrieving revision 1.19
diff -u -r1.19 apu.h.in
--- apu.h.in    18 Aug 2003 10:43:19 -0000  1.19
+++ apu.h.in    2 Dec 2003 13:21:19 -0000
@@ -110,6 +110,7 @@
 #define APU_HAVE_SDBM   @apu_have_sdbm@
 #define APU_HAVE_GDBM   @apu_have_gdbm@
 #define APU_HAVE_NDBM   @apu_have_ndbm@
+#define APU_HAVE_BDBM   @apu_have_bdbm@
 #define APU_HAVE_DB     @apu_have_db@
 
 #if APU_HAVE_DB

Index: apr_dbm_private.h
===================================================================
RCS file: /home/cvspublic/apr-util/include/private/apr_dbm_private.h,v
retrieving revision 1.8
diff -u -r1.8 apr_dbm_private.h
--- apr_dbm_private.h   1 Jan 2003 00:02:21 -0000   1.8
+++ apr_dbm_private.h   2 Dec 2003 13:22:31 -0000
@@ -150,6 +150,7 @@
 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_sdbm;
 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_gdbm;
 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_ndbm;
+APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_bdbm;
 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db1;
 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db2;
 APU_DECLARE_DATA extern const apr_dbm_type_t apr_dbm_type_db3;
Index: apu_select_dbm.h.in
===================================================================
RCS file: /home/cvspublic/apr-util/include/private/apu_select_dbm.h.in,v
retrieving revision 1.7
diff -u -r1.7 apu_select_dbm.h.in
--- apu_select_dbm.h.in 1 Jan 2003 00:02:21 -0000   1.7
+++ apu_select_dbm.h.in 2 Dec 2003 13:22:31 -0000
@@ -62,5 +62,6 @@
 #define APU_USE_NDBM    @apu_use_ndbm@
 #define APU_USE_GDBM    @apu_use_gdbm@
 #define APU_USE_DB      @apu_use_db@
+#define APU_USE_BDBM    @apu_use_bdbm@
 
 #endif /* !APU_SELECT_DBM_H */
Index: apu_select_dbm.hw
===================================================================
RCS file: /home/cvspublic/apr-util/include/private/apu_select_dbm.hw,v
retrieving revision 1.5
diff -u -r1.5 apu_select_dbm.hw
--- apu_select_dbm.hw   1 Jan 2003 00:02:21 -0000   1.5
+++ apu_select_dbm.hw   2 Dec 2003 13:22:31 -0000
@@ -59,6 +59,7 @@
 ** The following macros control what features APRUTIL will use
 */
 #define APU_USE_SDBM   1
+#define APU_USE_BDBM   1
 #define APU_USE_GDBM   0
 #define APU_USE_NDBM   0
 #define APU_USE_DB 0

Attachment: bdbm.tar.gz
Description: GNU Zip compressed data

Reply via email to