#pragma once #include #if HAVE_SYS_TYPES_H #include #endif struct console { FILE *fp; }; struct console *console_init(unsigned dev_id); int console_peek(char *c, struct console *console, int block); int console_getc(char *c, struct console *console); int console_getline(struct console *console, char *buf, size_t n); ssize_t console_read(struct console *console, char *buf, size_t n);