1 /* id.c - keep track of the next id to be given out */
10 #ifdef HAVE_SYS_PARAM_H
11 #include <sys/param.h>
15 #include "back-bdb2.h"
17 /* reading and writing NEXTID is handled in txn.c */
18 #define next_id_read(be) bdb2i_get_nextid( (be) )
19 #define next_id_write(be,id) bdb2i_put_nextid( (be), (id) )
23 bdb2i_next_id_save( BackendDB *be )
25 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
26 ID id = bdb2i_next_id_get( be );
29 rc = next_id_write( be, id );
35 bdb2i_next_id( BackendDB *be )
37 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
40 /* first time in here since startup - try to read the nexid */
41 if ( li->li_nextid == NOID ) {
42 li->li_nextid = next_id_read( be );
44 if ( li->li_nextid == NOID ) {
51 (void) next_id_write( be, li->li_nextid );
57 bdb2i_next_id_get( BackendDB *be )
59 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
62 /* first time in here since startup - try to read the nexid */
63 if ( li->li_nextid == NOID ) {
64 li->li_nextid = next_id_read( be );
66 if ( li->li_nextid == NOID ) {