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_unlocked( 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++];
28 int fgetc( struct _PDCLIB_file_t * stream )
31 int c = fgetc_unlocked( stream );
32 funlockfile( stream );
39 #include <_PDCLIB_test.h>
43 /* Testing covered by ftell.c */