lib: c: io: implement standard FILE and DIR interfaces
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#ifndef DIRENT_H_
|
||||
#define DIRENT_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define DT_UNKNOWN 0
|
||||
#define DT_BLK 1
|
||||
#define DT_CHR 2
|
||||
@@ -10,4 +12,22 @@
|
||||
#define DT_REG 6
|
||||
#define DT_SOCK 7
|
||||
|
||||
struct dirent {
|
||||
ino_t d_ino;
|
||||
off_t d_off;
|
||||
unsigned short d_reclen;
|
||||
unsigned char d_type;
|
||||
char d_name[256];
|
||||
};
|
||||
|
||||
struct __opaque_dir;
|
||||
typedef struct __opaque_dir DIR;
|
||||
|
||||
extern DIR *opendir(const char *name);
|
||||
extern DIR *fdopendir(int fd);
|
||||
|
||||
extern int closedir(DIR *dirp);
|
||||
|
||||
extern struct dirent *readdir(DIR *dirp);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user