mdb_cursor_get function

int mdb_cursor_get(
  1. Pointer<MDB_cursor> cursor,
  2. Pointer<MDB_val> key,
  3. Pointer<MDB_val> data,
  4. int op,
)

@brief Retrieve by cursor.

This function retrieves key/data pairs from the database. The address and length of the key are returned in the object to which \b key refers (except for the case of the #MDB_SET option, in which the \b key object is unchanged), and the address and length of the data are returned in the object to which \b data refers. See #mdb_get() for restrictions on using the output values. @paramin cursor A cursor handle returned by #mdb_cursor_open() @paramin,out key The key for a retrieved item @paramin,out data The data of a retrieved item @paramin op A cursor operation #MDB_cursor_op @return A non-zero error value on failure and 0 on success. Some possible errors are:

  • #MDB_NOTFOUND - no matching key found.
  • EINVAL - an invalid parameter was specified.

Implementation

@ffi.FfiNative<
    ffi.Int Function(ffi.Pointer<MDB_cursor>, ffi.Pointer<MDB_val>,
        ffi.Pointer<MDB_val>, ffi.Int32)>('mdb_cursor_get')
external int mdb_cursor_get(
  ffi.Pointer<MDB_cursor> cursor,
  ffi.Pointer<MDB_val> key,
  ffi.Pointer<MDB_val> data,
  int op,
);