From 99fb0a7916309063e0944ec37c0290c6e9153b5c Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 20 Oct 1998 21:07:09 +0000 Subject: [PATCH] prefix defines with LDAP_ and use ac defs --- include/ldap.h | 9 +++--- include/ldbm.h | 73 +++++++++++++++++++++++++++++++++---------- include/portable.h.in | 4 +++ 3 files changed, 66 insertions(+), 20 deletions(-) diff --git a/include/ldap.h b/include/ldap.h index 65b2d87b79..acb1d50ae7 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -20,12 +20,13 @@ LDAP_BEGIN_DECL #define LDAP_PORT 389 #define LDAP_VERSION1 1 #define LDAP_VERSION2 2 +#define LDAP_VERSION3 3 #define LDAP_VERSION LDAP_VERSION2 -#define COMPAT20 -#define COMPAT30 -#if defined(COMPAT20) || defined(COMPAT30) -#define COMPAT +#define LDAP_COMPAT20 +#define LDAP_COMPAT30 +#if defined(LDAP_COMPAT20) || defined(LDAP_COMPAT30) +#define LDAP_COMPAT #endif #define LDAP_MAX_ATTR_LEN 100 diff --git a/include/ldbm.h b/include/ldbm.h index 95bd55ffa7..e9788fcbbf 100644 --- a/include/ldbm.h +++ b/include/ldbm.h @@ -46,7 +46,16 @@ extern gdbm_error gdbm_errno; #include #include #include -#include + +#ifdef LDBM_USE_DB2_COMPAT185 +# include +#else +# include +# ifdef LDBM_USE_DB2 +# define R_NOOVERWRITE DB_NOOVERWRITE +# define DEFAULT_DB_PAGE_SIZE 1024 +# endif +#endif typedef DBT Datum; #define dsize size @@ -57,11 +66,18 @@ typedef DB *LDBM; #define DB_TYPE DB_HASH /* for ldbm_open */ -#define LDBM_READER O_RDONLY -#define LDBM_WRITER O_RDWR -#define LDBM_WRCREAT (O_RDWR|O_CREAT) -#define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) -#define LDBM_FAST 0 +#ifdef LDBM_USE_DB2 +# define LDBM_READER DB_RDONLY +# define LDBM_WRITER 0x00000 /* hopefully */ +# define LDBM_WRCREAT (DB_NOMMAP|DB_CREATE|DB_THREAD) +# define LDBM_NEWDB (DB_TRUNCATE|DB_CREATE|DB_THREAD) +#else +# define LDBM_READER O_RDONLY +# define LDBM_WRITER O_RDWR +# define LDBM_WRCREAT (O_RDWR|O_CREAT) +# define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) +# define LDBM_FAST 0 +#endif #define LDBM_SUFFIX ".dbh" @@ -85,7 +101,17 @@ extern int errno; #include #include #include -#include + +#ifdef LDBM_USE_DB2_COMPAT185 +# include +#else +# include +# ifdef LDBM_USE_DB2 +# define R_NOOVERWRITE DB_NOOVERWRITE +# define DEFAULT_DB_PAGE_SIZE 1024 +# endif +#endif + typedef DBT Datum; #define dsize size @@ -96,11 +122,19 @@ typedef DB *LDBM; #define DB_TYPE DB_BTREE /* for ldbm_open */ -#define LDBM_READER O_RDONLY -#define LDBM_WRITER O_RDWR -#define LDBM_WRCREAT (O_RDWR|O_CREAT) -#define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) -#define LDBM_FAST 0 +#ifdef LDBM_USE_DB2 +# define LDBM_READER DB_RDONLY +# define LDBM_WRITER 0x00000 /* hopefully */ +# define LDBM_WRCREAT (DB_NOMMAP|DB_CREATE|DB_THREAD) +# define LDBM_NEWDB (DB_TRUNCATE|DB_CREATE|DB_THREAD) +#else +# define LDBM_READER O_RDONLY +# define LDBM_WRITER O_RDWR +# define LDBM_WRCREAT (O_RDWR|O_CREAT) +# define LDBM_NEWDB (O_RDWR|O_TRUNC|O_CREAT) +#endif + +# define LDBM_FAST 0 #define LDBM_SUFFIX ".dbb" #define LDBM_ORDERED 1 @@ -123,7 +157,7 @@ extern int errno; *****************************************************************/ #include -#ifndef O_RDONLY +#ifdef HAVE_FCNTL_H #include #endif @@ -150,6 +184,7 @@ typedef DBM *LDBM; #endif /* db btree */ #endif /* gdbm */ +int ldbm_errno( LDBM ldbm ); LDBM ldbm_open( char *name, int rw, int mode, int dbcachesize ); void ldbm_close( LDBM ldbm ); void ldbm_sync( LDBM ldbm ); @@ -158,8 +193,14 @@ Datum ldbm_datum_dup( LDBM ldbm, Datum data ); Datum ldbm_fetch( LDBM ldbm, Datum key ); int ldbm_store( LDBM ldbm, Datum key, Datum data, int flags ); int ldbm_delete( LDBM ldbm, Datum key ); -Datum ldbm_firstkey( LDBM ldbm ); -Datum ldbm_nextkey( LDBM ldbm, Datum key ); -int ldbm_errno( LDBM ldbm ); + +#if LDBM_USE_DB2 + void *ldbm_malloc( size_t size ); + Datum ldbm_firstkey( LDBM ldbm, DBC **dbch ); + Datum ldbm_nextkey( LDBM ldbm, Datum key, DBC *dbcp ); +#else + Datum ldbm_firstkey( LDBM ldbm ); + Datum ldbm_nextkey( LDBM ldbm, Datum key ); +#endif #endif /* _ldbm_h_ */ diff --git a/include/portable.h.in b/include/portable.h.in index 6b0abe55f8..dd1f58b804 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -104,6 +104,10 @@ is provided ``as is'' without express or implied warranty. /* Define to `int' if doesn't define. */ #undef uid_t +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + /* define this if sys_errlist is not defined in stdio.h or errno.h */ #undef DECL_SYS_ERRLIST -- 2.39.5