2020-06-15 14:18:57 +00:00
|
|
|
#ifndef COSMOPOLITAN_LIBC_CALLS_STRUCT_DIRENT_H_
|
|
|
|
#define COSMOPOLITAN_LIBC_CALLS_STRUCT_DIRENT_H_
|
2022-08-13 20:11:56 +00:00
|
|
|
COSMOPOLITAN_C_START_
|
2020-06-15 14:18:57 +00:00
|
|
|
|
2021-01-29 09:25:14 +00:00
|
|
|
struct dirent { /* linux getdents64 abi */
|
2020-06-15 14:18:57 +00: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 19:31:26 +00:00
|
|
|
uint8_t d_type; /* DT_REG, DT_DIR, DT_UNKNOWN, DT_BLK, etc. */
|
2020-09-07 04:39:00 +00:00
|
|
|
char d_name[256]; /* NUL-terminated basename */
|
2020-06-15 14:18:57 +00:00
|
|
|
};
|
|
|
|
|
2021-02-08 17:19:00 +00:00
|
|
|
struct dirstream;
|
|
|
|
typedef struct dirstream DIR;
|
|
|
|
|
2024-01-09 09:26:03 +00: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-11 00:52:41 +00:00
|
|
|
int scandir(const char *, struct dirent ***, int (*)(const struct dirent *),
|
2024-01-09 09:26:03 +00:00
|
|
|
int (*)(const struct dirent **, const struct dirent **)) libcesque;
|
2022-06-09 03:01:28 +00:00
|
|
|
|
2022-08-13 20:11:56 +00:00
|
|
|
COSMOPOLITAN_C_END_
|
2020-06-15 14:18:57 +00:00
|
|
|
#endif /* COSMOPOLITAN_LIBC_CALLS_STRUCT_DIRENT_H_ */
|