libsqsh v1.5.1
Loading...
Searching...
No Matches
sqsh_xattr.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_XATTR_H
35#define SQSH_XATTR_H
36
37#include "sqsh_common.h"
38#include "sqsh_data.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44struct SqshFile;
45
46/***************************************
47 * xattr/xattr_iterator.c
48 */
49
51
62sqsh_xattr_iterator_new(const struct SqshFile *file, int *err);
63
77sqsh_xattr_iterator_next(struct SqshXattrIterator *iterator, int *err);
78
87uint16_t sqsh_xattr_iterator_type(const struct SqshXattrIterator *iterator);
88
98
116const char *
118
127uint16_t
129
142const char *sqsh_xattr_iterator_name(const struct SqshXattrIterator *iterator);
143
152uint16_t
154
165 struct SqshXattrIterator *iterator, const char *name);
166
180 const struct SqshXattrIterator *iterator, const char *name);
181
195SQSH_NO_UNUSED char *
197
212SQSH_NO_UNUSED char *
214
230const char *sqsh_xattr_iterator_value(const struct SqshXattrIterator *iterator);
231
240uint32_t
242
252__attribute__((deprecated(
253 "Since 1.3.0. Use sqsh_xattr_iterator_value_size2() instead.")))
254uint16_t
256
266
267#ifdef __cplusplus
268}
269#endif
270#endif /* SQSH_XATTR_H */
#define SQSH_NO_UNUSED
Warn if return value is unused.
Definition sqsh_common.h:59
The Inode context.
An iterator over extended attributes.
int sqsh_xattr_iterator_free(struct SqshXattrIterator *iterator)
Frees the resources used by an xattr iterator.
uint32_t sqsh_xattr_iterator_value_size2(const struct SqshXattrIterator *iterator)
Retrieves the size of the value of the current xattr.
SQSH_NO_UNUSED char * sqsh_xattr_iterator_value_dup(const struct SqshXattrIterator *iterator)
creates a heap allocated copy of the value of the current entry.
SQSH_NO_UNUSED struct SqshXattrIterator * sqsh_xattr_iterator_new(const struct SqshFile *file, int *err)
Allocates and initializes a new xattr iterator.
uint16_t sqsh_xattr_iterator_name_size(const struct SqshXattrIterator *iterator)
Retrieves the size of the name of the current xattr.
uint16_t sqsh_xattr_iterator_type(const struct SqshXattrIterator *iterator)
Retrieves the type of the current xattr.
const char * sqsh_xattr_iterator_prefix(const struct SqshXattrIterator *iterator)
Retrieves the prefix of the current xattr.
const char * sqsh_xattr_iterator_value(const struct SqshXattrIterator *iterator)
Retrieves the value of the current xattr.
SQSH_NO_UNUSED char * sqsh_xattr_iterator_fullname_dup(const struct SqshXattrIterator *iterator)
creates a heap allocated copy of the full name of the current entry.
uint16_t sqsh_xattr_iterator_value_size(const struct SqshXattrIterator *iterator)
Retrieves the size of the value of the current xattr.
SQSH_NO_UNUSED int sqsh_xattr_iterator_fullname_cmp(const struct SqshXattrIterator *iterator, const char *name)
Compares the full name of the current xattr with a given 0-terminated name.
SQSH_NO_UNUSED int sqsh_xattr_iterator_lookup(struct SqshXattrIterator *iterator, const char *name)
Looks up an xattr by name.
const char * sqsh_xattr_iterator_name(const struct SqshXattrIterator *iterator)
Retrieves the name of the current xattr excluding the prefix.
bool sqsh_xattr_iterator_is_indirect(const struct SqshXattrIterator *iterator)
Checks if the current xattr is indirect.
SQSH_NO_UNUSED bool sqsh_xattr_iterator_next(struct SqshXattrIterator *iterator, int *err)
Advances the iterator to the next xattr.
uint16_t sqsh_xattr_iterator_prefix_size(const struct SqshXattrIterator *iterator)
Retrieves the size of the prefix of the current xattr.