]> pd.if.org Git - pdclib/blob - functions/stdio/ungetc.c
Comment cleanups.
[pdclib] / functions / stdio / ungetc.c
1 /* ungetc( int, FILE * )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include <stdio.h>
8
9 #ifndef REGTEST
10
11 int ungetc( int c, struct _PDCLIB_file_t * stream )
12 {
13     if ( c == EOF || stream->ungetidx == _PDCLIB_UNGETCBUFSIZE )
14     {
15         return -1;
16     }
17     return stream->ungetbuf[stream->ungetidx++] = (unsigned char) c;
18 }
19
20 #endif
21
22 #ifdef TEST
23 #include <_PDCLIB_test.h>
24
25 int main( void )
26 {
27     /* Testing covered by ftell.c */
28     return TEST_RESULTS;
29 }
30
31 #endif