lib: c: io: implement standard FILE and DIR interfaces
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user