* Copyright (c) 1991 The Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)rec_seq.c 5.3 (Berkeley) %G%";
* __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
)) {
if ((nrec
= t
->bt_rcursor
- 1) == 0) {
if (t
->bt_irec(t
, MAX_REC_NUMBER
) == RET_ERROR
)
if (t
->bt_nrecs
== 0 || nrec
> t
->bt_nrecs
) {
if ((status
= t
->bt_irec(t
, nrec
)) != RET_SUCCESS
)
if (t
->bt_nrecs
== 0 || nrec
> t
->bt_nrecs
)
if ((e
= __rec_search(t
, nrec
- 1, SEARCH
)) == NULL
)
if ((status
= __rec_ret(t
, e
, data
)) == RET_SUCCESS
) {
key
->size
= sizeof(recno_t
);
bcopy(&nrec
, key
->data
, sizeof(recno_t
));
mpool_put(t
->bt_mp
, e
->page
, 0);