dpkg 1.21.11
|
Data Structures | |
struct | treewalk_funcs |
Typedefs | |
typedef int | treenode_visit_func(struct treenode *node) |
typedef bool | treenode_skip_func(struct treenode *node) |
typedef int | treenode_sort_func(struct treenode *node) |
Enumerations | |
enum | treewalk_options { TREEWALK_NONE = 0 , TREEWALK_FORCE_STAT = DPKG_BIT(0) , TREEWALK_FOLLOW_LINKS = DPKG_BIT(1) } |
Functions | |
struct treeroot * | treewalk_open (const char *rootdir, enum treewalk_options options, const struct treewalk_funcs *funcs) |
Open a new tree to be walked. More... | |
struct treenode * | treewalk_node (struct treeroot *tree) |
Return the current node. More... | |
struct treenode * | treewalk_next (struct treeroot *tree) |
Return the next node. More... | |
void | treewalk_close (struct treeroot *tree) |
Closes the tree being walked. More... | |
int | treewalk (const char *rootdir, enum treewalk_options options, struct treewalk_funcs *funcs) |
Tree walker. More... | |
struct treenode * | treenode_get_parent (struct treenode *node) |
const char * | treenode_get_name (struct treenode *node) |
const char * | treenode_get_pathname (struct treenode *node) |
const char * | treenode_get_virtname (struct treenode *node) |
mode_t | treenode_get_mode (struct treenode *node) |
struct stat * | treenode_get_stat (struct treenode *node) |
typedef bool treenode_skip_func(struct treenode *node) |
typedef int treenode_sort_func(struct treenode *node) |
typedef int treenode_visit_func(struct treenode *node) |
enum treewalk_options |
mode_t treenode_get_mode | ( | struct treenode * | node | ) |
References treenode::mode.
const char * treenode_get_name | ( | struct treenode * | node | ) |
References treenode::name.
References treenode::up.
const char * treenode_get_pathname | ( | struct treenode * | node | ) |
References treenode::pathname.
struct stat * treenode_get_stat | ( | struct treenode * | node | ) |
const char * treenode_get_virtname | ( | struct treenode * | node | ) |
References treenode::virtname.
int treewalk | ( | const char * | rootdir, |
enum treewalk_options | options, | ||
struct treewalk_funcs * | func | ||
) |
Tree walker.
rootdir | The root directory to start walking the tree. |
options | The options specifying how to walk the tree. |
func | The function callbacks. |
References treewalk_next(), treewalk_node(), and treewalk_open().
void treewalk_close | ( | struct treeroot * | tree | ) |
Closes the tree being walked.
It will free any resources previously allocated.
Return the next node.
This function works basically as an iterator. And will return NULL when the whole tree has been traversed. When starting it will skip the root node, so you might want to use treewalk_node() to get that, otherwise you could use it like this:
tree | The tree structure. |
References treeroot::curnode, and treeroot::rootnode.
Referenced by treewalk().
Return the current node.
This function is only needed if you want to start walking the tree from the root node. With something like:
tree | The tree structure. |
References treeroot::curnode.
Referenced by treewalk().
struct treeroot * treewalk_open | ( | const char * | rootdir, |
enum treewalk_options | options, | ||
const struct treewalk_funcs * | func | ||
) |
Open a new tree to be walked.
rootdir | The root directory to start walking the tree. |
options | The options specifying how to walk the tree. |
func | The functions callbacks. |
References treeroot::func, m_malloc(), and treeroot::options.
Referenced by treewalk().