BDB's default key sort algorithm sorts in the wrong order (and there's no
convenient way to select the correct algorithm). This is an incompatible
change to the database format but will improve back-ldbm's add/delete
characteristics.
DBCache *db;
Datum key, data;
int len, rc, flags;
+#ifndef WORDS_BIGENDIAN
+ ID id;
+#endif
ldbm_datum_init( key );
ldbm_datum_init( data );
return( -1 );
}
+#ifdef WORDS_BIGENDIAN
key.dptr = (char *) &e->e_id;
+#else
+ id = htonl(e->e_id);
+ key.dptr = (char *) &id;
+#endif
key.dsize = sizeof(ID);
ldap_pvt_thread_mutex_lock( &entry2str_mutex );
DBCache *db;
Datum key;
int rc;
+#ifndef WORDS_BIGENDIAN
+ ID id;
+#endif
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
}
+#ifdef WORDS_BIGENDIAN
key.dptr = (char *) &e->e_id;
+#else
+ id = htonl(e->e_id);
+ key.dptr = (char *) &id;
+#endif
key.dsize = sizeof(ID);
rc = ldbm_cache_delete( db, key );
DBCache *db;
Datum key, data;
Entry *e;
+#ifndef WORDS_BIGENDIAN
+ ID id2;
+#endif
ldbm_datum_init( key );
ldbm_datum_init( data );
return( NULL );
}
+#ifdef WORDS_BIGENDIAN
key.dptr = (char *) &id;
+#else
+ id2 = htonl(id);
+ key.dptr = (char *) &id2;
+#endif
key.dsize = sizeof(ID);
data = ldbm_cache_fetch( db, key );