* Copyright (c) 1991 The Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)rec_seq.c 5.1 (Berkeley) %G%";
#include "../btree/btree.h"
* __REC_SEQ -- Recno sequential scan interface.
* dbp: pointer to access method
* key: key for positioning and return value
* data: data return value
* flags: R_CURSOR, R_FIRST, R_LAST, R_NEXT, R_PREV.
* RET_ERROR, RET_SUCCESS or RET_SPECIAL if there's no next key.
__rec_seq(dbp
, key
, data
, flags
)
if ((nrec
= *(recno_t
*)key
->data
) == 0) {
if (ISSET(t
, BTF_SEQINIT
)) {
nrec
= t
->bt_rcursor
+ 1;
if (ISSET(t
, BTF_SEQINIT
)) {
nrec
= t
->bt_rcursor
- 1;
if (t
->bt_irec(t
, MAX_REC_NUMBER
) == RET_ERROR
)
if (nrec
> t
->bt_nrecs
&& (status
= t
->bt_irec(t
, nrec
)) != RET_SUCCESS
)
if ((e
= __rec_search(t
, nrec
- 1, &exact
)) == NULL
)
mpool_put(t
->bt_mp
, e
->page
, 0);
if ((status
= __rec_ret(t
, e
, data
)) == RET_SUCCESS
)
mpool_put(t
->bt_mp
, e
->page
, 0);