#ifndef _DIRENT_H #define _DIRENT_H #include #include struct dirent { ino_t d_ino; off_t d_off; unsigned short d_reclen; unsigned char d_type; char d_name[NAME_MAX]; }; typedef struct { int d_dirfd; } DIR; #ifdef __cplusplus extern "C" { #endif /* Opens the directory at path and returns a handle to it, or NULL on error. */ DIR* opendir(const char* path); /* Returns a new directory handle associated with the file descriptor fd. */ DIR* fdopendir(int fd); /* Closes the directory stream. */ int closedir(DIR* stream); /* Reads an entry from the directory stream. The contents of the pointer returned may be overwritten by subsequent * calls to readdir(). */ struct dirent* readdir(DIR* stream); #ifdef __cplusplus } #endif #endif