Function rsdb::c::rsdb_cas [] [src]

#[no_mangle]
pub unsafe extern "C" fn rsdb_cas(
    db: *mut Tree,
    key: *const c_char,
    keylen: size_t,
    old_val: *const c_uchar,
    old_vallen: size_t,
    new_val: *const c_uchar,
    new_vallen: size_t,
    actual_val: *mut *const c_uchar,
    actual_vallen: *mut size_t
) -> c_uchar

Compare and swap. Returns 1 if successful, 0 if unsuccessful. Otherwise sets actual_val and actual_vallen to the current value, which must be freed using rsdb_free_buf by the caller if non-null. actual_val will be null and actual_vallen 0 if the current value is not set.