Add altos platform
[fw/pdclib] / platform / altos / functions / _PDCLIB / fillbuffer.c
diff --git a/platform/altos/functions/_PDCLIB/fillbuffer.c b/platform/altos/functions/_PDCLIB/fillbuffer.c
new file mode 100644 (file)
index 0000000..cf55c58
--- /dev/null
@@ -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 <stdio.h>
+
+#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
+