diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common/writer.c | 2 | ||||
-rw-r--r-- | lib/sqfs/data_reader.c | 9 | ||||
-rw-r--r-- | lib/sqfs/dir_reader.c | 17 | ||||
-rw-r--r-- | lib/sqfs/read_tree.c | 6 | ||||
-rw-r--r-- | lib/sqfs/xattr/xattr_writer.c | 8 | ||||
-rw-r--r-- | lib/sqfs/xattr/xattr_writer_record.c | 5 |
6 files changed, 34 insertions, 13 deletions
diff --git a/lib/common/writer.c b/lib/common/writer.c index a446c41..9032a99 100644 --- a/lib/common/writer.c +++ b/lib/common/writer.c @@ -155,7 +155,7 @@ int sqfs_writer_init(sqfs_writer_t *sqfs, const sqfs_writer_cfg_t *wrcfg) } if (!wrcfg->no_xattr) { - sqfs->xwr = sqfs_xattr_writer_create(); + sqfs->xwr = sqfs_xattr_writer_create(0); if (sqfs->xwr == NULL) { sqfs_perror(wrcfg->filename, "creating xattr writer", diff --git a/lib/sqfs/data_reader.c b/lib/sqfs/data_reader.c index cd9ad68..7148a53 100644 --- a/lib/sqfs/data_reader.c +++ b/lib/sqfs/data_reader.c @@ -184,10 +184,15 @@ fail_ftbl: sqfs_data_reader_t *sqfs_data_reader_create(sqfs_file_t *file, size_t block_size, - sqfs_compressor_t *cmp) + sqfs_compressor_t *cmp, + sqfs_u32 flags) { - sqfs_data_reader_t *data = alloc_flex(sizeof(*data), 1, block_size); + sqfs_data_reader_t *data; + if (flags != 0) + return NULL; + + data = alloc_flex(sizeof(*data), 1, block_size); if (data == NULL) return NULL; diff --git a/lib/sqfs/dir_reader.c b/lib/sqfs/dir_reader.c index 8e23ddb..49d1188 100644 --- a/lib/sqfs/dir_reader.c +++ b/lib/sqfs/dir_reader.c @@ -73,11 +73,16 @@ fail_mino: sqfs_dir_reader_t *sqfs_dir_reader_create(const sqfs_super_t *super, sqfs_compressor_t *cmp, - sqfs_file_t *file) + sqfs_file_t *file, + sqfs_u32 flags) { - sqfs_dir_reader_t *rd = calloc(1, sizeof(*rd)); + sqfs_dir_reader_t *rd; sqfs_u64 start, limit; + if (flags != 0) + return NULL; + + rd = calloc(1, sizeof(*rd)); if (rd == NULL) return NULL; @@ -115,11 +120,15 @@ sqfs_dir_reader_t *sqfs_dir_reader_create(const sqfs_super_t *super, } int sqfs_dir_reader_open_dir(sqfs_dir_reader_t *rd, - const sqfs_inode_generic_t *inode) + const sqfs_inode_generic_t *inode, + sqfs_u32 flags) { sqfs_u64 block_start; size_t size, offset; + if (flags != 0) + return SQFS_ERROR_UNSUPPORTED; + if (inode->base.type == SQFS_INODE_DIR) { size = inode->data.dir.size; offset = inode->data.dir.offset; @@ -274,7 +283,7 @@ int sqfs_dir_reader_find_by_path(sqfs_dir_reader_t *rd, continue; } - ret = sqfs_dir_reader_open_dir(rd, inode); + ret = sqfs_dir_reader_open_dir(rd, inode, 0); free(inode); if (ret) return ret; diff --git a/lib/sqfs/read_tree.c b/lib/sqfs/read_tree.c index 5464595..b668ef4 100644 --- a/lib/sqfs/read_tree.c +++ b/lib/sqfs/read_tree.c @@ -124,7 +124,7 @@ static int fill_dir(sqfs_dir_reader_t *dr, sqfs_tree_node_t *root, if (n->inode->base.type == SQFS_INODE_DIR || n->inode->base.type == SQFS_INODE_EXT_DIR) { if (!(flags & SQFS_TREE_NO_RECURSE)) { - err = sqfs_dir_reader_open_dir(dr, n->inode); + err = sqfs_dir_reader_open_dir(dr, n->inode, 0); if (err) return err; @@ -220,7 +220,7 @@ int sqfs_dir_reader_get_full_hierarchy(sqfs_dir_reader_t *rd, continue; } - ret = sqfs_dir_reader_open_dir(rd, tail->inode); + ret = sqfs_dir_reader_open_dir(rd, tail->inode, 0); if (ret) goto fail; @@ -280,7 +280,7 @@ int sqfs_dir_reader_get_full_hierarchy(sqfs_dir_reader_t *rd, if (tail->inode->base.type == SQFS_INODE_DIR || tail->inode->base.type == SQFS_INODE_EXT_DIR) { - ret = sqfs_dir_reader_open_dir(rd, tail->inode); + ret = sqfs_dir_reader_open_dir(rd, tail->inode, 0); if (ret) goto fail; diff --git a/lib/sqfs/xattr/xattr_writer.c b/lib/sqfs/xattr/xattr_writer.c index 9de3823..c33d366 100644 --- a/lib/sqfs/xattr/xattr_writer.c +++ b/lib/sqfs/xattr/xattr_writer.c @@ -81,10 +81,14 @@ static void xattr_writer_destroy(sqfs_object_t *obj) free(xwr); } -sqfs_xattr_writer_t *sqfs_xattr_writer_create(void) +sqfs_xattr_writer_t *sqfs_xattr_writer_create(sqfs_u32 flags) { - sqfs_xattr_writer_t *xwr = calloc(1, sizeof(*xwr)); + sqfs_xattr_writer_t *xwr; + if (flags != 0) + return NULL; + + xwr = calloc(1, sizeof(*xwr)); if (str_table_init(&xwr->keys, XATTR_KEY_BUCKETS)) goto fail_keys; diff --git a/lib/sqfs/xattr/xattr_writer_record.c b/lib/sqfs/xattr/xattr_writer_record.c index 7cc55b6..aa87246 100644 --- a/lib/sqfs/xattr/xattr_writer_record.c +++ b/lib/sqfs/xattr/xattr_writer_record.c @@ -37,8 +37,11 @@ static int compare_u64(const void *a, const void *b) return (lhs < rhs ? -1 : (lhs > rhs ? 1 : 0)); } -int sqfs_xattr_writer_begin(sqfs_xattr_writer_t *xwr) +int sqfs_xattr_writer_begin(sqfs_xattr_writer_t *xwr, sqfs_u32 flags) { + if (flags != 0) + return SQFS_ERROR_UNSUPPORTED; + xwr->kv_start = xwr->num_pairs; return 0; } |