diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-05 19:06:42 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-05 16:01:34 +0200 |
commit | c9a8adc15f9de110771156fdc85fb98533648a53 (patch) | |
tree | cdd6300b1c69a002628a76c4bac45ac6664111d9 /lib/tar/src/write_header.c | |
parent | 57ca46cdd74fd1004a3b0476c136e1f26fcf002d (diff) |
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar/src/write_header.c')
-rw-r--r-- | lib/tar/src/write_header.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 <string.h> #include <stdlib.h> @@ -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; |