dpkg 1.22.7-3-g89f48
|
Data Structures | |
struct | treewalk_funcs |
Macros | |
#define | TREEWALK_OBJECT (struct treewalk_funcs){ 0 } |
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) |
Functions | |
struct treeroot * | treewalk_open (const char *rootdir, enum treewalk_options options, const struct treewalk_funcs *funcs) |
Open a new tree to be walked. | |
struct treenode * | treewalk_node (struct treeroot *tree) |
Return the current node. | |
struct treenode * | treewalk_next (struct treeroot *tree) |
Return the next node. | |
void | treewalk_close (struct treeroot *tree) |
Closes the tree being walked. | |
int | treewalk (const char *rootdir, enum treewalk_options options, struct treewalk_funcs *funcs) |
Tree walker. | |
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) |
Variables | |
enum DPKG_ATTR_ENUM_FLAGS | treewalk_options |
#define TREEWALK_OBJECT (struct treewalk_funcs){ 0 } |
typedef bool treenode_skip_func(struct treenode *node) |
typedef int treenode_sort_func(struct treenode *node) |
typedef int treenode_visit_func(struct treenode *node) |
mode_t treenode_get_mode | ( | struct treenode * | node | ) |
References treenode::mode.
Referenced by archivefiles().
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.
Referenced by archivefiles().
struct stat * treenode_get_stat | ( | struct treenode * | node | ) |
References treenode::stat.
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_close(), 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.
Referenced by archivefiles(), and treewalk().
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::curdir, treeroot::curnode, treenode::down, treenode::next, treeroot::rootnode, treenode::stat, and treenode::up.
Referenced by archivefiles(), and 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::curdir, treeroot::func, m_malloc(), ohshit(), treeroot::options, treeroot::rootnode, and TREEWALK_OBJECT.
Referenced by archivefiles(), and treewalk().
enum DPKG_ATTR_ENUM_FLAGS treewalk_options |