ftw.h
001:
002:
003:
004:
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019:
020:
021:
022:
023: #ifndef _FTW_H
024: #define _FTW_H 1
025:
026: #include <features.h>
027:
028: #include <sys/types.h>
029: #include <sys/stat.h>
030:
031:
032: __BEGIN_DECLS
033:
034:
035:
036: enum
037: {
038: FTW_F,
039: #define FTW_F FTW_F
040: FTW_D,
041: #define FTW_D FTW_D
042: FTW_DNR,
043: #define FTW_DNR FTW_DNR
044: FTW_NS,
045: #define FTW_NS FTW_NS
046:
047: #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
048:
049: FTW_SL,
050: # define FTW_SL FTW_SL
051: #endif
052:
053: #ifdef __USE_XOPEN_EXTENDED
054:
055: FTW_DP,
056: # define FTW_DP FTW_DP
057: FTW_SLN
058: # define FTW_SLN FTW_SLN
059:
060: #endif
061: };
062:
063:
064: #ifdef __USE_XOPEN_EXTENDED
065:
066: enum
067: {
068: FTW_PHYS = 1,
069: # define FTW_PHYS FTW_PHYS
070: FTW_MOUNT = 2,
071:
072: # define FTW_MOUNT FTW_MOUNT
073: FTW_CHDIR = 4,
074: # define FTW_CHDIR FTW_CHDIR
075: FTW_DEPTH = 8
076: # define FTW_DEPTH FTW_DEPTH
077: # ifdef __USE_GNU
078: ,
079: FTW_ACTIONRETVAL = 16
080:
081: # define FTW_ACTIONRETVAL FTW_ACTIONRETVAL
082: # endif
083: };
084:
085: #ifdef __USE_GNU
086:
087: enum
088: {
089: FTW_CONTINUE = 0,
090:
091: # define FTW_CONTINUE FTW_CONTINUE
092: FTW_STOP = 1,
093:
094: # define FTW_STOP FTW_STOP
095: FTW_SKIP_SUBTREE = 2,
096:
097:
098: # define FTW_SKIP_SUBTREE FTW_SKIP_SUBTREE
099: FTW_SKIP_SIBLINGS = 3,
100:
101: # define FTW_SKIP_SIBLINGS FTW_SKIP_SIBLINGS
102: };
103: #endif
104:
105:
106: struct FTW
107: {
108: int base;
109: int level;
110: };
111: #endif
112:
113:
114:
115: typedef int (*__ftw_func_t) (__const char *__filename,
116: __const struct stat *__status, int __flag);
117: #ifdef __USE_LARGEFILE64
118: typedef int (*__ftw64_func_t) (__const char *__filename,
119: __const struct stat64 *__status, int __flag);
120: #endif
121: #ifdef __USE_XOPEN_EXTENDED
122: typedef int (*__nftw_func_t) (__const char *__filename,
123: __const struct stat *__status, int __flag,
124: struct FTW *__info);
125: # ifdef __USE_LARGEFILE64
126: typedef int (*__nftw64_func_t) (__const char *__filename,
127: __const struct stat64 *__status,
128: int __flag, struct FTW *__info);
129: # endif
130: #endif
131:
132:
133:
134:
135:
136: #ifndef __USE_FILE_OFFSET64
137: extern int ftw (__const char *__dir, __ftw_func_t __func, int __descriptors)
138: __nonnull ((1, 2));
139: #else
140: # ifdef __REDIRECT
141: extern int __REDIRECT (ftw, (__const char *__dir, __ftw_func_t __func,
142: int __descriptors), ftw64) __nonnull ((1, 2));
143: # else
144: # define ftw ftw64
145: # endif
146: #endif
147: #ifdef __USE_LARGEFILE64
148: extern int ftw64 (__const char *__dir, __ftw64_func_t __func,
149: int __descriptors) __nonnull ((1, 2));
150: #endif
151:
152: #ifdef __USE_XOPEN_EXTENDED
153:
154:
155:
156:
157:
158: # ifndef __USE_FILE_OFFSET64
159: extern int nftw (__const char *__dir, __nftw_func_t __func, int __descriptors,
160: int __flag) __nonnull ((1, 2));
161: # else
162: # ifdef __REDIRECT
163: extern int __REDIRECT (nftw, (__const char *__dir, __nftw_func_t __func,
164: int __descriptors, int __flag), nftw64)
165: __nonnull ((1, 2));
166: # else
167: # define nftw nftw64
168: # endif
169: # endif
170: # ifdef __USE_LARGEFILE64
171: extern int nftw64 (__const char *__dir, __nftw64_func_t __func,
172: int __descriptors, int __flag) __nonnull ((1, 2));
173: # endif
174: #endif
175:
176: __END_DECLS
177:
178: #endif
179:
© Andrew Scott 2006 -
2024,
All Rights Reserved