1 /* setbuf( FILE *, char * )
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
11 void setbuf( struct _PDCLIB_file_t * _PDCLIB_restrict stream, char * _PDCLIB_restrict buf )
15 setvbuf( stream, buf, _IONBF, BUFSIZ );
19 setvbuf( stream, buf, _IOFBF, BUFSIZ );
26 #include <_PDCLIB_test.h>
31 /* TODO: Extend testing once setvbuf() is finished. */
33 char buffer[ BUFSIZ + 1 ];
36 TESTCASE( ( fh = tmpfile() ) != NULL );
38 TESTCASE( fh->buffer == buffer );
39 TESTCASE( fh->bufsize == BUFSIZ );
40 TESTCASE( ( fh->status & ( _IOFBF | _IONBF | _IOLBF ) ) == _IOFBF );
41 TESTCASE( fclose( fh ) == 0 );
43 TESTCASE( ( fh = tmpfile() ) != NULL );
45 TESTCASE( ( fh->status & ( _IOFBF | _IONBF | _IOLBF ) ) == _IONBF );
46 TESTCASE( fclose( fh ) == 0 );
48 puts( " NOTEST setbuf() test driver is PDCLib-specific." );