aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-01 16:11:16 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-02 12:40:06 +0200
commit6ba88daae14e64009619562209060532eb6eadbb (patch)
tree2c21d168a4561756c7ce7129b2769ec5342f9f23 /include
parent4da96898487f0f4aca1dfc7afc355aa90065308a (diff)
Add meta data reader implementation
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/meta_reader.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/meta_reader.h b/include/meta_reader.h
new file mode 100644
index 0000000..4c03996
--- /dev/null
+++ b/include/meta_reader.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+#ifndef META_READER_H
+#define META_READER_H
+
+#include "compress.h"
+#include "squashfs.h"
+
+typedef struct {
+ uint64_t block_offset;
+ uint64_t next_block;
+ size_t offset;
+ int fd;
+ compressor_t *cmp;
+ uint8_t data[SQFS_META_BLOCK_SIZE];
+} meta_reader_t;
+
+meta_reader_t *meta_reader_create(int fd, compressor_t *cmp);
+
+void meta_reader_destroy(meta_reader_t *m);
+
+int meta_reader_seek(meta_reader_t *m, uint64_t block_start,
+ size_t offset);
+
+int meta_reader_read(meta_reader_t *m, void *data, size_t size);
+
+#endif /* META_READER_H */