]> pd.if.org Git - pdclib/blob - functions/stdio/setbuf.c
Removed the $Name$ tags (not supported by SVN). Added $Id$ to Makefile / text files.
[pdclib] / functions / stdio / setbuf.c
1 /* $Id$ */
2
3 /* setbuf( FILE *, char * )
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 #include <stdio.h>
10
11 #ifndef REGTEST
12
13 void setbuf( FILE * _PDCLIB_restrict stream, char * _PDCLIB_restrict buf )
14 {
15     /* TODO: Only allowed on a "virgin" stream; add check. */
16     if ( buf == NULL )
17     {
18         setvbuf( stream, buf, _IONBF, BUFSIZ );
19     }
20     else
21     {
22         setvbuf( stream, buf, _IOFBF, BUFSIZ );
23     }
24 }
25
26 #endif
27
28 #ifdef TEST
29 #include <_PDCLIB_test.h>
30
31 int main( void )
32 {
33     TESTCASE( NO_TESTDRIVER );
34     return TEST_RESULTS;
35 }
36
37 #endif