libsquashfs 1.3.0
A new set of tools and libraries for working with SquashFS images
Loading...
Searching...
No Matches
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
65typedef enum {
73
81
90
98
106
111
117
123
129
135
141
147
152
153 SQFS_BLK_FLAGS_ALL = 0xFC3F,
155
156#endif /* SQFS_BLOCK_H */
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
@ SQFS_BLK_FIRST_BLOCK
Set by the sqfs_block_processor_t on the first block of a file.
Definition: block.h:122
@ SQFS_BLK_USER_SETTABLE_FLAGS
The combination of all flags that are user settable.
Definition: block.h:151
@ SQFS_BLK_IS_COMPRESSED
Set by sqfs_block_processor_t if the block was actually compressed.
Definition: block.h:146
@ SQFS_BLK_IS_FRAGMENT
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
@ SQFS_BLK_FRAGMENT_BLOCK
Set by the sqfs_block_processor_t on fragment blocks that it generates.
Definition: block.h:140
@ SQFS_BLK_DONT_HASH
Don't compute block data checksums.
Definition: block.h:110
@ SQFS_BLK_DONT_COMPRESS
Only calculate checksum, do NOT compress the data.
Definition: block.h:72
@ SQFS_BLK_DONT_FRAGMENT
Don't add the tail end of a file to a fragment block.
Definition: block.h:89
@ SQFS_BLK_IGNORE_SPARSE
Supress sparse block detection.
Definition: block.h:105
@ SQFS_BLK_LAST_BLOCK
Set by the sqfs_block_processor_t on the last block of a file.
Definition: block.h:128
@ SQFS_BLK_IS_SPARSE
Set by the sqfs_block_processor_t if it determines a block of a file to be sparse,...
Definition: block.h:116
@ SQFS_BLK_DONT_DEDUPLICATE
Surpress deduplication.
Definition: block.h:97
@ SQFS_BLK_ALIGN
Align the block on disk to device block size.
Definition: block.h:80
Includes forward declarations of data structures, macros and integer types.
Data structure that makes up the fragment table entries.
Definition: block.h:42
sqfs_u32 size
Size of the fragment block in bytes.
Definition: block.h:51
sqfs_u64 start_offset
Location of the fragment block on-disk.
Definition: block.h:46
sqfs_u32 pad0
Unused. Always initialize this to 0.
Definition: block.h:56