libsquashfs 1.3.0
A new set of tools and libraries for working with SquashFS images
Loading...
Searching...
No Matches
dir_reader.h File Reference

Contains declarations for the sqfs_dir_reader_t. More...

#include "sqfs/predef.h"

Go to the source code of this file.

Data Structures

struct  sqfs_tree_node_t
 Encapsulates a node in the filesystem tree read by sqfs_dir_reader_get_full_hierarchy. More...
 

Enumerations

enum  SQFS_TREE_FILTER_FLAGS {
  SQFS_TREE_NO_DEVICES = 0x01 , SQFS_TREE_NO_SOCKETS = 0x02 , SQFS_TREE_NO_FIFO = 0x04 , SQFS_TREE_NO_SLINKS = 0x08 ,
  SQFS_TREE_NO_EMPTY = 0x10 , SQFS_TREE_NO_RECURSE = 0x20 , SQFS_TREE_STORE_PARENTS = 0x40 , SQFS_TREE_ALL_FLAGS = 0x7F
}
 Filter flags for sqfs_dir_reader_get_full_hierarchy. More...
 
enum  SQFS_DIR_READER_FLAGS { SQFS_DIR_READER_DOT_ENTRIES = 0x00000001 , SQFS_DIR_READER_ALL_FLAGS = 0x00000001 }
 Flags for sqfs_dir_reader_create. More...
 
enum  SQFS_DIR_OPEN_FLAGS { SQFS_DIR_OPEN_NO_DOT_ENTRIES = 0x00000001 , SQFS_DIR_OPEN_ALL_FLAGS = 0x00000001 }
 Flags for sqfs_dir_reader_open_dir. More...
 

Functions

SQFS_API void sqfs_dir_tree_destroy (sqfs_tree_node_t *root)
 Recursively destroy a tree of sqfs_tree_node_t nodes.
 

Detailed Description

Contains declarations for the sqfs_dir_reader_t.

Definition in file dir_reader.h.

Enumeration Type Documentation

◆ SQFS_DIR_OPEN_FLAGS

Flags for sqfs_dir_reader_open_dir.

Enumerator
SQFS_DIR_OPEN_NO_DOT_ENTRIES 

Do not generate "." and ".." entries.

If the sqfs_dir_reader_t was created with the SQFS_DIR_READER_DOT_ENTRIES flag set, "." and ".." entries are generated when iterating over a directory. If that is not desired in some instances, this flag can be set to suppress this behaviour when opening a directory.

Definition at line 181 of file dir_reader.h.

◆ SQFS_DIR_READER_FLAGS

Flags for sqfs_dir_reader_create.

Enumerator
SQFS_DIR_READER_DOT_ENTRIES 

Support "." and ".." directory and path entries.

If this flag is set, the directory reader returns "." and ".." entries when iterating over a directory, can fetch the associated inodes if requested and supports resolving "." and ".." path components when looking up a full path.

In order for this to work, it internally caches the locations of directory inodes it encounteres. This means, it only works as long as you only use inodes fetched through the directory reader. If given a foreign inode it hasn't seen before, it might not be able to resolve the parent link.

Definition at line 156 of file dir_reader.h.

◆ SQFS_TREE_FILTER_FLAGS

Filter flags for sqfs_dir_reader_get_full_hierarchy.

Enumerator
SQFS_TREE_NO_DEVICES 

Omit device special files from the final tree.

SQFS_TREE_NO_SOCKETS 

Omit socket files from the final tree.

SQFS_TREE_NO_FIFO 

Omit named pipes from the final tree.

SQFS_TREE_NO_SLINKS 

Omit symbolic links from the final tree.

SQFS_TREE_NO_EMPTY 

Omit empty directories from the final tree.

If a directory is not empty on-disk, but ends up empty after applying all the other filter rules, it is also omitted.

SQFS_TREE_NO_RECURSE 

Do not recurse into sub directories.

If the start node is a directory, the tree deserializer will still recurse into it, but it will not go beyond that.

SQFS_TREE_STORE_PARENTS 

Store the list of parent nodes all the way to the target node.

When traversing towards the selected node, also collect the chain of parent nodes with the subtree stored at the end.

Definition at line 60 of file dir_reader.h.

Function Documentation

◆ sqfs_dir_tree_destroy()

SQFS_API void sqfs_dir_tree_destroy ( sqfs_tree_node_t root)

Recursively destroy a tree of sqfs_tree_node_t nodes.

This function can be used to clean up after sqfs_dir_reader_get_full_hierarchy.

Parameters
rootA pointer to the root node or NULL.
Examples
list_files.c.