strm_dict_key_rstr()

Updated: April 19, 2023

Get the key of a dictionary entry as a shareable string, based on its index

Synopsis:

#include <sys/strm.h>
const strm_string_t* strm_dict_key_rstr(const strm_dict_t *dict,
                                        size_t n)

Arguments:

dict
A dictionary handle.
n
The zero-based index of the entry whose key is being retrieved.

Library:

libstrm

Description:

This function finds the key of the entry stored at the zero-based index given in n, in the dictionary specified by dict. It returns a handle to the shareable string containing the entry's key.

The returned handle is owned by the dictionary and remains valid until the dictionary handle is destroyed. You can clone the shareable string handle to have one that exists independently of the dictionary.

Returns:

If the entry is found, a handle to the shareable string containing its key. If it's not found, a null pointer.