libsqsh v1.5.1
Loading...
Searching...
No Matches
sqsh_table_private.h
Go to the documentation of this file.
1/******************************************************************************
2 * *
3 * Copyright (c) 2023-2024, Enno Boland <g@s01.de> *
4 * *
5 * Redistribution and use in source and binary forms, with or without *
6 * modification, are permitted provided that the following conditions are *
7 * met: *
8 * *
9 * * Redistributions of source code must retain the above copyright notice, *
10 * this list of conditions and the following disclaimer. *
11 * * Redistributions in binary form must reproduce the above copyright *
12 * notice, this list of conditions and the following disclaimer in the *
13 * documentation and/or other materials provided with the distribution. *
14 * *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS *
16 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, *
17 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR *
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
23 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
24 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26 * *
27 ******************************************************************************/
28
34#ifndef SQSH_TABLE_PRIVATE_H
35#define SQSH_TABLE_PRIVATE_H
36
38#include "sqsh_mapper_private.h"
39#include "sqsh_table.h"
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45struct SqshFile;
46struct SqshDataFragment;
47struct SqshDataXattrLookupTable;
48
49/***************************************
50 * table/table.c
51 */
52
56struct SqshTable {
60 struct SqshArchive *sqsh;
61 struct SqshMapper *mapper;
62 struct SqshMapReader lookup_table;
63 uint64_t start_block;
64 size_t element_size;
65 size_t element_count;
66};
67
82 struct SqshTable *table, struct SqshArchive *sqsh, uint64_t start_block,
83 size_t element_size, size_t element_count);
84
95
96/***************************************
97 * table/id_table.c
98 */
99
107 struct SqshTable table;
108};
109
121sqsh__id_table_init(struct SqshIdTable *table, struct SqshArchive *sqsh);
122
133
134/***************************************
135 * table/export_table.c
136 */
137
145 struct SqshTable table;
146};
147
159 struct SqshExportTable *table, struct SqshArchive *sqsh);
160
171
172/***************************************
173 * file/fragment_table.c
174 */
175
183 struct SqshTable table;
184 struct SqshExtractManager extract_manager;
185};
186
198 struct SqshFragmentTable *table, struct SqshArchive *sqsh);
199
213 const struct SqshFragmentTable *table, const struct SqshFile *inode,
214 struct SqshDataFragment *fragment);
215
227
228/***************************************
229 * table/xattr_table.c
230 */
231
239 struct SqshMapReader header;
240 struct SqshTable table;
241};
242
252
266 const struct SqshXattrTable *table, sqsh_index_t index,
267 struct SqshDataXattrLookupTable *target);
268
269#ifdef __cplusplus
270}
271#endif
272#endif /* SQSH_TABLE_PRIVATE_H */
#define SQSH_NO_EXPORT
Do not export symbol.
Definition sqsh_common.h:64
#define SQSH_NO_UNUSED
Warn if return value is unused.
Definition sqsh_common.h:59
size_t sqsh_index_t
typedef used for indexing
Definition sqsh_common.h:69
SQSH_NO_EXPORT int sqsh__export_table_init(struct SqshExportTable *table, struct SqshArchive *sqsh)
SQSH_NO_EXPORT int sqsh__table_cleanup(struct SqshTable *table)
SQSH_NO_EXPORT SQSH_NO_UNUSED int sqsh__table_init(struct SqshTable *table, struct SqshArchive *sqsh, uint64_t start_block, size_t element_size, size_t element_count)
SQSH_NO_EXPORT int sqsh__id_table_cleanup(struct SqshIdTable *table)
SQSH_NO_EXPORT int sqsh__export_table_cleanup(struct SqshExportTable *table)
SQSH_NO_EXPORT int sqsh__fragment_table_get(const struct SqshFragmentTable *table, const struct SqshFile *inode, struct SqshDataFragment *fragment)
SQSH_NO_EXPORT int sqsh__id_table_init(struct SqshIdTable *table, struct SqshArchive *sqsh)
SQSH_NO_EXPORT SQSH_NO_UNUSED int sqsh__fragment_table_init(struct SqshFragmentTable *table, struct SqshArchive *sqsh)
SQSH_NO_EXPORT int sqsh__fragment_table_cleanup(struct SqshFragmentTable *table)
The export table.
Manages chunks of compressed areas from an archive.
The Inode context.
The fragment table of an archive.
The id table of an archive.
A reader over a mapping of data.
The mapper that is used to map chunks of the archive into memory.
A generic table as used in an archive.
The extended attribute lookup table.
SQSH_NO_EXPORT SQSH_NO_UNUSED int sqsh__xattr_table_get(const struct SqshXattrTable *table, sqsh_index_t index, struct SqshDataXattrLookupTable *target)
Retrieves an extended attribute from the table.
SQSH_NO_EXPORT uint64_t sqsh__xattr_table_start(struct SqshXattrTable *table)
Retrieves the starting offset of the table.