diff options
Diffstat (limited to 'include/sqfs/dir.h')
-rw-r--r-- | include/sqfs/dir.h | 24 |
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 |