home *** CD-ROM | disk | FTP | other *** search
- /*-----------------------------------------------------------------------*
- * filename - puts.c
- *
- * function(s)
- * puts - puts a string on a stream
- *-----------------------------------------------------------------------*/
-
- /*[]------------------------------------------------------------[]*/
- /*| |*/
- /*| Turbo C Run Time Library - Version 3.0 |*/
- /*| |*/
- /*| |*/
- /*| Copyright (c) 1987,1988,1990 by Borland International |*/
- /*| All Rights Reserved. |*/
- /*| |*/
- /*[]------------------------------------------------------------[]*/
-
- #include <stdio.h>
- #include <string.h>
- #include <_stdio.h>
-
- /*---------------------------------------------------------------------*
-
- 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 puts( const register char *s )
- {
- int len = strlen( s );
-
- if( __fputn( s, len, stdout) != len ) return( EOF );
-
- return( ((fputc ('\n', stdout) != '\n') ? EOF : '\n') );
- }
-