summaryrefslogtreecommitdiff
path: root/ports/posix/src/stream_stdio.c
blob: ed83e7bcf35b048f800b57ac990983277c2edb24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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)
{
    int x;
    for (x = 0; x < count; x++) {
	printf("%x", buf[x]);
    }
    printf("\n");
    return 0;
}