pips_multimap_add_blob()

Updated: April 19, 2023

Map a key to a BLOB value

Synopsis:

#include <pips/multimap.h>
int pips_multimap_add_blob(pips_multimap_t *multimap,
                           const char *key,
                           const void *data,
                           size_t data_size)

Arguments:

multimap
The multimap instance in which the new mapping (item) is being created
key
The key to assign to the mapping
data
A pointer to a buffer containing a sequence of bytes to associate with the given key
data_size
The number of bytes of binary data that represent the BLOB value

Library:

pips-client

Description:

This function creates a mapping in the current multimap instance by associating an arbitrary sequence of binary data with the given key. The mapping is created only if the 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 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.