Lines Matching +defs:t +defs:c +defs:e
4 * Copyright (c) 1990, 1993, 1994
73 BTREE *t;
74 EPG e;
77 t = dbp->internal;
80 if (t->bt_pinned != NULL) {
81 mpool_put(t->bt_mp, t->bt_pinned, 0);
82 t->bt_pinned = NULL;
93 if (F_ISSET(&t->bt_cursor, CURS_INIT)) {
94 status = __bt_seqadv(t, &e, flags);
101 status = __bt_seqset(t, &e, key, flags);
109 __bt_setcur(t, e.page->pgno, e.index);
112 __bt_ret(t, &e, key, &t->bt_rkey, data, &t->bt_rdata, 0);
118 if (F_ISSET(t, B_DB_LOCK))
119 mpool_put(t->bt_mp, e.page, 0);
121 t->bt_pinned = e.page;
131 * t: tree
143 __bt_seqset(BTREE *t, EPG *ep, DBT *key, int flags)
164 return (__bt_first(t, key, ep, &exact));
169 if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
174 mpool_put(t->bt_mp, h, 0);
181 mpool_put(t->bt_mp, h, 0);
190 if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
195 mpool_put(t->bt_mp, h, 0);
202 mpool_put(t->bt_mp, h, 0);
217 * t: tree
227 __bt_seqadv(BTREE *t, EPG *ep, int flags)
229 CURSOR *c;
239 c = &t->bt_cursor;
242 * The cursor was deleted where there weren't any duplicate records,
244 * current tree. It doesn't matter if the returned key is an exact
249 if (F_ISSET(c, CURS_ACQUIRE))
250 return (__bt_first(t, &c->key, ep, &exact));
253 if ((h = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL)
267 if (F_ISSET(c, CURS_AFTER))
269 idx = c->pg.index;
272 mpool_put(t->bt_mp, h, 0);
275 if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
286 if (F_ISSET(c, CURS_BEFORE)) {
287 usecurrent: F_CLR(c, CURS_AFTER | CURS_BEFORE);
289 ep->index = c->pg.index;
292 idx = c->pg.index;
295 mpool_put(t->bt_mp, h, 0);
298 if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
316 * t: the tree
326 __bt_first(BTREE *t, const DBT *key, EPG *erval, int *exactp)
340 if ((ep = __bt_search(t, key, exactp)) == NULL)
343 if (F_ISSET(t, B_NODUPS)) {
357 mpool_put(t->bt_mp, save.page, 0);
363 * Don't unpin the page the last (or original) match
371 mpool_put(t->bt_mp, h, 0);
372 if ((h = mpool_get(t->bt_mp,
375 mpool_put(t->bt_mp,
383 } while (__bt_cmp(t, key, ep) == 0);
391 mpool_put(t->bt_mp, h, 0);
401 mpool_put(t->bt_mp, h, 0);
404 if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
418 * t: the tree
423 __bt_setcur(BTREE *t, pgno_t pgno, u_int idx)
426 if (t->bt_cursor.key.data != NULL) {
427 free(t->bt_cursor.key.data);
428 t->bt_cursor.key.size = 0;
429 t->bt_cursor.key.data = NULL;
431 F_CLR(&t->bt_cursor, CURS_ACQUIRE | CURS_AFTER | CURS_BEFORE);
434 t->bt_cursor.pg.pgno = pgno;
435 t->bt_cursor.pg.index = idx;
436 F_SET(&t->bt_cursor, CURS_INIT);