home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / clib / puts.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-20  |  1.1 KB  |  64 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: puts.c,v 1.3 1997/01/20 12:32:44 digulla Exp $
  4.  
  5.     Desc: ANSI C function puts()
  6.     Lang: english
  7. */
  8.  
  9. /*****************************************************************************
  10.  
  11.     NAME */
  12. #include <stdio.h>
  13.  
  14.     int puts (
  15.  
  16. /*  SYNOPSIS */
  17.     const char * str)
  18.  
  19. /*  FUNCTION
  20.     Print a string to stdout. A newline ('\n') is emmitted after the
  21.     string.
  22.  
  23.     INPUTS
  24.     str - Print this string
  25.  
  26.     RESULT
  27.     > 0 on success and EOF on error. On error, the reason is put in
  28.     errno.
  29.  
  30.     NOTES
  31.  
  32.     EXAMPLE
  33.     #include <errno.h>
  34.  
  35.     if (puts ("Hello World.") != EOF)
  36.         fprintf (stderr, "Success");
  37.     else
  38.         fprintf (stderr, "Failure: errno=%d", errno);
  39.  
  40.     BUGS
  41.  
  42.     SEE ALSO
  43.     fputs(), printf(), fprintf(), putc(), fputc()
  44.  
  45.     INTERNALS
  46.  
  47.     HISTORY
  48.     10.12.1996 digulla created after libnix
  49.  
  50. ******************************************************************************/
  51. {
  52.     if (fputs (str, stdout) == EOF)
  53.     return EOF;
  54.  
  55.     if (putc ('\n', stdout) == EOF)
  56.     return EOF;
  57.  
  58.     if (fflush (stdout) == EOF)
  59.     return EOF;
  60.  
  61.     return 1;
  62. } /* puts */
  63.  
  64.