34 #if defined(LIBC_SCCS) && !defined(lint)
35 static char sccsid[] =
"@(#)rec_seq.c 8.3 (Berkeley) 7/14/94";
38 #include <sys/types.h>
45 #include "../include/db.h"
61 __rec_seq(dbp, key, data, flags)
74 if (t->bt_pinned != NULL) {
75 mpool_put(t->bt_mp, t->bt_pinned, 0);
81 if ((nrec = *(recno_t *)key->data) == 0)
85 if (F_ISSET(&t->bt_cursor, CURS_INIT)) {
86 nrec = t->bt_cursor.rcursor + 1;
94 if (F_ISSET(&t->bt_cursor, CURS_INIT)) {
95 if ((nrec = t->bt_cursor.rcursor - 1) == 0)
101 if (!F_ISSET(t, R_EOF | R_INMEM) &&
102 t->bt_irec(t, MAX_REC_NUMBER) == RET_ERROR)
107 einval: errno = EINVAL;
111 if (t->bt_nrecs == 0 || nrec > t->bt_nrecs) {
112 if (!F_ISSET(t, R_EOF | R_INMEM) &&
113 (status = t->bt_irec(t, nrec)) != RET_SUCCESS)
115 if (t->bt_nrecs == 0 || nrec > t->bt_nrecs)
116 return (RET_SPECIAL);
119 if ((e = __rec_search(t, nrec - 1, SEARCH)) == NULL)
122 F_SET(&t->bt_cursor, CURS_INIT);
123 t->bt_cursor.rcursor = nrec;
125 status = __rec_ret(t, e, nrec, key, data);
126 if (F_ISSET(t, B_DB_LOCK))
127 mpool_put(t->bt_mp, e->page, 0);
129 t->bt_pinned = e->page;