aboutsummaryrefslogtreecommitdiff
path: root/cftw.h
diff options
context:
space:
mode:
Diffstat (limited to 'cftw.h')
-rw-r--r--cftw.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/cftw.h b/cftw.h
index 663960c..645e082 100644
--- a/cftw.h
+++ b/cftw.h
@@ -4,9 +4,18 @@
#include <stdbool.h>
#include <sys/stat.h>
-/* Thread-safe variant of ftw(3) and nftw(3) that allows passing an
- * opaque pointer and removes some unneeded parameters. */
-int cftw(const char *dirpath, int (*fn)(const char *fpath,
+enum cftw_state
+{
+ CFTW_OK,
+ CFTW_AGAIN,
+ CFTW_FATAL
+};
+
+/* Thread-safe and non-blocking variant of ftw(3) and nftw(3) that allows
+ * passing an opaque pointer and removes some unneeded parameters. */
+struct cftw *cftw(const char *dirpath, int (*fn)(const char *fpath,
const struct stat *sb, bool *done, void *user), void *user);
+enum cftw_state cftw_step(struct cftw *c);
+void cftw_free(struct cftw *c);
#endif /* CFTW_H */