1 /** 2 * This file is part of the mingw-w64 runtime package. 3 * No warranty is given; refer to the file DISCLAIMER within this package. 4 */ 5 6 #ifndef _FTW_HXX 7 #define _FTW_HXX 8 9 #include <sys/types.h> 10 #include <sys/stat.h> 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 struct FTW { 17 int base; 18 int level; 19 }; 20 21 /* A regular file. */ 22 #define FTW_F 0 23 /* A directory. */ 24 #define FTW_D 1 25 /* An unreadable directory. */ 26 #define FTW_DNR 2 27 /* An unstatable file. */ 28 #define FTW_NS 3 29 /* A symbolic link (not supported). */ 30 #define FTW_SL 4 31 /* A directory (all subdirs are visited). */ 32 #define FTW_DP 5 33 /* A symbolic link naming non-existing file (not supported). */ 34 #define FTW_SLN 6 35 36 /* Do a physical walk (ignore symlinks). */ 37 #define FTW_PHYS 1 38 /* Do report only files on same device as the argument (partial supported). */ 39 #define FTW_MOUNT 2 40 /* Change to current directory while processing (unsupported). */ 41 #define FTW_CHDIR 4 42 /* Do report files in directory before the directory itself.*/ 43 #define FTW_DEPTH 8 44 /* Tell callback to return FTW_* values instead of zero to continue and non-zero to terminate. */ 45 #define FTW_ACTIONRETVAL 16 46 47 /* Continue with next sibling or with the first child-directory. */ 48 #define FTW_CONTINUE 0 49 /* Return from ftw or nftw with FTW_STOP as return value. */ 50 #define FTW_STOP 1 51 /* Valid only for FTW_D: Don't walk through the subtree. */ 52 #define FTW_SKIP_SUBTREE 2 53 /* Continue with FTW_DP callback for current directory (if FTW_DEPTH) and then its siblings. */ 54 #define FTW_SKIP_SIBLINGS 3 55 56 int ftw (const char *, int (*) (const char *, const struct stat *, int), int); 57 int ftw64 (const char *, int (*) (const char *, const struct stat64 *, int), int); 58 59 int nftw (const char *, int (*) (const char *, const struct stat *, int , struct FTW *), int, int); 60 int nftw64 (const char *, int (*) (const char *, const struct stat64 *, int , struct FTW *), int, int); 61 62 #ifdef __cplusplus 63 } 64 #endif 65 66 #endif 67