diff options
Diffstat (limited to 'cftw.h')
| -rw-r--r-- | cftw.h | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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 */ |
