libsquashfs  1.3.2
A new set of tools and libraries for working with SquashFS images
block.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-3.0-or-later */
2 /*
3  * block.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_BLOCK_H
21 #define SQFS_BLOCK_H
22 
23 #include "sqfs/predef.h"
24 
31 #define SQFS_META_BLOCK_SIZE 8192
32 
33 #define SQFS_IS_BLOCK_COMPRESSED(size) (((size) & (1 << 24)) == 0)
34 #define SQFS_ON_DISK_BLOCK_SIZE(size) ((size) & ((1 << 24) - 1))
35 #define SQFS_IS_SPARSE_BLOCK(size) (SQFS_ON_DISK_BLOCK_SIZE(size) == 0)
36 
46  sqfs_u64 start_offset;
47 
51  sqfs_u32 size;
52 
56  sqfs_u32 pad0;
57 };
58 
65 typedef enum {
73 
80  SQFS_BLK_ALIGN = 0x0002,
81 
90 
98 
106 
111 
117 
123 
129 
135 
141 
147 
152 
153  SQFS_BLK_FLAGS_ALL = 0xFC3F,
155 
156 #endif /* SQFS_BLOCK_H */
Set by the sqfs_block_processor_t if it determines a block of a file to be sparse, i.e. only zero bytes.
Definition: block.h:116
sqfs_u64 start_offset
Location of the fragment block on-disk.
Definition: block.h:46
Set by the sqfs_block_processor_t on fragment blocks that it generates.
Definition: block.h:140
Set by sqfs_block_processor_t if the block was actually compressed.
Definition: block.h:146
sqfs_u32 pad0
Unused. Always initialize this to 0.
Definition: block.h:56
Only calculate checksum, do NOT compress the data.
Definition: block.h:72
SQFS_BLK_FLAGS
Generic flags that tell the processor what to do with a block and flags that the processor sets when ...
Definition: block.h:65
Don&#39;t compute block data checksums.
Definition: block.h:110
Set by the sqfs_block_processor_t on the last block of a file.
Definition: block.h:128
Don&#39;t add the tail end of a file to a fragment block.
Definition: block.h:89
Set by the sqfs_block_processor_t on the first block of a file.
Definition: block.h:122
Supress sparse block detection.
Definition: block.h:105
The combination of all flags that are user settable.
Definition: block.h:151
Data structure that makes up the fragment table entries.
Definition: block.h:42
Surpress deduplication.
Definition: block.h:97
sqfs_u32 size
Size of the fragment block in bytes.
Definition: block.h:51
Set by the sqfs_block_processor_t to indicate that a block is a tail end of a file and the block...
Definition: block.h:134
Includes forward declarations of data structures, macros and integer types.
Align the block on disk to device block size.
Definition: block.h:80