Map a key to a string value
Synopsis:
#include <pips/multimap.h>
int pips_multimap_add_string(pips_multimap_t *multimap,
const char *key,
const char *string_data)
Arguments:
- multimap
- The multimap instance in which the new mapping (item) is being created
- key
- The key to assign to the mapping
- string_data
- A character string to associate with the given key
Library:
pips-client
Description:
This function creates a mapping in the current multimap instance by associating a character string 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.