/* Parameters: t: the tree pgno: page number index: page index  */
void __bt_setcur(BTREE *t, pgno_t pgno, u_int index)
/* Parameters: t: the tree pgno: page number index: page index  */
void __bt_setcur(BTREE *t, pgno_t pgno, u_int index)
{
	if (t->bt_cursor.key.data != NULL) {
		free(t->bt_cursor.key.data);
		t->bt_cursor.key.size = 0;
		t->bt_cursor.key.data = NULL;
	}
	F_CLR(&t->bt_cursor, CURS_ACQUIRE | CURS_AFTER | CURS_BEFORE);
	t->bt_cursor.pg.pgno = pgno;
	t->bt_cursor.pg.index = index;
	F_SET(&t->bt_cursor, CURS_INIT);
}