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