Elliott Hughes | 13da600 | 2025-02-03 10:42:13 -0800 | [diff] [blame] | 1 | // Copyright (C) 2017 The Android Open Source Project |
| 2 | // SPDX-License-Identifier: BSD-2-Clause |
Elliott Hughes | 21b56eb | 2017-10-20 17:57:17 -0700 | [diff] [blame] | 3 | |
| 4 | #include <dirent.h> |
| 5 | |
| 6 | #include "header_checks.h" |
| 7 | |
| 8 | static void dirent_h() { |
| 9 | INCOMPLETE_TYPE(DIR); |
| 10 | |
| 11 | TYPE(struct dirent); |
Elliott Hughes | 2237b6b | 2017-12-13 15:18:15 -0800 | [diff] [blame] | 12 | #if defined(__BIONIC__) && !defined(__LP64__) // Historical ABI accident. |
| 13 | STRUCT_MEMBER(struct dirent, uint64_t, d_ino); |
Elliott Hughes | 21b56eb | 2017-10-20 17:57:17 -0700 | [diff] [blame] | 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 | } |