summaryrefslogtreecommitdiffstats
path: root/bftw.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2021-01-27 15:27:56 -0500
committerTavian Barnes <tavianator@tavianator.com>2021-01-28 17:13:26 -0500
commit9bf75cee19b8d60d2b4f6260a8c2322cc8ca11db (patch)
tree0bc819909cb616b05ff013fbf1144dae7a13ec23 /bftw.h
parent3fcd7b010fd4f477582997d688cc415f76e70411 (diff)
downloadbfs-9bf75cee19b8d60d2b4f6260a8c2322cc8ca11db.tar.xz
dir: New DIR* facade
Diffstat (limited to 'bftw.h')
-rw-r--r--bftw.h40
1 files changed, 3 insertions, 37 deletions
diff --git a/bftw.h b/bftw.h
index 098d12c..30fb39b 100644
--- a/bftw.h
+++ b/bftw.h
@@ -21,46 +21,12 @@
#ifndef BFS_BFTW_H
#define BFS_BFTW_H
+#include "dir.h"
#include "stat.h"
#include <stddef.h>
#include <sys/types.h>
/**
- * 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.
*/
enum bftw_visit {
@@ -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.