aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-12-31 14:38:13 -0600
committerRob Landley <rob@landley.net>2012-12-31 14:38:13 -0600
commit090c5c607ec682e5cfc03bbc745cd1ed28d5d6ce (patch)
treeb20960158a610080d44ac64cf6da3d7eded3e9b0
parentef2af2e4d6ddb25cc9b17167e9db5a49b1265abe (diff)
downloadtoybox-090c5c607ec682e5cfc03bbc745cd1ed28d5d6ce.tar.gz
Make dirtree_handle_callback() start with dirtree_ like the rest of the dirtree functions.
-rw-r--r--lib/dirtree.c8
-rw-r--r--lib/lib.h2
-rw-r--r--toys/posix/chgrp.c2
-rw-r--r--toys/posix/du.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/dirtree.c b/lib/dirtree.c
index c9660fc7..e119c5d1 100644
--- a/lib/dirtree.c
+++ b/lib/dirtree.c
@@ -22,7 +22,7 @@ int dirtree_notdotdot(struct dirtree *catch)
// 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)
@@ -102,7 +102,7 @@ int dirtree_parentfd(struct dirtree *node)
// 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);
@@ -154,7 +154,7 @@ void dirtree_recurse(struct dirtree *node,
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;
@@ -176,5 +176,5 @@ struct dirtree *dirtree_read(char *path, int (*callback)(struct dirtree *node))
{
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;
}
diff --git a/lib/lib.h b/lib/lib.h
index 17aaea25..d3d15b81 100644
--- a/lib/lib.h
+++ b/lib/lib.h
@@ -74,7 +74,7 @@ struct dirtree *dirtree_add_node(struct dirtree *p, char *name, int symfollow);
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);
diff --git a/toys/posix/chgrp.c b/toys/posix/chgrp.c
index 802d8f8f..6e1e16f0 100644
--- a/toys/posix/chgrp.c
+++ b/toys/posix/chgrp.c
@@ -104,7 +104,7 @@ void chgrp_main(void)
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;
}
diff --git a/toys/posix/du.c b/toys/posix/du.c
index 6c09aec6..5dc3ee5c 100644
--- a/toys/posix/du.c
+++ b/toys/posix/du.c
@@ -206,7 +206,7 @@ void du_main(void)
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++;
}