5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
13 #include <_PDCLIB_glue.h>
15 int fgetc( struct _PDCLIB_file_t * stream )
17 if ( _PDCLIB_prepread( stream ) == EOF )
21 if ( stream->ungetidx > 0 )
23 return (unsigned char)stream->ungetbuf[ --(stream->ungetidx) ];
25 return (unsigned char)stream->buffer[stream->bufidx++];
31 #include <_PDCLIB_test.h>
35 /* Testing covered by ftell.c */