aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-20 17:48:33 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-20 18:34:17 +0200
commitec4332f747425859f37641ecd249537efb338a90 (patch)
tree9a5765fc0a9c2322c3aaf5718cdec9a653896e3d /include
parentec70d9ffa6913c6643d25f9115830fd89b6ddfa7 (diff)
Move data_reader_dump function out of data reader
This commit adds two new functions for getting a file block by index, or a files fragment. The data_reader_dump function is rewritten in terms of those two functions and moved to a seperate file. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/data_reader.h10
-rw-r--r--include/sqfs/error.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/include/data_reader.h b/include/data_reader.h
index 77bdd82..324cdc8 100644
--- a/include/data_reader.h
+++ b/include/data_reader.h
@@ -28,8 +28,16 @@ data_reader_t *data_reader_create(sqfs_file_t *file, sqfs_super_t *super,
void data_reader_destroy(data_reader_t *data);
+int data_reader_get_fragment(data_reader_t *data,
+ const sqfs_inode_generic_t *inode,
+ sqfs_block_t **out);
+
+int data_reader_get_block(data_reader_t *data,
+ const sqfs_inode_generic_t *inode,
+ size_t index, sqfs_block_t **out);
+
int data_reader_dump(data_reader_t *data, const sqfs_inode_generic_t *inode,
- int outfd, bool allow_sparse);
+ int outfd, size_t block_size, bool allow_sparse);
/*
Read a chunk of data from a file. Starting from 'offset' into the
diff --git a/include/sqfs/error.h b/include/sqfs/error.h
index 31ebb47..7277a3d 100644
--- a/include/sqfs/error.h
+++ b/include/sqfs/error.h
@@ -109,6 +109,8 @@ typedef enum {
SQFS_ERROR_NO_ENTRY = -13,
SQFS_ERROR_LINK_LOOP = -14,
+
+ SQFS_ERROR_NOT_FILE = -15,
} E_SQFS_ERROR;
#endif /* SQFS_ERROR_H */