From 9bf75cee19b8d60d2b4f6260a8c2322cc8ca11db Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 27 Jan 2021 15:27:56 -0500 Subject: dir: New DIR* facade --- bftw.h | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) (limited to 'bftw.h') diff --git a/bftw.h b/bftw.h index 098d12c..30fb39b 100644 --- a/bftw.h +++ b/bftw.h @@ -21,45 +21,11 @@ #ifndef BFS_BFTW_H #define BFS_BFTW_H +#include "dir.h" #include "stat.h" #include #include -/** - * Possible file types. - */ -enum bftw_type { - /** An error occurred for this file. */ - BFTW_ERROR = -1, - /** Unknown type. */ - BFTW_UNKNOWN, - /** Block device. */ - BFTW_BLK, - /** Character device. */ - BFTW_CHR, - /** Directory. */ - BFTW_DIR, - /** Solaris door. */ - BFTW_DOOR, - /** Pipe. */ - BFTW_FIFO, - /** Symbolic link. */ - BFTW_LNK, - /** Solaris event port. */ - BFTW_PORT, - /** Regular file. */ - BFTW_REG, - /** Socket. */ - BFTW_SOCK, - /** BSD whiteout. */ - BFTW_WHT, -}; - -/** - * Convert a bfs_stat() mode to a bftw_type. - */ -enum bftw_type bftw_mode_to_type(mode_t mode); - /** * Possible visit occurrences. */ @@ -99,7 +65,7 @@ struct BFTW { enum bftw_visit visit; /** The file type. */ - enum bftw_type type; + enum bfs_type type; /** The errno that occurred, if type == BFTW_ERROR. */ int error; @@ -154,7 +120,7 @@ const struct bfs_stat *bftw_cached_stat(const struct BFTW *ftwbuf, enum bfs_stat * @return * The type of the file, or BFTW_ERROR if an error occurred. */ -enum bftw_type bftw_type(const struct BFTW *ftwbuf, enum bfs_stat_flags flags); +enum bfs_type bftw_type(const struct BFTW *ftwbuf, enum bfs_stat_flags flags); /** * Walk actions returned by the bftw() callback. -- cgit v1.2.3