34#ifndef SQSH_DIRECTORY_H
35#define SQSH_DIRECTORY_H
88 const size_t name_len);
99__attribute__((deprecated(
"Since 1.3.0. Use sqsh_directory_iterator_name2() "
100 "instead"))) uint16_t
124 "instead"))) uint64_t
193 "instead"))) const
char *
#define SQSH_NO_UNUSED
Warn if return value is unused.
SqshFileType
enum that represents the file type.
uint32_t sqsh_directory_iterator_inode(const struct SqshDirectoryIterator *iterator)
Retrieves the inode number of the current entry.
SQSH_NO_UNUSED struct SqshDirectoryIterator * sqsh_directory_iterator_new(const struct SqshFile *file, int *err)
Allocates and initializes a new directory iterator.
uint64_t sqsh_directory_iterator_inode_ref(const struct SqshDirectoryIterator *iterator)
Retrieves the inode reference of the current entry.
SQSH_NO_UNUSED int sqsh_directory_iterator_lookup(struct SqshDirectoryIterator *iterator, const char *name, const size_t name_len)
Looks up an entry by name.
int sqsh_directory_iterator_free(struct SqshDirectoryIterator *iterator)
Frees the resources used by a directory iterator.
uint16_t sqsh_directory_iterator_name_size(const struct SqshDirectoryIterator *iterator)
Retrieves the size of the name of the current entry.
enum SqshFileType sqsh_directory_iterator_file_type(const struct SqshDirectoryIterator *iterator)
Retrieves the inode type of the current entry.
SQSH_NO_UNUSED char * sqsh_directory_iterator_name_dup(const struct SqshDirectoryIterator *iterator)
creates a heap allocated copy of the name of the current entry.
SQSH_NO_UNUSED struct SqshFile * sqsh_directory_iterator_open_file(const struct SqshDirectoryIterator *iterator, int *err)
Loads the inode of the current entry.
uint64_t sqsh_directory_iterator_inode_number(const struct SqshDirectoryIterator *iterator)
Retrieves the inode number of the current entry.
const char * sqsh_directory_iterator_name(const struct SqshDirectoryIterator *iterator)
Retrieves the name of the current entry.
SQSH_NO_UNUSED bool sqsh_directory_iterator_next(struct SqshDirectoryIterator *iterator, int *err)
Advances the iterator to the next entry.
const char * sqsh_directory_iterator_name2(const struct SqshDirectoryIterator *iterator, size_t *len)
Retrieves the name of the current entry.