#include "fd.h" #include "fifo.h" bool fd_write(fd* f,uint8_t c) { return f->write(f->data,c); } uint8_t fd_read(fd* f) { return f->read(f->data); } bool fd_has(fd* f) { return f->has(f->data); } bool fd_close(fd* f) { return f->close(f->data); } fd fd_from_fifo(fifo* fif) { fd f; f.data=fif; f.read=fifo_get; f.write=fifo_put; // f.close=fd_close; f.has=fifo_has; return f; }