X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=platform%2Faltos%2Ffunctions%2F_PDCLIB%2Ffillbuffer.c;fp=platform%2Faltos%2Ffunctions%2F_PDCLIB%2Ffillbuffer.c;h=cf55c58123e1d038e3939c3f637281144582f1a6;hb=d58957de3e0b9b7076a6f5dd49d5df8e78f5a826;hp=0000000000000000000000000000000000000000;hpb=6225e295ec21ab2e47ab4cd153921221bc05a2b0;p=fw%2Fpdclib diff --git a/platform/altos/functions/_PDCLIB/fillbuffer.c b/platform/altos/functions/_PDCLIB/fillbuffer.c new file mode 100644 index 0000000..cf55c58 --- /dev/null +++ b/platform/altos/functions/_PDCLIB/fillbuffer.c @@ -0,0 +1,39 @@ +/* $Id$ */ + +/* _PDCLIB_fillbuffer( struct _PDCLIB_file_t * stream ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +/* This is an example implementation of _PDCLIB_fillbuffer() fit for + use with POSIX kernels. +*/ + +#include + +#ifndef REGTEST +#include <_PDCLIB_glue.h> + +int _PDCLIB_fillbuffer( struct _PDCLIB_file_t * stream ) +{ + stream->buffer[0] = inbyte(); + stream->pos.offset += 1; + stream->bufend = 1; + stream->bufidx = 0; + return 0; +} + +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + /* Testing covered by ftell.c */ + return TEST_RESULTS; +} + +#endif +