From 1cc323eb88242bc7be7177ba4cb037a58c754763 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 31 Mar 2019 17:36:30 -0400 Subject: bftw: Visit multiple roots breadth-first This makes `bfs a b` treat `a` and `b` as siblings. --- bftw.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'bftw.h') 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 -- cgit v1.2.3