kv_create_value_copy()
#include <kvstore.h>
kv_error_t
kv_create_value_copy(kv_store_t *store,
kv_value_t **value,
const unsigned char *data,
int data_len)
Creates the value in a key/value store. To release the resources used by this structure, use kv_release_value().
This function differs from kv_create_value() in that it copies the contents of the data buffer passed to the function, so that the buffer can be released, or modified and then reused in whatever way is required by the application.
Parameters
-
store
The store parameter is the handle to the store in which the value is stored. The store handle is obtained using kv_open_store().
-
value
The value parameter references memory into which a pointer to the allocated value is copied.
-
data
The data parameter is a buffer containing the data to be contained in the value.
Note that the buffer used here is copied. You may release or modify this memory as needed because the contents of this memory is copied to memory owned by the
kv_value_t
structure. -
data_len
The data_len parameter indicates the size of the data buffer.
See Also