message: Add getter/setter for metadata handling

This commit is contained in:
Tobias Brunner
2022-01-14 10:13:21 +01:00
parent e3d84bc6f6
commit 6867050d47
2 changed files with 34 additions and 7 deletions
+17
View File
@@ -404,6 +404,23 @@ struct message_t {
*/
enumerator_t *(*get_fragments)(message_t *this);
/**
* Get metadata of this message.
*
* @param key key of the metadata to retrieve
* @return metadata object (internal data), NULL if not found
*/
metadata_t *(*get_metadata)(message_t *message, const char *key);
/**
* Set/remove metadata of this message.
*
* @param key key of the metadata (cloned)
* @param data metadata object (adopted), NULL to remove and destroy
* existing object with the given key
*/
void (*set_metadata)(message_t *message, const char *key, metadata_t *data);
/**
* Destroys a message and all including objects.
*/