From c9a8adc15f9de110771156fdc85fb98533648a53 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 5 Jun 2023 19:06:42 +0200 Subject: Move dir_entry_xattr_t from libio to libsquashfs The structure and functions are renamed to sqfs_xattr_* instead, an additional helper is added to accept an encoded xattr. Documentation and unit test are added as well. Signed-off-by: David Oberhollenzer --- lib/tar/src/write_header.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/tar/src/write_header.c') diff --git a/lib/tar/src/write_header.c b/lib/tar/src/write_header.c index f5473ca..039d1fe 100644 --- a/lib/tar/src/write_header.c +++ b/lib/tar/src/write_header.c @@ -7,6 +7,7 @@ #include "config.h" #include "internal.h" +#include "sqfs/xattr.h" #include #include @@ -144,15 +145,14 @@ static size_t prefix_digit_len(size_t len) } static int write_schily_xattr(ostream_t *fp, const struct stat *orig, - const char *name, const dir_entry_xattr_t *xattr) + const char *name, const sqfs_xattr_t *xattr) { static const char *prefix = "SCHILY.xattr."; size_t len, total_size = 0; - const dir_entry_xattr_t *it; char *buffer, *ptr; int ret; - for (it = xattr; it != NULL; it = it->next) { + for (const sqfs_xattr_t *it = xattr; it != NULL; it = it->next) { len = strlen(prefix) + strlen(it->key) + it->value_len + 3; total_size += len + prefix_digit_len(len); @@ -167,7 +167,7 @@ static int write_schily_xattr(ostream_t *fp, const struct stat *orig, ptr = buffer; - for (it = xattr; it != NULL; it = it->next) { + for (const sqfs_xattr_t *it = xattr; it != NULL; it = it->next) { len = strlen(prefix) + strlen(it->key) + it->value_len + 3; len += prefix_digit_len(len); @@ -184,7 +184,7 @@ static int write_schily_xattr(ostream_t *fp, const struct stat *orig, } int write_tar_header(ostream_t *fp, const struct stat *sb, const char *name, - const char *slink_target, const dir_entry_xattr_t *xattr, + const char *slink_target, const sqfs_xattr_t *xattr, unsigned int counter) { const char *reason; -- cgit v1.2.3