diff options
Diffstat (limited to 'ports/posix/src/stream_stdio.c')
| -rw-r--r-- | ports/posix/src/stream_stdio.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ports/posix/src/stream_stdio.c b/ports/posix/src/stream_stdio.c new file mode 100644 index 0000000..efa4b13 --- /dev/null +++ b/ports/posix/src/stream_stdio.c @@ -0,0 +1,18 @@ +#include <stdio.h> +#include "stream_stdio.h" +#include "stream.h" + +int stdio_read(uint8_t* buf, size_t count, void **vptr, void *sptr) +{ + int x; + for (x = 0; x < count; x++) { + scanf("%c", &buf[x]); + } + return 0; +} + +int stdio_write(uint8_t* buf, size_t count, void **vptr, void *sptr) +{ + printf("%s\n", buf); + return 0; +} |
