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 )
36 stdout->buffer[ stdout->bufidx++ ] = *s++;
37 if ( stdout->bufidx == stdout->bufsize )
39 if ( _PDCLIB_flushbuffer( stdout ) == EOF )
45 if ( stdout->status & ( _IOLBF | _IONBF ) )
47 return _PDCLIB_flushbuffer( stdout );
55 #include <_PDCLIB_test.h>
59 TESTCASE( puts( "SUCCESS testing puts()" ) >= 0 );