2020-06-15 07:18:57 -07:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_CALLS_STRUCT_DIRENT_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_CALLS_STRUCT_DIRENT_H_
|
2022-08-13 13:11:56 -07:00
|
|
|
COSMOPOLITAN_C_START_
|
2020-06-15 07:18:57 -07:00
|
|
|
|
2021-01-29 01:25:14 -08:00
|
|
|
struct dirent { /* linux getdents64 abi */
|
2020-06-15 07:18:57 -07:00
|
|
|
uint64_t d_ino; /* inode number */
|
|
|
|
int64_t d_off; /* implementation-dependent location number */
|
|
|
|
uint16_t d_reclen; /* byte length of this whole struct and string */
|
2021-06-24 12:31:26 -07:00
|
|
|
uint8_t d_type; /* DT_REG, DT_DIR, DT_UNKNOWN, DT_BLK, etc. */
|
2020-09-06 21:39:00 -07:00
|
|
|
char d_name[256]; /* NUL-terminated basename */
|
2020-06-15 07:18:57 -07:00
|
|
|
};
|
|
|
|
|
2021-02-08 09:19:00 -08:00
|
|
|
struct dirstream;
|
|
|
|
typedef struct dirstream DIR;
|
|
|
|
|
2024-01-09 01:26:03 -08:00
|
|
|
DIR *fdopendir(int) libcesque __wur;
|
|
|
|
DIR *opendir(const char *) libcesque __wur;
|
|
|
|
int closedir(DIR *) libcesque;
|
|
|
|
int dirfd(DIR *) libcesque;
|
|
|
|
long telldir(DIR *) libcesque;
|
|
|
|
struct dirent *readdir(DIR *) libcesque;
|
|
|
|
int readdir_r(DIR *, struct dirent *, struct dirent **) libcesque;
|
|
|
|
void rewinddir(DIR *) libcesque;
|
|
|
|
void seekdir(DIR *, long) libcesque;
|
|
|
|
int alphasort(const struct dirent **, const struct dirent **) libcesque;
|
|
|
|
int versionsort(const struct dirent **, const struct dirent **) libcesque;
|
2022-10-10 17:52:41 -07:00
|
|
|
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *),
|
2024-01-09 01:26:03 -08:00
|
|
|
int (*)(const struct dirent **, const struct dirent **)) libcesque;
|
2022-06-08 20:01:28 -07:00
|
|
|
|
2022-08-13 13:11:56 -07:00
|
|
|
COSMOPOLITAN_C_END_
|
2020-06-15 07:18:57 -07:00
|
|
|
#endif /* COSMOPOLITAN_LIBC_CALLS_STRUCT_DIRENT_H_ */
|