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 /* FIXME: Think-o. '\n' is lineend, conversion to platform-specific
34 tales place only for text streams.
39 stdout->buffer[ stdout->bufidx++ ] = *s++;
40 if ( stdout->bufidx == stdout->bufsize )
42 if ( _PDCLIB_flushbuffer( stdout ) == EOF )
48 if ( stdout->status & ( _IOLBF | _IONBF ) )
50 return _PDCLIB_flushbuffer( stdout );
58 #include <_PDCLIB_test.h>
62 TESTCASE( puts( "SUCCESS testing puts()" ) >= 0 );