1 /* init.c - initialize mdb backend */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2000-2011 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
20 #include <ac/string.h>
24 int mdb_next_id( BackendDB *be, MDB_txn *tid, ID *out )
26 struct mdb_info *mdb = (struct mdb_info *) be->be_private;
32 /* Get a read cursor */
33 rc = mdb_cursor_open( tid, mdb->mi_id2entry, &cursor );
36 rc = mdb_cursor_get(cursor, &key, NULL, MDB_LAST);
37 mdb_cursor_close(cursor);
46 memcpy( &id, key.mv_data, sizeof( id ));
51 Debug( LDAP_DEBUG_ANY,
52 "=> mdb_next_id: get failed: %s (%d)\n",
53 mdb_strerror(rc), rc, 0 );