posixc.library: fgets.c tabs->spaces
[AROS.git] / compiler / stdc / puts.c
blob9e6120d6e1191f9f4ca5f0ee672fc3bcb37579d7
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 C99 function puts().
6 */
7 #include <libraries/stdcio.h>
9 /*****************************************************************************
11 NAME */
12 #include <stdio.h>
14 int puts (
16 /* SYNOPSIS */
17 const char * str)
19 /* FUNCTION
20 Print a string to stdout. A newline ('\n') is emmitted after the
21 string.
23 INPUTS
24 str - Print this string
26 RESULT
27 > 0 on success and EOF on error. On error, the reason is put in
28 errno.
30 NOTES
32 EXAMPLE
33 #include <errno.h>
35 if (puts ("Hello World.") != EOF)
36 fprintf (stderr, "Success");
37 else
38 fprintf (stderr, "Failure: errno=%d", errno);
40 BUGS
42 SEE ALSO
43 fputs(), printf(), fprintf(), putc(), fputc()
45 INTERNALS
47 ******************************************************************************/
49 struct StdCIOBase *StdCIOBase = __aros_getbase_StdCIOBase();
50 FILE *out = StdCIOBase->_stdout;
54 fputs (str, out) == EOF ||
55 fputs ("\n", out) == EOF ||
56 fflush (out) == EOF
59 return EOF;
62 return 1;
63 } /* puts */