/*---------------------------------------------------------------------* Name puts - outputs a string to stdout Usage int puts(const char *string); Prototype in stdio.h Description puts copies the null-terminated string string to the standard output stream stdout and appends a newline character. Return value On successful completion, puts returns the last character written. Otherwise, a value of EOF is returned. *---------------------------------------------------------------------*/ int _FARFUNC puts( const register char *s ) { int len; if (s == NULL) return (0); len = strlen( s ); if( __fputn( s, len, stdout) != len ) return( EOF ); return( ((fputc ('\n', stdout) != '\n') ? EOF : '\n') ); }
size_t _RTLENTRY _EXPFUNC fwrite( const void *ptr, size_t psize, size_t nitems, FILE *fp ) { size_t ret; if (psize == 0) return( nitems ); else { _lock_stream(fp); ret = __fputn(ptr, psize * nitems, fp) / psize; _unlock_stream(fp); return (ret); } }