Function eosio_sys::db_next_i64

source ·
pub unsafe extern "C" fn db_next_i64(
    iterator: i32,
    primary: *mut u64
) -> i32
Expand description

Find the table row following the referenced table row in a primary 64-bit integer index table

@brief Find the table row following the referenced table row in a primary 64-bit integer index table @param iterator - The iterator to the referenced table row @param primary - Pointer to a uint64_t variable which will have its value set to the primary key of the next table row @return iterator to the table row following the referenced table row (or the end iterator of the table if the referenced table row is the last one in the table) @pre iterator points to an existing table row in the table @post *primary will be replaced with the primary key of the table row following the referenced table row if it exists, otherwise *primary will be left untouched

Example:

@code int32_t charlie_itr = db_find_i64(receiver, receiver, table1, N(charlie)); // expect nothing after charlie uint64_t prim = 0 int32_t end_itr = db_next_i64(charlie_itr, &prim); eosio_assert(end_itr < -1, “Charlie was not the last entry in the table”); @endcode