20#ifndef SQFS_DIR_READER_H
21#define SQFS_DIR_READER_H
105 SQFS_TREE_ALL_FLAGS = 0x7F,
173 SQFS_DIR_READER_ALL_FLAGS = 0x00000001,
193 SQFS_DIR_OPEN_ALL_FLAGS = 0x00000001,
SQFS_DIR_READER_FLAGS
Flags for sqfs_dir_reader_create.
@ SQFS_DIR_READER_DOT_ENTRIES
Support "." and ".." directory and path entries.
SQFS_TREE_FILTER_FLAGS
Filter flags for sqfs_dir_reader_get_full_hierarchy.
@ SQFS_TREE_STORE_PARENTS
Store the list of parent nodes all the way to the target node.
@ SQFS_TREE_NO_SLINKS
Omit symbolic links from the final tree.
@ SQFS_TREE_NO_EMPTY
Omit empty directories from the final tree.
@ SQFS_TREE_NO_FIFO
Omit named pipes from the final tree.
@ SQFS_TREE_NO_SOCKETS
Omit socket files from the final tree.
@ SQFS_TREE_NO_DEVICES
Omit device special files from the final tree.
@ SQFS_TREE_NO_RECURSE
Do not recurse into sub directories.
SQFS_API void sqfs_dir_tree_destroy(sqfs_tree_node_t *root)
Recursively destroy a tree of sqfs_tree_node_t nodes.
SQFS_DIR_OPEN_FLAGS
Flags for sqfs_dir_reader_open_dir.
@ SQFS_DIR_OPEN_NO_DOT_ENTRIES
Do not generate "." and ".." entries.
Includes forward declarations of data structures, macros and integer types.
Encapsultes a compressor with a simple interface to compress or extract chunks of data.
On-disk data structure of a directory entry. Many of these follow a single sqfs_dir_header_t.
Abstracts reading of directory entries.
SQFS_API int sqfs_dir_reader_open_dir(sqfs_dir_reader_t *rd, const sqfs_inode_generic_t *inode, sqfs_u32 flags)
Navigate a directory reader to the location of a directory represented by an inode.
SQFS_API int sqfs_dir_reader_find_by_path(sqfs_dir_reader_t *rd, const sqfs_inode_generic_t *start, const char *path, sqfs_inode_generic_t **out)
Find an inode through path traversal starting from the root or a given node downwards.
SQFS_API int sqfs_dir_reader_get_full_hierarchy(sqfs_dir_reader_t *rd, const sqfs_id_table_t *idtbl, const char *path, sqfs_u32 flags, sqfs_tree_node_t **out)
High level helper function for deserializing the entire file system hierarchy into an in-memory tree ...
SQFS_API int sqfs_dir_reader_rewind(sqfs_dir_reader_t *rd)
Reset a directory reader back to the beginning of the listing.
SQFS_API int sqfs_dir_reader_find(sqfs_dir_reader_t *rd, const char *name)
Seek through the current directory listing to locate an entry by name.
SQFS_API int sqfs_dir_reader_read(sqfs_dir_reader_t *rd, sqfs_dir_entry_t **out)
Read a directory entry and advance the internal position indicator to the next one.
SQFS_API int sqfs_dir_reader_get_root_inode(sqfs_dir_reader_t *rd, sqfs_inode_generic_t **inode)
Read the root inode using the location given by the super block.
SQFS_API int sqfs_dir_reader_get_inode(sqfs_dir_reader_t *rd, sqfs_inode_generic_t **inode)
Read the inode that the current directory entry points to.
SQFS_API sqfs_dir_reader_t * sqfs_dir_reader_create(const sqfs_super_t *super, sqfs_compressor_t *cmp, sqfs_file_t *file, sqfs_u32 flags)
Create a directory reader.
Abstracts file I/O to make it easy to embedd SquashFS.
A simple data structure that encapsulates ID to index mapping for user and group IDs.
A generic inode structure that combines all others and provides additional information.
The SquashFS super block, located at the beginning of the file system to describe the layout of the f...
Encapsulates a node in the filesystem tree read by sqfs_dir_reader_get_full_hierarchy.
sqfs_tree_node_t * parent
Pointer to parent, NULL for the root node.
sqfs_tree_node_t * children
For directories, a linked list of children.
sqfs_inode_generic_t * inode
Inode representing this element in the tree.
sqfs_u8 name[]
null-terminated entry name.
sqfs_u32 uid
Resolved 32 bit user ID from the inode.
SQFS_API int sqfs_tree_node_get_path(const sqfs_tree_node_t *node, char **out)
Recursively destroy a tree of sqfs_tree_node_t nodes.
sqfs_tree_node_t * next
Linked list next pointer for children list.
sqfs_u32 gid
Resolved 32 bit group ID from the inode.