summaryrefslogtreecommitdiff
path: root/src/ftw/__ftw.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2022-04-21 19:11:02 -0400
committerJakob Kaivo <jkk@ung.org>2022-04-21 19:11:02 -0400
commit07e6d999712be764a20365becb145f7cd1e3119c (patch)
treef6711f8a7ee134949bd7c6b355ef9453b02001db /src/ftw/__ftw.c
parent29c25171fbd4394c6007935c31f7d0e0995a6792 (diff)
prep common (n)ftw() implementation
Diffstat (limited to 'src/ftw/__ftw.c')
-rw-r--r--src/ftw/__ftw.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ftw/__ftw.c b/src/ftw/__ftw.c
new file mode 100644
index 00000000..2acee0cb
--- /dev/null
+++ b/src/ftw/__ftw.c
@@ -0,0 +1,12 @@
+#include "_ftw.h"
+
+int __ftw(const char *path, int (*fn)(), int fd_limit, int flags)
+{
+ struct FTW ft;
+ struct stat st;
+ int type = 0;
+
+ int ret = (flags == __FTW_OLD) ? fn(path, &st, type) : fn(path, &st, type, &ft);
+
+ return ret;
+}