libsquashfs  1.3.2
A new set of tools and libraries for working with SquashFS images
data_reader.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-3.0-or-later */
2 /*
3  * data_reader.h - This file is part of libsquashfs
4  *
5  * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License as published
9  * by the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 #ifndef SQFS_DATA_READER_H
21 #define SQFS_DATA_READER_H
22 
23 #include "sqfs/predef.h"
24 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
71  size_t block_size,
72  sqfs_compressor_t *cmp,
73  sqfs_u32 flags);
74 
86  const sqfs_super_t *super);
87 
102  const sqfs_inode_generic_t *inode,
103  size_t *size, sqfs_u8 **out);
104 
120  const sqfs_inode_generic_t *inode,
121  size_t index, size_t *size,
122  sqfs_u8 **out);
123 
143 SQFS_API sqfs_s32 sqfs_data_reader_read(sqfs_data_reader_t *data,
144  const sqfs_inode_generic_t *inode,
145  sqfs_u64 offset, void *buffer,
146  sqfs_u32 size);
147 
148 #ifdef __cplusplus
149 }
150 #endif
151 
152 #endif /* SQFS_DATA_READER_H */
Encapsultes a compressor with a simple interface to compress or extract chunks of data...
Definition: compressor.h:40
The SquashFS super block, located at the beginning of the file system to describe the layout of the f...
Definition: super.h:47
Abstracts file I/O to make it easy to embedd SquashFS.
Definition: io.h:94
SQFS_API int sqfs_data_reader_get_fragment(sqfs_data_reader_t *data, const sqfs_inode_generic_t *inode, size_t *size, sqfs_u8 **out)
Get the tail end of a file.
Abstracts access to data blocks stored in a SquashFS image.
SQFS_API int sqfs_data_reader_get_block(sqfs_data_reader_t *data, const sqfs_inode_generic_t *inode, size_t index, size_t *size, sqfs_u8 **out)
Get a full sized data block of a file by block index.
SQFS_API sqfs_data_reader_t * sqfs_data_reader_create(sqfs_file_t *file, size_t block_size, sqfs_compressor_t *cmp, sqfs_u32 flags)
Create a data reader instance.
SQFS_API sqfs_s32 sqfs_data_reader_read(sqfs_data_reader_t *data, const sqfs_inode_generic_t *inode, sqfs_u64 offset, void *buffer, sqfs_u32 size)
A simple UNIX-read-like function to read data from a file.
Includes forward declarations of data structures, macros and integer types.
SQFS_API int sqfs_data_reader_load_fragment_table(sqfs_data_reader_t *data, const sqfs_super_t *super)
Read and decode the fragment table from disk.
A generic inode structure that combines all others and provides additional information.
Definition: inode.h:488