1 extern void exit (int);
2 extern void abort (void);
4 typedef unsigned int u_int32_t;
5 typedef unsigned char u_int8_t;
15 struct __db_lsn; typedef struct __db_lsn DB_LSN;
20 struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST;
24 struct { struct __db_txnlist *le_next; struct __db_txnlist **le_prev; } links;
55 int log_compare (const DB_LSN *a, const DB_LSN *b)
62 __db_txnlist_lsnadd(int val, DB_TXNLIST *elp, DB_LSN *lsnp, u_int32_t flags)
66 for (i = 0; i < (!(flags & (0x1)) ? 1 : elp->u.l.ntxns); i++)
71 for (__j = 0; __j < elp->u.l.ntxns - 1; __j++)
72 if (log_compare(&elp->u.l.lsn_array[__j], &elp->u.l.lsn_array[__j + 1]) < 0)
74 __tmp = elp->u.l.lsn_array[__j];
75 elp->u.l.lsn_array[__j] = elp->u.l.lsn_array[__j + 1];
76 elp->u.l.lsn_array[__j + 1] = __tmp;
80 *lsnp = elp->u.l.lsn_array[0];
87 #define VLEN (STACK_SIZE/10)
93 DB_LSN lsn, lsn_a[VLEN];
95 el.u.l.ntxns = VLEN-1;
96 el.u.l.lsn_array = lsn_a;
98 if (__db_txnlist_lsnadd (0, &el, &lsn, 0) != 1)
101 if (__db_txnlist_lsnadd (0, &el, &lsn, 1) != VLEN-1)