unsigned char entryID[sizeof(ID)]; /* variable placement */
} diskNode;
+/* Sort function for the sorted duplicate data items of a dn2id key.
+ * Sorts based on normalized RDN, in length order.
+ */
+int
+hdb_dup_compare(
+ DB *db,
+ const DBT *usrkey,
+ const DBT *curkey
+)
+{
+ diskNode *un, *cn;
+ int rc, ul, cl;
+
+ un = (diskNode *)usrkey->data;
+ cn = (diskNode *)curkey->data;
+
+ /* data is not aligned, cannot compare directly */
+ ul = un->nrdnlen[0] << 8 | un->nrdnlen[1];
+ cl = cn->nrdnlen[0] << 8 | cn->nrdnlen[1];
+
+ rc = ul - cl;
+ if( rc ) return rc;
+ return strcmp( un->nrdn, cn->nrdn );
+}
+
/* This function constructs a full DN for a given entry.
*/
int hdb_fix_dn(
#ifdef BDB_HIER
#define bdb_dn2id_parent BDB_SYMBOL(dn2id_parent)
+#define bdb_dup_compare BDB_SYMBOL(dup_compare)
#define bdb_fix_dn BDB_SYMBOL(fix_dn)
int bdb_dn2id_parent(
EntryInfo *ei,
ID *idp );
+int bdb_dup_compare(
+ DB *db,
+ const DBT *usrkey,
+ const DBT *curkey );
+
int bdb_fix_dn( Entry *e, int checkit );
#endif