lib: c: io: implement standard FILE and DIR interfaces
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#ifndef _LIBC_IO_FILE_H_
|
||||
#define _LIBC_IO_FILE_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
enum file_flags {
|
||||
FILE_EOF = 0x01u,
|
||||
FILE_ERR = 0x02u,
|
||||
FILE_BIN = 0x04u,
|
||||
};
|
||||
|
||||
struct __opaque_file {
|
||||
enum file_flags f_flags;
|
||||
int f_fd;
|
||||
char f_unget;
|
||||
char *f_buf;
|
||||
size_t f_buf_datalen, f_buf_max;
|
||||
size_t f_buf_readptr;
|
||||
};
|
||||
|
||||
extern int __libc_file_refill(struct __opaque_file *f);
|
||||
extern int __libc_file_read(struct __opaque_file *f, void *out, size_t count);
|
||||
extern size_t __libc_file_available(struct __opaque_file *f);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user