regex memory corruption regression test
[libc-test] / src / api / dirent.c
1 #include <dirent.h>
2 #define T(t) (t*)0;
3 #define F(t,n) {t *y = &x.n;}
4 #define C(n) switch(n){case n:;}
5 static void f()
6 {
7 T(DIR)
8 T(struct dirent)
9 #ifdef _XOPEN_SOURCE
10 T(ino_t)
11 #endif
12 {
13 struct dirent x;
14 #ifdef _XOPEN_SOURCE
15 F(ino_t,  d_ino)
16 #endif
17 F(char,   d_name[0])
18 }
19 {int(*p)(const struct dirent**,const struct dirent**) = alphasort;}
20 {int(*p)(DIR*) = closedir;}
21 {int(*p)(DIR*) = dirfd;}
22 {DIR*(*p)(int) = fdopendir;}
23 {DIR*(*p)(const char*) = opendir;}
24 {struct dirent*(*p)(DIR*) = readdir;}
25 {int(*p)(DIR*restrict,struct dirent*restrict,struct dirent**restrict) = readdir_r;}
26 {void(*p)(DIR*) = rewinddir;}
27 {int(*p)(const char*,struct dirent***,int(*)(const struct dirent*),int(*)(const struct dirent**,const struct dirent**)) = scandir;}
28 #ifdef _XOPEN_SOURCE
29 {void(*p)(DIR*,long) = seekdir;}
30 {long(*p)(DIR*) = telldir;}
31 #endif
32 }