summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/data_reader.h3
-rw-r--r--include/frag_reader.h4
-rw-r--r--lib/sqfs/data_reader.c5
-rw-r--r--lib/sqfs/frag_reader.c10
4 files changed, 22 insertions, 0 deletions
diff --git a/include/data_reader.h b/include/data_reader.h
index 7de8e1a..a4964ee 100644
--- a/include/data_reader.h
+++ b/include/data_reader.h
@@ -2,6 +2,7 @@
#ifndef DATA_READER_H
#define DATA_READER_H
+#include "frag_reader.h"
#include "squashfs.h"
#include "compress.h"
#include "fstree.h"
@@ -34,4 +35,6 @@ void data_reader_destroy(data_reader_t *data);
int data_reader_dump_file(data_reader_t *data, file_info_t *fi, int outfd,
bool allow_sparse);
+const frag_reader_t *data_reader_get_fragment_reader(const data_reader_t *data);
+
#endif /* DATA_READER_H */
diff --git a/include/frag_reader.h b/include/frag_reader.h
index 5c538e4..cf16153 100644
--- a/include/frag_reader.h
+++ b/include/frag_reader.h
@@ -33,4 +33,8 @@ void frag_reader_destroy(frag_reader_t *f);
int frag_reader_read(frag_reader_t *f, size_t index, size_t offset,
void *buffer, size_t size);
+const sqfs_fragment_t *frag_reader_get_table(const frag_reader_t *f);
+
+size_t frag_reader_get_fragment_count(const frag_reader_t *f);
+
#endif /* FRAG_READER_H */
diff --git a/lib/sqfs/data_reader.c b/lib/sqfs/data_reader.c
index 96ccb39..5697b3e 100644
--- a/lib/sqfs/data_reader.c
+++ b/lib/sqfs/data_reader.c
@@ -167,3 +167,8 @@ fail_frag:
stderr);
return -1;
}
+
+const frag_reader_t *data_reader_get_fragment_reader(const data_reader_t *data)
+{
+ return data->frag;
+}
diff --git a/lib/sqfs/frag_reader.c b/lib/sqfs/frag_reader.c
index 6fa160b..b8991b3 100644
--- a/lib/sqfs/frag_reader.c
+++ b/lib/sqfs/frag_reader.c
@@ -179,3 +179,13 @@ fail_range:
fputs("attempted to read past fragment block limits\n", stderr);
return -1;
}
+
+const sqfs_fragment_t *frag_reader_get_table(const frag_reader_t *f)
+{
+ return f->tbl;
+}
+
+size_t frag_reader_get_fragment_count(const frag_reader_t *f)
+{
+ return f->num_fragments;
+}