1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#pragma once #include <stdio.h> struct dirent { ino_t d_ino; char d_name[256]; /* NAME_MAX + 1 */ }; typedef struct { FILE *fp; struct dirent dent; } DIR; DIR *opendir(const char *name); DIR *opendir_f(FILE *fp); int closedir(DIR *dir); struct dirent *readdir(DIR *dir);