1 // Copyright (C) 2017 The Android Open Source Project
2 // SPDX-License-Identifier: BSD-2-Clause
3
4 #include <dirent.h>
5
6 #include "header_checks.h"
7
dirent_h()8 static void dirent_h() {
9 INCOMPLETE_TYPE(DIR);
10
11 TYPE(struct dirent);
12 #if defined(__BIONIC__) && !defined(__LP64__) // Historical ABI accident.
13 STRUCT_MEMBER(struct dirent, uint64_t, d_ino);
14 #else
15 STRUCT_MEMBER(struct dirent, ino_t, d_ino);
16 #endif
17 STRUCT_MEMBER_ARRAY(struct dirent, char/*[]*/, d_name);
18
19 TYPE(ino_t);
20
21 FUNCTION(alphasort, int (*f)(const struct dirent**, const struct dirent**));
22 FUNCTION(closedir, int (*f)(DIR*));
23 FUNCTION(dirfd, int (*f)(DIR*));
24 FUNCTION(fdopendir, DIR* (*f)(int));
25 FUNCTION(opendir, DIR* (*f)(const char*));
26 FUNCTION(readdir, struct dirent* (*f)(DIR*));
27 FUNCTION(readdir_r, int (*f)(DIR*, struct dirent*, struct dirent**));
28 FUNCTION(rewinddir, void (*f)(DIR*));
29 FUNCTION(scandir, int (*f)(const char*, struct dirent***,
30 int (*)(const struct dirent*),
31 int (*)(const struct dirent**, const struct dirent**)));
32 FUNCTION(seekdir, void (*f)(DIR*, long));
33 FUNCTION(telldir, long (*f)(DIR*));
34 }
35