3 /* puts( const 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.
12 #include <_PDCLIB_glue.h>
14 extern char * _PDCLIB_eol;
16 int puts( const char * s )
18 if ( _PDCLIB_prepwrite( stdout ) == EOF )
24 stdout->buffer[ stdout->bufidx++ ] = *s++;
25 if ( stdout->bufidx == stdout->bufsize )
27 if ( _PDCLIB_flushbuffer( stdout ) == EOF )
33 stdout->buffer[ stdout->bufidx++ ] = '\n';
34 if ( ( stdout->bufidx == stdout->bufsize ) ||
35 ( stdout->status & ( _IOLBF | _IONBF ) ) )
37 return _PDCLIB_flushbuffer( stdout );
48 #include <_PDCLIB_test.h>
52 TESTCASE( puts( "SUCCESS testing puts()" ) >= 0 );