kv_create_value()
#include <kvstore.h>
kv_error_t
kv_create_value(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_copy() in that it does not copy the contents of the data buffer passed to the function. Therefore, the data buffer should not be released or modified until the kv_value_t
structure created by this function is released.
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 not copied. You must not release or modify this memory until the structure in which it is used is released.
-
data_len
The data_len parameter indicates the size of the data buffer.
See Also