pips_multimap_add_boolean()

Updated: April 19, 2023

Map a key to a boolean value

Synopsis:

#include <pips/multimap.h>
int pips_multimap_add_boolean(pips_multimap_t *multimap,
                              const char *key,
                              const bool value)

Arguments:

multimap
The multimap instance in which the new mapping (item) is being created
key
The key to assign to the mapping
value
A boolean value to associate with the given key

Library:

pips-client

Description:

This function creates a mapping in the current multimap instance by associating a boolean value with the given key. The mapping is created only if the given key is not already mapped to another value, so this function cannot be used to update a key's value, only to create a new mapping.

Returns:

0
The mapping was created successfully
-1
An error prevented the creation of the new mapping (errno is set)

Errors:

  • EEXIST: The multimap already contains a mapping for the given key.
  • EINVAL: The multimap instance is not valid.
  • ENOMEM: There was not enough memory to allocate a new mapping.