functional: add mntent test
[libc-test.git] / src / api / dirent.c
blob32f2bc4d0d2a43f97217786aca73ae2b9f72424d
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()
7 T(DIR)
8 T(struct dirent)
9 #ifdef _XOPEN_SOURCE
10 T(ino_t)
11 #endif
13 struct dirent x;
14 #ifdef _XOPEN_SOURCE
15 F(ino_t, d_ino)
16 #endif
17 F(char, d_name[0])
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