]> git.sur5r.net Git - openldap/blobdiff - include/ldbm.h
Extended ber_mem functions, add context argument.
[openldap] / include / ldbm.h
index 68b143208b1d1dd8c541bd6e382368f406124771..9c92ac6e9679a23b6b37ff8270af2430f8cb8083 100644 (file)
@@ -1,12 +1,13 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
+ * Copyright 1998-2003 The OpenLDAP Foundation, Redwood City, California, USA
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted only
- * as authorized by the OpenLDAP Public License.  A copy of this
- * license is available at http://www.OpenLDAP.org/license.html or
- * in file LICENSE in the top-level directory of the distribution.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.  A copy of this license is available at
+ * http://www.OpenLDAP.org/license.html or in file LICENSE in the
+ * top-level directory of the distribution.
  */
 /* ldbm.h - ldap dbm compatibility routine header file */
 
 
 #include <ldap_cdefs.h>
 
+/* dummy DB_ENV for non Berkeley DB */
+#if !defined( LDBM_USE_DBBTREE ) && !defined( LDBM_USE_DBHASH )
+#  define DB_ENV void
+#endif
+
 #if defined( LDBM_USE_DBBTREE ) || defined( LDBM_USE_DBHASH )
 
 /*****************************************************************
@@ -48,6 +54,8 @@
 #      ifndef DEFAULT_DB_PAGE_SIZE
 #              define DEFAULT_DB_PAGE_SIZE 4096
 #      endif
+#else
+#  define DB_ENV void
 #endif
 
 
@@ -119,8 +127,6 @@ typedef datum               Datum;
 typedef Datum LDBMCursor;
 typedef GDBM_FILE      LDBM;
 
-extern gdbm_error      gdbm_errno;
-
 LDAP_END_DECL
 
 /* for ldbm_open */
@@ -171,7 +177,7 @@ typedef int LDBMCursor;
 typedef MDBM           *LDBM;
 
 LDAP_END_DECL
-    
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -236,11 +242,14 @@ LDAP_END_DECL
 
 LDAP_BEGIN_DECL
 
-LDAP_LDBM_F (int) ldbm_initialize( void );
+LDAP_LDBM_F (int) ldbm_initialize( const char * );
 LDAP_LDBM_F (int) ldbm_shutdown( void );
 
+LDAP_LDBM_F (DB_ENV*) ldbm_initialize_env(const char *, int dbcachesize, int *envdirok);
+LDAP_LDBM_F (void) ldbm_shutdown_env(DB_ENV *);
+
 LDAP_LDBM_F (int) ldbm_errno( LDBM ldbm );
-LDAP_LDBM_F (LDBM) ldbm_open( char *name, int rw, int mode, int dbcachesize );
+LDAP_LDBM_F (LDBM) ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize );
 LDAP_LDBM_F (void) ldbm_close( LDBM ldbm );
 LDAP_LDBM_F (void) ldbm_sync( LDBM ldbm );
 LDAP_LDBM_F (void) ldbm_datum_free( LDBM ldbm, Datum data );