From 2d3cb9c4323a803268206db3a9363abc67d908d0 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 5 Jun 2023 19:15:13 +0200 Subject: libsqfs: Add an xattr writer function to add a combined key-value struct Signed-off-by: David Oberhollenzer --- include/sqfs/xattr_writer.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sqfs/xattr_writer.h b/include/sqfs/xattr_writer.h index 8820e51..d8f8343 100644 --- a/include/sqfs/xattr_writer.h +++ b/include/sqfs/xattr_writer.h @@ -94,8 +94,24 @@ SQFS_API int sqfs_xattr_writer_begin(sqfs_xattr_writer_t *xwr, sqfs_u32 flags); * * @return Zero on success, a negative @ref SQFS_ERROR value on failure. */ -SQFS_API int sqfs_xattr_writer_add(sqfs_xattr_writer_t *xwr, const char *key, - const void *value, size_t size); +SQFS_API int sqfs_xattr_writer_add_kv(sqfs_xattr_writer_t *xwr, + const char *key, + const void *value, size_t size); + +/** + * @brief Add a key-value struct to the current block. + * + * @memberof sqfs_xattr_writer_t + * + * To add a key string and value blob, use @ref sqfs_xattr_writer_add_kv + * + * @param xwr A pointer to an xattr writer instance. + * @param ent A pointer to a combined key-value pair. + * + * @return Zero on success, a negative @ref SQFS_ERROR value on failure. + */ +SQFS_API int sqfs_xattr_writer_add(sqfs_xattr_writer_t *xwr, + const sqfs_xattr_t *ent); /** * @brief Finish a generating a key-value block. -- cgit v1.2.3