libsquashfs: include/sqfs/block.h Source File

libsquashfs 1.3.2 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
30
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
42 struct sqfs_fragment_t {
46 sqfs_u64 start_offset;
47
51 sqfs_u32 size;
52
56 sqfs_u32 pad0;
57};
58
65 typedef enum {
72 SQFS_BLK_DONT_COMPRESS = 0x0001,
73
80 SQFS_BLK_ALIGN = 0x0002,
81
89 SQFS_BLK_DONT_FRAGMENT = 0x0004,
90
97 SQFS_BLK_DONT_DEDUPLICATE = 0x0008,
98
105 SQFS_BLK_IGNORE_SPARSE = 0x0010,
106
110 SQFS_BLK_DONT_HASH = 0x0020,
111
116 SQFS_BLK_IS_SPARSE = 0x0400,
117
122 SQFS_BLK_FIRST_BLOCK = 0x0800,
123
128 SQFS_BLK_LAST_BLOCK = 0x1000,
129
134 SQFS_BLK_IS_FRAGMENT = 0x2000,
135
140 SQFS_BLK_FRAGMENT_BLOCK = 0x4000,
141
146 SQFS_BLK_IS_COMPRESSED = 0x8000,
147
151 SQFS_BLK_USER_SETTABLE_FLAGS = 0x003F,
152
153 SQFS_BLK_FLAGS_ALL = 0xFC3F,
154} SQFS_BLK_FLAGS;
155
156#endif /* SQFS_BLOCK_H */
SQFS_BLK_FLAGS
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
@ 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
@ SQFS_BLK_USER_SETTABLE_FLAGS
The combination of all flags that are user settable.
Definition block.h:151
SQFS_BLK_IS_COMPRESSED
@ SQFS_BLK_IS_COMPRESSED
Set by sqfs_block_processor_t if the block was actually compressed.
Definition block.h:146
SQFS_BLK_IS_FRAGMENT
@ 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
@ 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
@ SQFS_BLK_DONT_HASH
Don't compute block data checksums.
Definition block.h:110
SQFS_BLK_DONT_COMPRESS
@ SQFS_BLK_DONT_COMPRESS
Only calculate checksum, do NOT compress the data.
Definition block.h:72
SQFS_BLK_DONT_FRAGMENT
@ 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
@ SQFS_BLK_IGNORE_SPARSE
Supress sparse block detection.
Definition block.h:105
SQFS_BLK_LAST_BLOCK
@ 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
@ 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
@ SQFS_BLK_DONT_DEDUPLICATE
Surpress deduplication.
Definition block.h:97
SQFS_BLK_ALIGN
@ SQFS_BLK_ALIGN
Align the block on disk to device block size.
Definition block.h:80
predef.h
Includes forward declarations of data structures, macros and integer types.
sqfs_fragment_t
Data structure that makes up the fragment table entries.
Definition block.h:42
sqfs_fragment_t::size
sqfs_u32 size
Size of the fragment block in bytes.
Definition block.h:51
sqfs_fragment_t::start_offset
sqfs_u64 start_offset
Location of the fragment block on-disk.
Definition block.h:46
sqfs_fragment_t::pad0
sqfs_u32 pad0
Unused. Always initialize this to 0.
Definition block.h:56