summaryrefslogtreecommitdiff
path: root/include/sqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-03 12:54:15 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-04 15:10:43 +0200
commitf780c9542d2c96cb0ae00a8de8d67b9a8fd278cd (patch)
tree8bde83d298124bd9ec8bb678e76a578ec62b10a7 /include/sqfs
parent949edd852d959c6350c4544632740e700c734b4f (diff)
Add fstree independend directory writer to libsquashfs.so
This commit adds a directory writer to libsquashfs that wrapps a meta data writer and provides a higher-level interface for writing directory entries. Under the hood it enforces the rules that squashfs insists upon. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/sqfs')
-rw-r--r--include/sqfs/dir.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/sqfs/dir.h b/include/sqfs/dir.h
index 5c822f1..818ca87 100644
--- a/include/sqfs/dir.h
+++ b/include/sqfs/dir.h
@@ -10,6 +10,7 @@
#include "config.h"
#include "sqfs/meta_reader.h"
+#include "sqfs/meta_writer.h"
#include <stdint.h>
@@ -36,6 +37,8 @@ typedef struct {
uint8_t name[];
} sqfs_dir_index_t;
+typedef struct sqfs_dir_writer_t sqfs_dir_writer_t;
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -47,6 +50,27 @@ int meta_reader_read_dir_header(meta_reader_t *m, sqfs_dir_header_t *hdr);
The function internally prints to stderr on failure */
sqfs_dir_entry_t *meta_reader_read_dir_ent(meta_reader_t *m);
+sqfs_dir_writer_t *sqfs_dir_writer_create(meta_writer_t *dm);
+
+void sqfs_dir_writer_destroy(sqfs_dir_writer_t *writer);
+
+int sqfs_dir_writer_begin(sqfs_dir_writer_t *writer);
+
+int sqfs_dir_writer_add_entry(sqfs_dir_writer_t *writer, const char *name,
+ uint32_t inode_num, uint64_t inode_ref,
+ mode_t mode);
+
+int sqfs_dir_writer_end(sqfs_dir_writer_t *writer);
+
+size_t sqfs_dir_writer_get_size(sqfs_dir_writer_t *writer);
+
+uint64_t sqfs_dir_writer_get_dir_reference(sqfs_dir_writer_t *writer);
+
+size_t sqfs_dir_writer_get_index_size(sqfs_dir_writer_t *writer);
+
+int sqfs_dir_writer_write_index(sqfs_dir_writer_t *writer,
+ meta_writer_t *im);
+
#ifdef __cplusplus
}
#endif