cf55c58123e1d038e3939c3f637281144582f1a6
[fw/pdclib] / platform / altos / functions / _PDCLIB / fillbuffer.c
1 /* $Id$ */
2
3 /* _PDCLIB_fillbuffer( struct _PDCLIB_file_t * stream )
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 /* This is an example implementation of _PDCLIB_fillbuffer() fit for
10    use with POSIX kernels.
11 */
12
13 #include <stdio.h>
14
15 #ifndef REGTEST
16 #include <_PDCLIB_glue.h>
17
18 int _PDCLIB_fillbuffer( struct _PDCLIB_file_t * stream )
19 {
20         stream->buffer[0] = inbyte();
21         stream->pos.offset += 1;
22         stream->bufend = 1;
23         stream->bufidx = 0;
24         return 0;
25 }
26
27 #endif
28
29 #ifdef TEST
30 #include <_PDCLIB_test.h>
31
32 int main( void )
33 {
34     /* Testing covered by ftell.c */
35     return TEST_RESULTS;
36 }
37
38 #endif
39