diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-05 19:15:13 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-05 16:22:00 +0200 |
commit | 2d3cb9c4323a803268206db3a9363abc67d908d0 (patch) | |
tree | ebf126a48931b46f5d76c42818754dbf054c68b5 /lib/sqfs/src | |
parent | c9a8adc15f9de110771156fdc85fb98533648a53 (diff) |
libsqfs: Add an xattr writer function to add a combined key-value struct
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/src')
-rw-r--r-- | lib/sqfs/src/xattr/xattr_writer_record.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/sqfs/src/xattr/xattr_writer_record.c b/lib/sqfs/src/xattr/xattr_writer_record.c index 81bbf6b..082331c 100644 --- a/lib/sqfs/src/xattr/xattr_writer_record.c +++ b/lib/sqfs/src/xattr/xattr_writer_record.c @@ -46,8 +46,8 @@ int sqfs_xattr_writer_begin(sqfs_xattr_writer_t *xwr, sqfs_u32 flags) return 0; } -int sqfs_xattr_writer_add(sqfs_xattr_writer_t *xwr, const char *key, - const void *value, size_t size) +int sqfs_xattr_writer_add_kv(sqfs_xattr_writer_t *xwr, const char *key, + const void *value, size_t size) { size_t i, key_index, old_value_index, value_index; sqfs_u64 kv_pair; @@ -98,6 +98,12 @@ int sqfs_xattr_writer_add(sqfs_xattr_writer_t *xwr, const char *key, return array_append(&xwr->kv_pairs, &kv_pair); } +int sqfs_xattr_writer_add(sqfs_xattr_writer_t *xwr, const sqfs_xattr_t *ent) +{ + return sqfs_xattr_writer_add_kv(xwr, ent->key, + ent->value, ent->value_len); +} + int sqfs_xattr_writer_end(sqfs_xattr_writer_t *xwr, sqfs_u32 *out) { kv_block_desc_t blk; |