diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-20 11:58:00 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-05-20 12:02:55 +0200 |
commit | fce20510810cd8f5e078cecd113bbcacd2d71516 (patch) | |
tree | 5ef9fbd900d0a80ece55a3318cf998d1c35a1f36 | |
parent | 13cc42ce135155f0437298540b0bc5a821d7a644 (diff) |
cleanup: internalize frag_reader_t implementation
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r-- | include/frag_reader.h | 13 | ||||
-rw-r--r-- | lib/sqfs/frag_reader.c | 12 |
2 files changed, 13 insertions, 12 deletions
diff --git a/include/frag_reader.h b/include/frag_reader.h index 623cc8d..5c538e4 100644 --- a/include/frag_reader.h +++ b/include/frag_reader.h @@ -8,18 +8,7 @@ #include <stdint.h> #include <stddef.h> -/* A simple interface for accessing fragments in a SquashFS image */ -typedef struct { - sqfs_fragment_t *tbl; - size_t num_fragments; - - int fd; - compressor_t *cmp; - size_t block_size; - size_t used; - size_t current_index; - uint8_t buffer[]; -} frag_reader_t; +typedef struct frag_reader_t frag_reader_t; /* Reads and decodes the fragment table from the image. Cleans up after itself and prints error messages to stderr on the way if it fails. */ diff --git a/lib/sqfs/frag_reader.c b/lib/sqfs/frag_reader.c index 74fd292..02d813e 100644 --- a/lib/sqfs/frag_reader.c +++ b/lib/sqfs/frag_reader.c @@ -8,6 +8,18 @@ #include <stdlib.h> #include <stdio.h> +struct frag_reader_t { + sqfs_fragment_t *tbl; + size_t num_fragments; + + int fd; + compressor_t *cmp; + size_t block_size; + size_t used; + size_t current_index; + uint8_t buffer[]; +}; + static int precache_block(frag_reader_t *f, size_t i) { bool compressed; |