/* fgetc( FILE * )12This file is part of the Public Domain C Library (PDCLib).3Permission is granted to use, modify, and / or redistribute at will.4*/56#include <stdio.h>78#ifndef REGTEST9#include "_PDCLIB_io.h"1011int _PDCLIB_fgetc_unlocked( FILE * stream )12{13if ( _PDCLIB_prepread( stream ) == EOF )14{15return EOF;16}1718char c;1920size_t n = _PDCLIB_getchars( &c, 1, EOF, stream );2122return n == 0 ? EOF : (unsigned char) c;23}2425int fgetc( FILE * stream )26{27_PDCLIB_flockfile( stream );28int c = _PDCLIB_fgetc_unlocked( stream );29_PDCLIB_funlockfile( stream );30return c;31}3233#endif3435#ifdef TEST36#include "_PDCLIB_test.h"3738int main( void )39{40/* Testing covered by ftell.c */41return TEST_RESULTS;42}4344#endif454647