libsqsh v1.5.1
Loading...
Searching...
No Matches
sqsh_directory_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_ITERATOR_PRIVATE_H
35#define SQSH_ITERATOR_PRIVATE_H
36
37#include "sqsh_directory.h"
38
39#include "sqsh_file_private.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46/***************************************
47 * directory/directory_iterator.c
48 */
49
57 const struct SqshFile *file;
58 uint32_t remaining_size;
59
60 struct SqshMetablockReader metablock;
61 size_t remaining_entries;
62 sqsh_index_t next_offset;
63 uint32_t current_inode;
64
65 uint32_t start_base;
66 uint32_t inode_base;
67};
68
80 struct SqshDirectoryIterator *iterator, const struct SqshFile *inode);
81
93
94/***************************************
95 * inode/directory_index_iterator.c
96 */
97
105 struct SqshFile file;
106 size_t remaining_entries;
107 sqsh_index_t next_offset;
108};
109
123 struct SqshDirectoryIndexIterator *iterator, struct SqshArchive *sqsh,
124 uint64_t inode_ref);
125
139 struct SqshDirectoryIndexIterator *iterator, int *err);
140
151 const struct SqshDirectoryIndexIterator *iterator);
152
163 const struct SqshDirectoryIndexIterator *iterator);
164
175 const struct SqshDirectoryIndexIterator *iterator);
176
187 const struct SqshDirectoryIndexIterator *iterator);
188
199 struct SqshDirectoryIndexIterator *iterator);
200
201#ifdef __cplusplus
202}
203#endif
204#endif /* SQSH_ITERATOR_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 uint32_t sqsh__directory_index_iterator_start(const struct SqshDirectoryIndexIterator *iterator)
SQSH_NO_EXPORT SQSH_NO_UNUSED bool sqsh__directory_index_iterator_next(struct SqshDirectoryIndexIterator *iterator, int *err)
SQSH_NO_EXPORT int sqsh__directory_index_iterator_cleanup(struct SqshDirectoryIndexIterator *iterator)
SQSH_NO_EXPORT const char * sqsh__directory_index_iterator_name(const struct SqshDirectoryIndexIterator *iterator)
SQSH_NO_EXPORT SQSH_NO_UNUSED int sqsh__directory_iterator_init(struct SqshDirectoryIterator *iterator, const struct SqshFile *inode)
SQSH_NO_EXPORT int sqsh__directory_iterator_cleanup(struct SqshDirectoryIterator *iterator)
SQSH_NO_EXPORT uint32_t sqsh__directory_index_iterator_name_size(const struct SqshDirectoryIndexIterator *iterator)
SQSH_NO_EXPORT uint32_t sqsh__directory_index_iterator_index(const struct SqshDirectoryIndexIterator *iterator)
SQSH_NO_EXPORT SQSH_NO_UNUSED int sqsh__directory_index_iterator_init(struct SqshDirectoryIndexIterator *iterator, struct SqshArchive *sqsh, uint64_t inode_ref)
Iterator for directory indexes.
A directory iterator.
The Inode context.
Reader over metablocks.