summaryrefslogtreecommitdiff
path: root/include/meta_reader.h
blob: 4c03996c91a90a69bcf6d77d98eaafc2e46395e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* SPDX-License-Identifier: GPL-3.0-or-later */
#ifndef META_READER_H
#define META_READER_H

#include "compress.h"
#include "squashfs.h"

typedef struct {
	uint64_t block_offset;
	uint64_t next_block;
	size_t offset;
	int fd;
	compressor_t *cmp;
	uint8_t data[SQFS_META_BLOCK_SIZE];
} meta_reader_t;

meta_reader_t *meta_reader_create(int fd, compressor_t *cmp);

void meta_reader_destroy(meta_reader_t *m);

int meta_reader_seek(meta_reader_t *m, uint64_t block_start,
		     size_t offset);

int meta_reader_read(meta_reader_t *m, void *data, size_t size);

#endif /* META_READER_H */