13main(
int argc,
char *argv[]) {
16 printf(
"Usage: %s <sqsh-file> <path>\n", argv[0]);
24 .mapper_block_size = 0,
26 .metablock_lru_size = 0,
29 .max_symlink_depth = 0,
33 if (error_code != 0) {
38 if (error_code != 0) {
45 if (error_code != 0) {
58 printf(
"%.*s%.*s=%.*s\n", (
int)prefix_size, prefix, (
int)name_size,
59 name, (
int)value_size, value);
62 sqsh_perror(error_code,
"sqsh_xattr_iterator_next");
68 sqsh_archive_close(archive);
int main(int argc, char *argv[])
void sqsh_perror(int error_code, const char *msg)
Print the error message for the given error code.
const struct SqshMemoryMapperImpl *const sqsh_mapper_impl_mmap
a mapper that uses mmap to map the file into memory.
SQSH_NO_UNUSED struct SqshArchive * sqsh_archive_open(const void *source, const struct SqshConfig *config, int *err)
initializes a archive context in heap.
The SqshConfig struct contains all the configuration options for a sqsh session.
const struct SqshMemoryMapperImpl * source_mapper
source_mapper is the memory mapper implementation that will be used to map the archive.
SQSH_NO_UNUSED struct SqshFile * sqsh_open(struct SqshArchive *archive, const char *path, int *err)
Initialize the file context from a path.
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 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.
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.
const char * sqsh_xattr_iterator_name(const struct SqshXattrIterator *iterator)
Retrieves the name of the current xattr excluding the prefix.
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.