Updated: April 19, 2023 |
Attach user data to a publication
#include <pips/publication.h>
int pips_publication_attach_data(pips_publication_t *publication, void *const usr_data)
This function attaches the given user data to the current PiPS publication as a convenience for the caller. Internally, PiPS doesn't use the data, but the caller may retrieve the attached data at any time using pips_publication_get_data().
The user data is local only. Other providers have no visiblity into any local data attached to a publication.
The caller must keep a pointer to the previous data, which is the data attached to the publication before this function is called, so it can free that data's memory. Otherwise, if the function succeeds, this memory is leaked.