3 /* setbuf( FILE *, char * )
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 void setbuf( FILE * _PDCLIB_restrict stream, char * _PDCLIB_restrict buf )
17 setvbuf( stream, buf, _IONBF, BUFSIZ );
21 setvbuf( stream, buf, _IOFBF, BUFSIZ );
28 #include <_PDCLIB_test.h>
31 #include <_PDCLIB_io.h>
36 /* TODO: Extend testing once setvbuf() is finished. */
38 char buffer[ BUFSIZ + 1 ];
41 TESTCASE( ( fh = tmpfile() ) != NULL );
43 TESTCASE( fh->buffer == buffer );
44 TESTCASE( fh->bufsize == BUFSIZ );
45 TESTCASE( ( fh->status & ( _IOFBF | _IONBF | _IOLBF ) ) == _IOFBF );
46 TESTCASE( fclose( fh ) == 0 );
48 TESTCASE( ( fh = tmpfile() ) != NULL );
50 TESTCASE( ( fh->status & ( _IOFBF | _IONBF | _IOLBF ) ) == _IONBF );
51 TESTCASE( fclose( fh ) == 0 );
53 puts( " NOTEST setbuf() test driver is PDCLib-specific." );