diff options
author | Anton Kling <anton@kling.gg> | 2023-10-22 19:50:38 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2023-10-22 19:50:38 +0200 |
commit | 4e09bca9e34c226b6d7e34b4fa11248405fd988e (patch) | |
tree | 80f156b7940d9d19971395f335530170c69516c7 /userland/libc/include/dirent.h |
Move everything into a new repo.
Diffstat (limited to 'userland/libc/include/dirent.h')
-rw-r--r-- | userland/libc/include/dirent.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/userland/libc/include/dirent.h b/userland/libc/include/dirent.h new file mode 100644 index 0000000..f190a7c --- /dev/null +++ b/userland/libc/include/dirent.h @@ -0,0 +1,28 @@ +#ifndef DIRENT_H +#define DIRENT_H +#include <fcntl.h> +#include <limits.h> +#include <stddef.h> +#include <stdlib.h> +#include <sys/types.h> +#include <unistd.h> + +struct dirent { + ino_t d_ino; // File serial number. + char d_name[PATH_MAX]; // Filename string of entry. +}; + +typedef struct { + int fd; + struct dirent internal_direntry; + int dir_num; +} DIR; + +DIR *opendir(const char *dirname); +struct dirent *readdir(DIR *dir); +int closedir(DIR *dirp); +int alphasort(const struct dirent **d1, const struct dirent **d2); +int scandir(const char *dir, struct dirent ***namelist, + int (*sel)(const struct dirent *), + int (*compar)(const struct dirent **, const struct dirent **)); +#endif |