SCCS-vsn: lib/libc/db/btree/bt_seq.c 5.7
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)bt_seq.c 5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)bt_seq.c 5.7 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
+#include <errno.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include "btree.h"
static int bt_seqadv __P((BTREE *, EPG *, int));
#include "btree.h"
static int bt_seqadv __P((BTREE *, EPG *, int));
for (pg = P_ROOT;;) {
if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
return (RET_ERROR);
for (pg = P_ROOT;;) {
if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
return (RET_ERROR);
- if (h->flags & (P_BLEAF|P_RLEAF))
+ if (h->flags & (P_BLEAF | P_RLEAF))
break;
pg = GETBINTERNAL(h, 0)->pgno;
mpool_put(t->bt_mp, h, 0);
break;
pg = GETBINTERNAL(h, 0)->pgno;
mpool_put(t->bt_mp, h, 0);
for (pg = P_ROOT;;) {
if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
return (RET_ERROR);
for (pg = P_ROOT;;) {
if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
return (RET_ERROR);
- if (h->flags & (P_BLEAF|P_RLEAF))
+ if (h->flags & (P_BLEAF | P_RLEAF))
break;
pg = GETBINTERNAL(h, NEXTINDEX(h) - 1)->pgno;
mpool_put(t->bt_mp, h, 0);
break;
pg = GETBINTERNAL(h, NEXTINDEX(h) - 1)->pgno;
mpool_put(t->bt_mp, h, 0);
* a larger index.
*/
if (ISSET(t, BTF_DELCRSR)) {
* a larger index.
*/
if (ISSET(t, BTF_DELCRSR)) {
- UNSET(t, BTF_DELCRSR); /* Don't try twice. */
+ CLR(t, BTF_DELCRSR); /* Don't try twice. */
if (c->pgno == delc.pgno && c->index > delc.index)
--c->index;
if (__bt_crsrdel(t, &delc))
if (c->pgno == delc.pgno && c->index > delc.index)
--c->index;
if (__bt_crsrdel(t, &delc))
- UNSET(t, BTF_DELCRSR); /* Don't try twice. */
+ CLR(t, BTF_DELCRSR); /* Don't try twice. */
if ((h = mpool_get(t->bt_mp, c->pgno, 0)) == NULL)
return (RET_ERROR);
status = __bt_dleaf(t, h, c->index);
if ((h = mpool_get(t->bt_mp, c->pgno, 0)) == NULL)
return (RET_ERROR);
status = __bt_dleaf(t, h, c->index);