From 1746218beebc7e180f3eaed905277f9f46983ac4 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 24 Jun 2021 11:42:55 +0200 Subject: move iterate_on_dir() from e2fsprogs to libbb Signed-off-by: Denys Vlasenko --- include/libbb.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 251d7231c..7d6ab4a93 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -512,6 +512,11 @@ int recursive_action(const char *fileName, unsigned flags, void *userData ) FAST_FUNC; +/* Simpler version: call a function on each dirent in a directory */ +int iterate_on_dir(const char *dir_name, + int FAST_FUNC (*func)(const char *, struct dirent *, void *), + void *private) FAST_FUNC; + extern int device_open(const char *device, int mode) FAST_FUNC; enum { GETPTY_BUFSIZE = 16 }; /* more than enough for "/dev/ttyXXX" */ extern int xgetpty(char *line) FAST_FUNC; -- cgit v1.2.3