Changeset 350
- Timestamp:
- 09/09/09 21:09:28 (11 months ago)
- Files:
-
- branches/stdio_rewrite/functions/_PDCLIB (modified) (1 prop)
- branches/stdio_rewrite/functions/_PDCLIB/stdinit.c (modified) (1 diff)
- branches/stdio_rewrite/functions/stdio/fgets.c (added)
- branches/stdio_rewrite/functions/stdio/fputs.c (modified) (1 diff)
- branches/stdio_rewrite/functions/stdio/gets.c (added)
- branches/stdio_rewrite/functions/stdio/puts.c (modified) (3 diffs)
- branches/stdio_rewrite/includes/stdio.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/stdio_rewrite/functions/_PDCLIB
- Property svn:ignore changed from
*.d
*.t
*.r
_Exit.c
allocpages.c
flushbuffer.c
fillbuffer.c
prepread.c
prepwrite.c
seek.c
close.c
open.c
to
*.d
*.t
*.r
_Exit.c
allocpages.c
flushbuffer.c
fillbuffer.c
seek.c
close.c
open.c
- Property svn:ignore changed from
branches/stdio_rewrite/functions/_PDCLIB/stdinit.c
r346 r350 29 29 30 30 /* FIXME: serr should handle one character. Buffering on out / in? */ 31 static struct _PDCLIB_file_t _PDCLIB_serr = { 2, _PDCLIB_serr_buffer, BUFSIZ, 0, 0, 0, 0, _PDCLIB_serr_ungetbuf, _IO LBF, NULL, NULL };32 static struct _PDCLIB_file_t _PDCLIB_sout = { 1, _PDCLIB_sout_buffer, BUFSIZ, 0, 0, 0, 0, _PDCLIB_sout_ungetbuf, _IOLBF , NULL, &_PDCLIB_serr };33 static struct _PDCLIB_file_t _PDCLIB_sin = { 0, _PDCLIB_sin_buffer, BUFSIZ, 0, 0, 0, 0, _PDCLIB_sin_ungetbuf, _IOLBF , NULL, &_PDCLIB_sout };31 static struct _PDCLIB_file_t _PDCLIB_serr = { 2, _PDCLIB_serr_buffer, BUFSIZ, 0, 0, 0, 0, _PDCLIB_serr_ungetbuf, _IONBF | _PDCLIB_FWRITE, NULL, NULL }; 32 static struct _PDCLIB_file_t _PDCLIB_sout = { 1, _PDCLIB_sout_buffer, BUFSIZ, 0, 0, 0, 0, _PDCLIB_sout_ungetbuf, _IOLBF | _PDCLIB_FWRITE, NULL, &_PDCLIB_serr }; 33 static struct _PDCLIB_file_t _PDCLIB_sin = { 0, _PDCLIB_sin_buffer, BUFSIZ, 0, 0, 0, 0, _PDCLIB_sin_ungetbuf, _IOLBF | _PDCLIB_FREAD, NULL, &_PDCLIB_sout }; 34 34 35 35 struct _PDCLIB_file_t * stdin = &_PDCLIB_sin; branches/stdio_rewrite/functions/stdio/fputs.c
r349 r350 11 11 #ifndef REGTEST 12 12 #include <_PDCLIB_glue.h> 13 14 extern char const * const _PDCLIB_eol;15 16 #define _PDCLIB_FLUSHCONDITION( x, y ) _PDCLIB_FBF_FLUSH( x, y )17 13 18 14 int fputs( const char * s, struct _PDCLIB_file_t * stream ) branches/stdio_rewrite/functions/stdio/puts.c
r346 r350 11 11 #ifndef REGTEST 12 12 #include <_PDCLIB_glue.h> 13 14 extern char * _PDCLIB_eol; 13 15 14 16 int puts( const char * s ) … … 29 31 } 30 32 } 31 /* TODO: _IOLBF, _IONBF */ 33 s = _PDCLIB_eol; 34 while ( *s != '\0' ) 35 { 36 stdout->buffer[ stdout->bufidx++ ] = *s++; 37 if ( stdout->bufidx == stdout->bufsize ) 38 { 39 if ( _PDCLIB_flushbuffer( stdout ) == EOF ) 40 { 41 return EOF; 42 } 43 } 44 } 45 if ( stdout->status & ( _IOLBF | _IONBF ) ) 46 { 47 return _PDCLIB_flushbuffer( stdout ); 48 } 32 49 return 0; 33 50 } … … 40 57 int main( void ) 41 58 { 42 TESTCASE( puts( "SUCCESS testing puts() " ) >= 0 );59 TESTCASE( puts( "SUCCESS testing puts()\n" ) >= 0 ); 43 60 return TEST_RESULTS; 44 61 } branches/stdio_rewrite/includes/stdio.h
r333 r350 72 72 int getchar( void ); 73 73 74 char * gets( char * s ); 75 char * fgets( char * s, int n, FILE * stream ); 76 74 77 int remove( const char * pathname ); 75 78
