summaryrefslogtreecommitdiffstats
path: root/bftw.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2017-02-08 19:15:11 -0500
committerTavian Barnes <tavianator@tavianator.com>2017-02-08 19:31:58 -0500
commita4dcfe8b6d1eaabe172322a81721f355647257ff (patch)
tree1b9a91ed1c1bf7e92bbc55d0ce8fce685b4ca090 /bftw.h
parent360bb95f1d0296efd8c784b13b05daf289336684 (diff)
downloadbfs-a4dcfe8b6d1eaabe172322a81721f355647257ff.tar.xz
Add support for -x?type with multiple types
This functionality is already part of GNU findutils git.
Diffstat (limited to 'bftw.h')
-rw-r--r--bftw.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/bftw.h b/bftw.h
index 2fb1ef0..3bfe2a2 100644
--- a/bftw.h
+++ b/bftw.h
@@ -20,32 +20,37 @@
*/
enum bftw_typeflag {
/** Unknown type. */
- BFTW_UNKNOWN,
+ BFTW_UNKNOWN = 0,
/** Block device. */
- BFTW_BLK,
+ BFTW_BLK = 1 << 0,
/** Character device. */
- BFTW_CHR,
+ BFTW_CHR = 1 << 1,
/** Directory. */
- BFTW_DIR,
+ BFTW_DIR = 1 << 2,
/** Solaris door. */
- BFTW_DOOR,
+ BFTW_DOOR = 1 << 3,
/** Pipe. */
- BFTW_FIFO,
+ BFTW_FIFO = 1 << 4,
/** Symbolic link. */
- BFTW_LNK,
+ BFTW_LNK = 1 << 5,
/** Solaris event port. */
- BFTW_PORT,
+ BFTW_PORT = 1 << 6,
/** Regular file. */
- BFTW_REG,
+ BFTW_REG = 1 << 7,
/** Socket. */
- BFTW_SOCK,
+ BFTW_SOCK = 1 << 8,
/** BSD whiteout. */
- BFTW_WHT,
+ BFTW_WHT = 1 << 9,
/** An error occurred for this file. */
- BFTW_ERROR,
+ BFTW_ERROR = 1 << 10,
};
/**
+ * Convert a stat() st_mode to a bftw() typeflag.
+ */
+enum bftw_typeflag bftw_mode_to_typeflag(mode_t mode);
+
+/**
* Possible visit occurrences.
*/
enum bftw_visit {