clean string_memset code
[libc-test] / src / api / ftw.c
1 #ifdef _XOPEN_SOURCE
2 #include <ftw.h>
3 #define T(t) (t*)0;
4 #define F(t,n) {t *y = &x.n;}
5 #define C(n) switch(n){case n:;}
6 static void f()
7 {
8 T(struct FTW)
9 T(struct stat)
10 C(FTW_F)
11 C(FTW_D)
12 C(FTW_DNR)
13 C(FTW_DP)
14 C(FTW_NS)
15 C(FTW_SL)
16 C(FTW_SLN)
17 C(FTW_PHYS)
18 C(FTW_MOUNT)
19 C(FTW_DEPTH)
20 C(FTW_CHDIR)
21 C(S_IRWXU)
22 C(S_IRUSR)
23 C(S_IWUSR)
24 C(S_IXUSR)
25 C(S_IRWXG)
26 C(S_IRGRP)
27 C(S_IWGRP)
28 C(S_IXGRP)
29 C(S_IRWXO)
30 C(S_IROTH)
31 C(S_IWOTH)
32 C(S_IXOTH)
33 C(S_ISUID)
34 C(S_ISGID)
35 C(S_ISVTX)
36 C(S_IFMT)
37 C(S_IFBLK)
38 C(S_IFCHR)
39 C(S_IFIFO)
40 C(S_IFREG)
41 C(S_IFDIR)
42 C(S_IFLNK)
43 C(S_IFSOCK)
44 C(S_ISBLK(0))
45 C(S_ISCHR(0))
46 C(S_ISDIR(0))
47 C(S_ISFIFO(0))
48 C(S_ISREG(0))
49 C(S_ISLNK(0))
50 C(S_ISSOCK(0))
51 {
52 struct FTW x;
53 F(int, base)
54 F(int, level)
55 }
56 {
57 struct stat x;
58 F(dev_t, st_dev)
59 F(ino_t, st_ino)
60 F(mode_t, st_mode)
61 F(nlink_t, st_nlink)
62 F(uid_t, st_uid)
63 F(gid_t, st_gid)
64 F(dev_t, st_rdev)
65 F(off_t, st_size)
66 F(struct timespec, st_atim)
67 F(struct timespec, st_mtim)
68 F(struct timespec, st_ctim)
69 F(blksize_t, st_blksize)
70 F(blkcnt_t, st_blocks)
71 }
72 {int(*p)(const char*,int(*)(const char*,const struct stat*,int),int) = ftw;}
73 {int(*p)(const char*,int(*)(const char*,const struct stat*,int,struct FTW*),int,int) = nftw;}
74 }
75 #endif
76