lib: c: io: implement standard FILE and DIR interfaces

This commit is contained in:
2026-03-25 20:21:12 +00:00
parent b975256cb9
commit 96784f611f
21 changed files with 599 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#ifndef _LIBC_IO_DIR_H_
#define _LIBC_IO_DIR_H_
#include <dirent.h>
#include <stddef.h>
enum dir_flags {
DIR_EOF = 0x01u,
DIR_ERR = 0x02u,
};
struct __opaque_dir {
enum dir_flags d_flags;
int d_fd;
char *d_buf;
struct dirent d_current;
size_t d_buf_datalen, d_buf_max;
size_t d_buf_readptr;
};
extern int __libc_dir_refill(struct __opaque_dir *d);
extern int __libc_dir_move_next(struct __opaque_dir *d);
#endif