Xavier Del Campo Romero
804b8841f3
POSIX functions ftw(3) and nftw(3) do not allow passing an opaque pointer to the callback they call, so it forces the use of statically allocated data. ctfw (from "custom ftw") is a custom implementation that solves this, while also removing unneeded stuff. This function will be used by future commits.
12 lines
314 B
C
12 lines
314 B
C
#ifndef CFTW_H
|
|
#define CFTW_H
|
|
|
|
#include <sys/stat.h>
|
|
|
|
/* Thread-safe variant of ftw(3) and nftw(3) that allows passing an
|
|
* opaque pointer and removes some unneeded parameters. */
|
|
int cftw(const char *dirpath, int (*fn)(const char *fpath,
|
|
const struct stat *sb, void *user), void *user);
|
|
|
|
#endif /* CFTW_H */
|