dict_key_exists_and_fetch

March 26, 2020

Name

dict_key_exists_and_fetch — If the specified key exists, retrieve its value

Synopsis

#include "ecdict.h"

| int **dict_key_exists_and_fetch** ( | a, |   |
|   | key, |   |
|   | value); |   |

ECDict <var class="pdparam">a</var>;
const char * <var class="pdparam">key</var>;
const char ** <var class="pdparam">value</var>;

Description

If the specified key exists, retrieve its value.

Parameters

a

The dictionary. An ECDict is a typedef of an ec_hash_table.

key

The key.

value

The associated value.

Return Value

Returns 1 if the key exists, 0 if it does not exist. If the key exists its value can be found at * value.

Warning

When a key or value is returned, the memory is owned by the dictionary. Your memory can become invalid if something else removes an entry from the dictionary after you have queried it.

Threading

It is legal to call this function in any thread.

See Also

“ec_hash_table”