feat(lsm): implement lsm entry add & remove

This commit is contained in:
Jef Roosens 2023-10-20 10:41:53 +02:00
parent 115ee12f04
commit fca8495de4
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
4 changed files with 105 additions and 2 deletions

View file

@ -59,6 +59,27 @@ bool lsm_entry_attr_present(lsm_entry *entry, lsm_attr_type type);
lsm_error lsm_entry_attr_get(lsm_str **out, lsm_entry *entry,
lsm_attr_type type);
/**
* Add a new attribute to the entry.
*
* @param entry entry to modify
* @param type type of attribute to add
* @param data data of attribute; ownership of pointer is taken over
*/
lsm_error lsm_entry_attr_insert(lsm_entry *entry, lsm_attr_type type,
lsm_str *data);
/**
* Remove an atribute from the given entry, if present.
*
* @param out pointer to store removed data pointer in. If NULL, data pointer
* can get leaked.
* @param entry entry to remove attribute from
* @param type type of attribute to remove
*/
lsm_error lsm_entry_attr_remove(lsm_str **out, lsm_entry *entry,
lsm_attr_type type);
/**
* A store consisting of LSM entries.
*