kv_create_put_with_options_op()
#include <kvstore.h>
kv_error_tkv_create_put_with_options_op(kv_operations_t *list,
const kv_key_t *key,
const kv_value_t *value,
const kv_version_t *version,kv_presence_enumif_presence,kv_return_value_version_enum return_info,
kv_int_t abort_on_failure)
Creates a complex put operation suitable for use as part of a multi-step operation to be run using kv_execute(). The semantics of the returned operation when executed are identical to that of kv_put().
Parameters
-
list
The list parameter operation sequence to which this put operation is appended. The sequence is allocated using kv_create_operations().
-
key
The key parameter is the Key portion of the Key/Value pair that you want to write to the store.
Note that all of the operations performed under a single call to kv_execute() must share the same major key path, and that major key path must be complete.
-
value
The value parameter is the Value portion of the Key/Value pair that you want to write to the store.
-
version
The version parameter indicates that the record should be put only if the existing value matches the version supplied to this parameter. Use this parameter when updating a value to ensure that it has not changed since it was last read. The version is obtained using the kv_get_version() function.
-
if_presence
The if_presence parameter describes the conditions under which the record can be put, based on the presence or absence of the record in the store. For example,
KV_IF_PRESENT
means that the record can only be written to the store if a version of the record already exists there.For a list of all the available presence options, see kv_presence_enum.
-
return_info
The return_info parameter indicates what information should be returned to the kv_execute() results list by this operation. See kv_return_value_version_enum for a description of the options accepted by this parameter.
-
abort_on_failure
The abort_on_failure parameter indicates whether the entire operation should abort if this put operation fails. Specify 1 if you want the operation to abort upon put failure.