kv_init_key_range_prefix()

#include <kvstore.h>

void 
kv_init_key_range_prefix(kv_key_range_t *key_range,
                         const char *prefix) 

Creates a key range based on a single string that defines the range's prefix. Using this function is the equivalent to using the kv_init_key_range() function like this:

kv_init_key_range(key_range_p, prefix_str, 1, prefix_str, 1); 

The key range defined here is for use with multiple-key operations and iterations.

Parameters

  • key_range

    The key_range parameter is the handle to the key range structure.

    The kv_key_range_t structure contains a series of const char * and int data members owned by you. For this reason, a release function is not needed for this structure. However, you should not free the strings until you are done using the key range.

  • prefix

    The prefix parameter is the string that defines both the lower and upper bounds, inclusive, of the key range.

    You must not free this string until you are done with the key_range created by this function.