aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-05-15 20:11:56 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-05-16 16:54:44 +0200
commit9a97a9a4fe224bcf53ad23af31bca67bbb71a824 (patch)
treebf1bd2ba581f8816813e6d17aa7e569b7b89cd1b /include
parentf5377528d4897e42fafe6c88ce550c956b0d85be (diff)
libtar: replace tar_xattr_t with dir_entry_xattr_t struct
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/io/xattr.h17
-rw-r--r--include/tar/tar.h15
2 files changed, 19 insertions, 13 deletions
diff --git a/include/io/xattr.h b/include/io/xattr.h
index d912fad..cf35bca 100644
--- a/include/io/xattr.h
+++ b/include/io/xattr.h
@@ -1,4 +1,4 @@
-/* SPDX-License-Identifier: LGPL-3.0-or-later */
+/* SPDX-License-Identifier: GPL-3.0-or-later */
/*
* xattr.h
*
@@ -7,6 +7,8 @@
#ifndef IO_XATTR_H
#define IO_XATTR_H
+#include "sqfs/predef.h"
+
typedef struct dir_entry_xattr_t {
struct dir_entry_xattr_t *next;
char *key;
@@ -15,4 +17,17 @@ typedef struct dir_entry_xattr_t {
char data[];
} dir_entry_xattr_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+dir_entry_xattr_t *dir_entry_xattr_create(const char *key, const sqfs_u8 *value,
+ size_t value_len);
+
+void dir_entry_xattr_list_free(dir_entry_xattr_t *list);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* IO_XATTR_H */
diff --git a/include/tar/tar.h b/include/tar/tar.h
index 7c4faa7..21ded7d 100644
--- a/include/tar/tar.h
+++ b/include/tar/tar.h
@@ -11,6 +11,7 @@
#include "compat.h"
#include "io/istream.h"
#include "io/ostream.h"
+#include "io/dir_iterator.h"
#include <stdbool.h>
#include <stdint.h>
@@ -22,14 +23,6 @@ typedef struct sparse_map_t {
sqfs_u64 count;
} sparse_map_t;
-typedef struct tar_xattr_t {
- struct tar_xattr_t *next;
- char *key;
- sqfs_u8 *value;
- size_t value_len;
- char data[];
-} tar_xattr_t;
-
typedef struct {
char *name;
char *link_target;
@@ -38,7 +31,7 @@ typedef struct {
sqfs_u64 record_size;
bool unknown_record;
bool is_hard_link;
- tar_xattr_t *xattr;
+ dir_entry_xattr_t *xattr;
sqfs_u16 mode;
sqfs_u64 uid;
@@ -59,7 +52,7 @@ extern "C" {
headers need to be generated.
*/
int write_tar_header(ostream_t *fp, const struct stat *sb, const char *name,
- const char *slink_target, const tar_xattr_t *xattr,
+ const char *slink_target, const dir_entry_xattr_t *xattr,
unsigned int counter);
int write_hard_link(ostream_t *fp, const struct stat *sb, const char *name,
@@ -83,8 +76,6 @@ int padd_file(ostream_t *fp, sqfs_u64 size);
void free_sparse_list(sparse_map_t *sparse);
-void free_xattr_list(tar_xattr_t *list);
-
#ifdef __cplusplus
}
#endif