diff options
Diffstat (limited to 'lib/sqfs/meta_reader.c')
-rw-r--r-- | lib/sqfs/meta_reader.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/sqfs/meta_reader.c b/lib/sqfs/meta_reader.c index 19e856a..8fd7f21 100644 --- a/lib/sqfs/meta_reader.c +++ b/lib/sqfs/meta_reader.c @@ -18,6 +18,8 @@ #include <string.h> struct sqfs_meta_reader_t { + sqfs_object_t base; + sqfs_u64 start; sqfs_u64 limit; size_t data_used; @@ -44,6 +46,11 @@ struct sqfs_meta_reader_t { sqfs_u8 scratch[SQFS_META_BLOCK_SIZE]; }; +static void meta_reader_destroy(sqfs_object_t *m) +{ + free(m); +} + sqfs_meta_reader_t *sqfs_meta_reader_create(sqfs_file_t *file, sqfs_compressor_t *cmp, sqfs_u64 start, sqfs_u64 limit) @@ -53,6 +60,7 @@ sqfs_meta_reader_t *sqfs_meta_reader_create(sqfs_file_t *file, if (m == NULL) return NULL; + ((sqfs_object_t *)m)->destroy = meta_reader_destroy; m->start = start; m->limit = limit; m->file = file; @@ -60,11 +68,6 @@ sqfs_meta_reader_t *sqfs_meta_reader_create(sqfs_file_t *file, return m; } -void sqfs_meta_reader_destroy(sqfs_meta_reader_t *m) -{ - free(m); -} - int sqfs_meta_reader_seek(sqfs_meta_reader_t *m, sqfs_u64 block_start, size_t offset) { |