libsquashfs 1.3.0
A new set of tools and libraries for working with SquashFS images
Loading...
Searching...
No Matches
meta_writer.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-3.0-or-later */
2/*
3 * meta_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_META_WRITER_H
21#define SQFS_META_WRITER_H
22
23#include "sqfs/predef.h"
24
58typedef enum {
66
67 SQFS_META_WRITER_ALL_FLAGS = 0x01,
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
92 sqfs_u32 flags);
93
109
126SQFS_API int sqfs_meta_writer_append(sqfs_meta_writer_t *m, const void *data,
127 size_t size);
128
145 sqfs_u64 *block_start,
146 sqfs_u32 *offset);
147
160
173
190 const sqfs_inode_generic_t *n);
191
192#ifdef __cplusplus
193}
194#endif
195
196#endif /* SQFS_META_WRITER_H */
SQFS_META_WRITER_FLAGS
Possible flags for sqfs_meta_writer_create.
Definition: meta_writer.h:58
@ SQFS_META_WRITER_KEEP_IN_MEMORY
If set, keep finished blocks in memory.
Definition: meta_writer.h:65
Includes forward declarations of data structures, macros and integer types.
Encapsultes a compressor with a simple interface to compress or extract chunks of data.
Definition: compressor.h:40
Abstracts file I/O to make it easy to embedd SquashFS.
Definition: io.h:94
A generic inode structure that combines all others and provides additional information.
Definition: inode.h:488
Abstracts generating of meta data blocks, either in memory or directly on disk.
SQFS_API void sqfs_meta_writer_get_position(const sqfs_meta_writer_t *m, sqfs_u64 *block_start, sqfs_u32 *offset)
Query the current block start position and offset within the block.
SQFS_API sqfs_meta_writer_t * sqfs_meta_writer_create(sqfs_file_t *file, sqfs_compressor_t *cmp, sqfs_u32 flags)
Create a meta data writer.
SQFS_API int sqfs_meta_writer_write_inode(sqfs_meta_writer_t *iw, const sqfs_inode_generic_t *n)
A convenience function for encoding and writing an inode.
SQFS_API int sqfs_meta_writer_append(sqfs_meta_writer_t *m, const void *data, size_t size)
Finish the current block, even if it isn't full yet.
SQFS_API int sqfs_meta_writer_flush(sqfs_meta_writer_t *m)
Finish the current block, even if it isn't full yet.
SQFS_API int sqfs_meta_write_write_to_file(sqfs_meta_writer_t *m)
Write all blocks collected in memory to disk.
SQFS_API void sqfs_meta_writer_reset(sqfs_meta_writer_t *m)
Reset all internal state, including the current block start position.