libsquashfs  1.3.2
A new set of tools and libraries for working with SquashFS images
block_writer.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-3.0-or-later */
2 /*
3  * block_writer.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_WRITER_H
21 #define SQFS_BLOCK_WRITER_H
22 
23 #include "sqfs/predef.h"
24 
43  sqfs_object_t base;
44 
76  int (*write_data_block)(sqfs_block_writer_t *wr, void *user,
77  sqfs_u32 size, sqfs_u32 checksum,
78  sqfs_u32 flags, const sqfs_u8 *data,
79  sqfs_u64 *location);
80 
90  sqfs_u64 (*get_block_count)(const sqfs_block_writer_t *wr);
91 };
92 
98 typedef enum {
112 
118 
119 #ifdef __cplusplus
120 extern "C" {
121 #endif
122 
137  size_t devblksz,
138  sqfs_u32 flags);
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif /* SQFS_BLOCK_WRITER_H */
A combination of all valid flags.
Definition: block_writer.h:116
Abstracts file I/O to make it easy to embedd SquashFS.
Definition: io.h:94
sqfs_u64(* get_block_count)(const sqfs_block_writer_t *wr)
Get the number of blocks actually written to disk.
Definition: block_writer.h:90
If set, only compare checksums when deduplicating blocks.
Definition: block_writer.h:111
Base interface for all libsquashfs in-memory data structures.
Definition: predef.h:126
SQFS_BLOCK_WRITER_FLAGS
Flags that can be passed to sqfs_block_writer_create.
Definition: block_writer.h:98
int(* write_data_block)(sqfs_block_writer_t *wr, void *user, sqfs_u32 size, sqfs_u32 checksum, sqfs_u32 flags, const sqfs_u8 *data, sqfs_u64 *location)
Submit a data block to a block writer.
Definition: block_writer.h:76
Abstracts writing and deduplicating of data and fragment blocks.
Definition: block_writer.h:42
SQFS_API sqfs_block_writer_t * sqfs_block_writer_create(sqfs_file_t *file, size_t devblksz, sqfs_u32 flags)
Create an instance of a default block writer implementation.
Includes forward declarations of data structures, macros and integer types.