kv_init_key_range()

#include <kvstore.h>

void
kv_init_key_range(kv_key_range_t *key_range,
                  const char *start, kv_int_t start_inclusive,
                  const char *end, kv_int_t end_inclusive) 

Creates a key range to be used in multiple-key operations and iterations.

The key range defines a range of string values for the key components immediately following the last component of a parent key that is used in a multiple-key operation. In terms of a tree structure, the range defines the parent key's immediate children that are selected by the multiple-key operation.

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.

  • start

    The start parameter defines the lower bound of the key range. If NULL, no lower bound is enforced.

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

  • start_inclusive

    The start_inclusive parameter indicates whether the value specified to start is included in the range. Specify 1 if it is included; 0 otherwise.

  • end

    The end parameter defines the upper bound of the key range. If NULL, no upper bound is enforced.

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

  • end_inclusive

    The end_inclusive parameter indicates whether the value specified to end is included in the range. Specify 1 if it is included; 0 otherwise.