summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-02 14:53:13 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-02 14:55:22 +0200
commit949edd852d959c6350c4544632740e700c734b4f (patch)
tree5683a4396f00ba9542009d9d9a6fcbb7470407dc /include
parent9d9d4505f58b6584fe3b261a7686c5d779f77c11 (diff)
Move fstree independend parts of xattr_reader to libsquashfs.so
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/highlevel.h4
-rw-r--r--include/sqfs/xattr.h19
-rw-r--r--include/xattr_reader.h26
3 files changed, 23 insertions, 26 deletions
diff --git a/include/highlevel.h b/include/highlevel.h
index 6b8e2e2..ef10c1e 100644
--- a/include/highlevel.h
+++ b/include/highlevel.h
@@ -15,6 +15,7 @@
#include "sqfs/data.h"
#include "sqfs/table.h"
#include "sqfs/meta_writer.h"
+#include "sqfs/xattr.h"
#include "data_reader.h"
#include "fstree.h"
@@ -150,4 +151,7 @@ int compressor_cfg_init_options(compressor_config_t *cfg, E_SQFS_COMPRESSOR id,
void compressor_print_help(E_SQFS_COMPRESSOR id);
+int xattr_reader_restore_node(xattr_reader_t *xr, fstree_t *fs,
+ tree_node_t *node, uint32_t xattr);
+
#endif /* HIGHLEVEL_H */
diff --git a/include/sqfs/xattr.h b/include/sqfs/xattr.h
index 2e48a4e..92fdbfe 100644
--- a/include/sqfs/xattr.h
+++ b/include/sqfs/xattr.h
@@ -9,6 +9,8 @@
#include "config.h"
+#include "sqfs/compress.h"
+
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
@@ -45,6 +47,8 @@ typedef struct {
uint32_t unused;
} sqfs_xattr_id_table_t;
+typedef struct xattr_reader_t xattr_reader_t;
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -58,6 +62,21 @@ int sqfs_get_xattr_prefix_id(const char *key);
/* Check if a given xattr key can be encoded in squashfs at all. */
bool sqfs_has_xattr(const char *key);
+void xattr_reader_destroy(xattr_reader_t *xr);
+
+xattr_reader_t *xattr_reader_create(int sqfsfd, sqfs_super_t *super,
+ compressor_t *cmp);
+
+int xattr_reader_get_desc(xattr_reader_t *xr, uint32_t idx,
+ sqfs_xattr_id_t *desc);
+
+int xattr_reader_seek_kv(xattr_reader_t *xr, const sqfs_xattr_id_t *desc);
+
+sqfs_xattr_value_t *xattr_reader_read_value(xattr_reader_t *xr,
+ const sqfs_xattr_entry_t *key);
+
+sqfs_xattr_entry_t *xattr_reader_read_key(xattr_reader_t *xr);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/xattr_reader.h b/include/xattr_reader.h
deleted file mode 100644
index 9cacd35..0000000
--- a/include/xattr_reader.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* SPDX-License-Identifier: GPL-3.0-or-later */
-/*
- * xattr_reader.h
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#ifndef XATTR_READER_H
-#define XATTR_READER_H
-
-#include "config.h"
-
-#include "sqfs/compress.h"
-#include "sqfs/data.h"
-#include "fstree.h"
-
-typedef struct xattr_reader_t xattr_reader_t;
-
-void xattr_reader_destroy(xattr_reader_t *xr);
-
-xattr_reader_t *xattr_reader_create(int sqfsfd, sqfs_super_t *super,
- compressor_t *cmp);
-
-int xattr_reader_restore_node(xattr_reader_t *xr, fstree_t *fs,
- tree_node_t *node, uint32_t xattr);
-
-#endif /* XATTR_READER_H */