summaryrefslogtreecommitdiff
path: root/include/highlevel.h
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/highlevel.h
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/highlevel.h')
-rw-r--r--include/highlevel.h29
1 files changed, 2 insertions, 27 deletions
diff --git a/include/highlevel.h b/include/highlevel.h
index ef10c1e..576f686 100644
--- a/include/highlevel.h
+++ b/include/highlevel.h
@@ -16,6 +16,7 @@
#include "sqfs/table.h"
#include "sqfs/meta_writer.h"
#include "sqfs/xattr.h"
+#include "sqfs/dir.h"
#include "data_reader.h"
#include "fstree.h"
@@ -23,18 +24,6 @@
#include <stddef.h>
typedef struct {
- tree_node_t *node;
- uint32_t block;
- uint32_t index;
-} idx_ref_t;
-
-typedef struct {
- size_t num_nodes;
- size_t max_nodes;
- idx_ref_t idx_nodes[];
-} dir_index_t;
-
-typedef struct {
compressor_t *cmp;
data_reader_t *data;
sqfs_super_t super;
@@ -115,20 +104,6 @@ int sqfs_reader_open(sqfs_reader_t *rd, const char *filename,
void sqfs_reader_close(sqfs_reader_t *rd);
/*
- High level helper function that writes squashfs directory entries to
- a meta data writer.
-
- The dir_info_t structure is used to generate the listing and updated
- accordingly (such as writing back the header position and total size).
- A directory index is created on the fly and returned in *index.
- A single free() call is sufficient.
-
- Returns 0 on success. Prints error messages to stderr on failure.
- */
-int meta_writer_write_dir(meta_writer_t *dm, dir_info_t *dir,
- dir_index_t **index);
-
-/*
High level helper function to serialize a tree_node_t to a squashfs inode
and write it to a meta data writer.
@@ -140,7 +115,7 @@ int meta_writer_write_dir(meta_writer_t *dm, dir_info_t *dir,
Returns 0 on success. Prints error messages to stderr on failure.
*/
int meta_writer_write_inode(fstree_t *fs, id_table_t *idtbl, meta_writer_t *im,
- meta_writer_t *dm, tree_node_t *node);
+ sqfs_dir_writer_t *dirw, tree_node_t *node);
void compressor_print_available(void);