2020-05-12 23:23:29 +01:00
|
|
|
#ifndef SYS_MAGENTA___FIO_H_
|
|
|
|
|
#define SYS_MAGENTA___FIO_H_
|
2020-04-30 17:44:54 +01:00
|
|
|
|
|
|
|
|
#include <magenta.h>
|
|
|
|
|
|
|
|
|
|
#define __FIO_BUFSZ 512
|
|
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct __io_file {
|
|
|
|
|
char buf[__FIO_BUFSZ];
|
2020-05-12 23:23:29 +01:00
|
|
|
unsigned long buf_idx;
|
2020-04-30 17:44:54 +01:00
|
|
|
mx_handle_t handle;
|
|
|
|
|
char err;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern int __fileno(struct __io_file *f);
|
2020-05-12 23:23:29 +01:00
|
|
|
extern void __fio_init(mx_handle_t in, mx_handle_t out, mx_handle_t err);
|
2020-04-30 17:44:54 +01:00
|
|
|
extern unsigned int __fio_write(struct __io_file *f, const char *buf, unsigned int sz);
|
|
|
|
|
extern unsigned int __fio_flush(struct __io_file *f);
|
|
|
|
|
extern int __fio_error(struct __io_file *f);
|
|
|
|
|
|
2020-05-13 20:37:03 +01:00
|
|
|
extern int __fio_fopen(const char *path, const char *mode, struct __io_file *out);
|
|
|
|
|
extern int __fio_fclose(struct __io_file *in);
|
|
|
|
|
extern int __fio_fdopen(int fd, const char *mode, struct __io_file *out);
|
|
|
|
|
|
2020-04-30 17:44:54 +01:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|