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