ec_message_context_exists_and_get

March 26, 2020 Contributors

Name

ec_message_context_exists_and_get — Determines whether a dictionary key exists and, if so, supplies a reference to the value

Synopsis

#include "ec_message.h"

| int **ec_message_context_exists_and_get** ( | m, |   |
|   | w, |   |
|   | k, |   |
|   | v); |   |

ec_message * <var class="pdparam">m</var>;
int <var class="pdparam">w</var>;
const char * <var class="pdparam">k</var>;
const char ** <var class="pdparam">v</var>;

Description

Determine whether a key/value pair exists in either the message context or connection context dictionary. Also provides a reference to the value in *v.

Parameters

m

A pointer to an ec_message struct. For documentation of this data structure see “ec_message”

w

An integer. Valid values are either ECMESS_CTX_CONN or ECMESS_CTX_MESS.

k

A constant string (char *) which is the dictionary key.

v

A pointer to a constant string (char **). *v stores a reference to the dictionary value.

Return Values

Returns 1 if the provided key exists in the appropriate dictionary and 0 otherwise.

Threading

It is legal to call this function in any thread.

See Also

ec_message_context_set,ec_message_context_exists, and ec_message_context_delete