summaryrefslogtreecommitdiffstats
path: root/bftw.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-03-31 17:36:30 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-05-28 20:49:54 -0400
commit1cc323eb88242bc7be7177ba4cb037a58c754763 (patch)
treee5d88f0a88ebb0305482f98fbdcfdad518157b76 /bftw.h
parent97ad2f4786b39cb4bf2189350efba4bce42ab6ea (diff)
downloadbfs-1cc323eb88242bc7be7177ba4cb037a58c754763.tar.xz
bftw: Visit multiple roots breadth-first
This makes `bfs a b` treat `a` and `b` as siblings.
Diffstat (limited to 'bftw.h')
-rw-r--r--bftw.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/bftw.h b/bftw.h
index 568db9a..6f5ad6d 100644
--- a/bftw.h
+++ b/bftw.h
@@ -193,6 +193,10 @@ enum bftw_flags {
* Structure for holding the arguments passed to bftw().
*/
struct bftw_args {
+ /** The path(s) to start from. */
+ const char **paths;
+ /** The number of starting paths. */
+ size_t npaths;
/** The callback to invoke. */
bftw_callback *callback;
/** A pointer which is passed to the callback. */
@@ -212,13 +216,11 @@ struct bftw_args {
* and invokes a callback for each path it encounters. However, bftw() operates
* breadth-first.
*
- * @param path
- * The starting path.
* @param args
* The arguments that control the walk.
* @return
* 0 on success, or -1 on failure.
*/
-int bftw(const char *path, const struct bftw_args *args);
+int bftw(const struct bftw_args *args);
#endif // BFS_BFTW_H