mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 08:09:34 -05:00
Use BDB cursor terminology
This commit is contained in:
parent
60550e14ee
commit
cc56ba04fb
2 changed files with 10 additions and 8 deletions
|
|
@ -1774,7 +1774,7 @@ mdb_cursor_set(MDB_cursor *cursor, MDB_val *key, MDB_val *data,
|
||||||
top = CURSOR_TOP(cursor);
|
top = CURSOR_TOP(cursor);
|
||||||
leaf = mdb_search_node(cursor->mc_txn, cursor->mc_dbi, mpp.mp_page, key, exactp, &top->mp_ki);
|
leaf = mdb_search_node(cursor->mc_txn, cursor->mc_dbi, mpp.mp_page, key, exactp, &top->mp_ki);
|
||||||
if (exactp != NULL && !*exactp) {
|
if (exactp != NULL && !*exactp) {
|
||||||
/* MDB_CURSOR_EXACT specified and not an exact match. */
|
/* MDB_SET specified and not an exact match. */
|
||||||
return ENOENT;
|
return ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1863,13 +1863,13 @@ mdb_cursor_get(MDB_cursor *cursor, MDB_val *key, MDB_val *data,
|
||||||
assert(cursor);
|
assert(cursor);
|
||||||
|
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case MDB_CURSOR:
|
case MDB_SET:
|
||||||
case MDB_CURSOR_EXACT:
|
case MDB_SET_RANGE:
|
||||||
while (CURSOR_TOP(cursor) != NULL)
|
while (CURSOR_TOP(cursor) != NULL)
|
||||||
cursor_pop_page(cursor);
|
cursor_pop_page(cursor);
|
||||||
if (key == NULL || key->mv_size == 0 || key->mv_size > MAXKEYSIZE) {
|
if (key == NULL || key->mv_size == 0 || key->mv_size > MAXKEYSIZE) {
|
||||||
rc = EINVAL;
|
rc = EINVAL;
|
||||||
} else if (op == MDB_CURSOR_EXACT)
|
} else if (op == MDB_SET)
|
||||||
rc = mdb_cursor_set(cursor, key, data, &exact);
|
rc = mdb_cursor_set(cursor, key, data, &exact);
|
||||||
else
|
else
|
||||||
rc = mdb_cursor_set(cursor, key, data, NULL);
|
rc = mdb_cursor_set(cursor, key, data, NULL);
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,14 @@ typedef void (MDB_rel_func)(void *ptr, void *oldptr);
|
||||||
#define MDB_NOOVERWRITE 1
|
#define MDB_NOOVERWRITE 1
|
||||||
|
|
||||||
typedef enum MDB_cursor_op { /* cursor operations */
|
typedef enum MDB_cursor_op { /* cursor operations */
|
||||||
MDB_CURSOR, /* position at given key */
|
MDB_SET, /* position at key, or fail */
|
||||||
MDB_CURSOR_EXACT, /* position at key, or fail */
|
MDB_SET_RANGE, /* position at given key */
|
||||||
MDB_FIRST,
|
MDB_FIRST,
|
||||||
MDB_NEXT,
|
MDB_NEXT,
|
||||||
MDB_LAST, /* not implemented */
|
MDB_LAST,
|
||||||
MDB_PREV /* not implemented */
|
MDB_PREV, /* not implemented */
|
||||||
|
MDB_GET_BOTH, /* position at key/data */
|
||||||
|
MDB_GET_BOTH_RANGE /* position at key, nearest data */
|
||||||
} MDB_cursor_op;
|
} MDB_cursor_op;
|
||||||
|
|
||||||
/* return codes */
|
/* return codes */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue