# endif
#else
-typedef int LDBMCursor;
+typedef void LDBMCursor;
# define LDBM_READER O_RDONLY
# define LDBM_WRITER O_RDWR
# define LDBM_WRCREAT (O_RDWR|O_CREAT)
LDAP_BEGIN_DECL
typedef datum Datum;
-typedef int LDBMCursor;
+typedef Datum LDBMCursor;
typedef GDBM_FILE LDBM;
extern gdbm_error gdbm_errno;
d = gdbm_firstkey( ldbm );
LDBM_UNLOCK;
+ if ( d.dptr != NULL ) {
+ *dbcp = (Datum *) malloc( sizeof( Datum ) );
+ **dbcp = ldbm_datum_dup( ldbm, d );
+ }
+
return d;
}
Datum d;
LDBM_LOCK;
- d = gdbm_nextkey( ldbm, key );
+ d = gdbm_nextkey( ldbm, *dbcp );
LDBM_UNLOCK;
+ ldbm_datum_free( ldbm, *dbcp );
+
+ if ( d.dptr != NULL ) {
+ *dbcp = ldbm_datum_dup( ldbm, d );
+ } else {
+ free( dbcp );
+ }
+
return d;
}