// Create a dirtree node from a path, with stat and symlink info.
// (This doesn't open directory filehandles yet so as not to exhaust the
-// filehandle space on large trees. handle_callback() does that instead.)
+// filehandle space on large trees, dirtree_handle_callback() does that.)
struct dirtree *dirtree_add_node(struct dirtree *parent, char *name,
int symfollow)
// hit, free structures after use, and return NULL.
//
-struct dirtree *handle_callback(struct dirtree *new,
+struct dirtree *dirtree_handle_callback(struct dirtree *new,
int (*callback)(struct dirtree *node))
{
int flags, dir = S_ISDIR(new->st.st_mode);
while ((entry = readdir(dir))) {
if (!(new = dirtree_add_node(node, entry->d_name, symfollow)))
continue;
- new = handle_callback(new, callback);
+ new = dirtree_handle_callback(new, callback);
if (new == DIRTREE_ABORTVAL) break;
if (new) {
*ddt = new;
{
struct dirtree *root = dirtree_add_node(0, path, 0);
- return root ? handle_callback(root, callback) : DIRTREE_ABORTVAL;
+ return root ? dirtree_handle_callback(root, callback) : DIRTREE_ABORTVAL;
}
char *dirtree_path(struct dirtree *node, int *plen);
int dirtree_notdotdot(struct dirtree *catch);
int dirtree_parentfd(struct dirtree *node);
-struct dirtree *handle_callback(struct dirtree *new,
+struct dirtree *dirtree_handle_callback(struct dirtree *new,
int (*callback)(struct dirtree *node));
void dirtree_recurse(struct dirtree *node,
int (*callback)(struct dirtree *node), int symfollow);
for (s=toys.optargs+1; *s; s++) {
struct dirtree *new = dirtree_add_node(0, *s, hl);
- if (new) handle_callback(new, do_chgrp);
+ if (new) dirtree_handle_callback(new, do_chgrp);
else toys.exitval = 1;
}
struct dirtree *root = dirtree_add_node(0, path, symfollow);
if(root) {
TT.st_dev = root->st.st_dev;
- handle_callback(root, do_du); //this will recurse thru the DIR children.
+ dirtree_handle_callback(root, do_du); // recurse thru the DIR children.
}
toys.optargs++;
}