Added very useful and convenient macro for parsing attribute IDs
[AROS.git] / compiler / clib / fputs.c
blob324caba7fb68d43a9babc5484b1f20782bff7f5c
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 C99 function fputs().
6 */
8 #include <proto/dos.h>
9 #include <errno.h>
10 #include "__fdesc.h"
11 #include "__stdio.h"
13 /*****************************************************************************
15 NAME */
16 #include <stdio.h>
18 int fputs (
20 /* SYNOPSIS */
21 const char * str,
22 FILE * stream)
24 /* FUNCTION
25 Write a string to the specified stream.
27 INPUTS
28 str - Output this string...
29 fh - ...to this stream
31 RESULT
32 > 0 on success and EOF on error.
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 puts(), fputc(), putc()
43 INTERNALS
45 ******************************************************************************/
47 fdesc *fdesc = __getfdesc(stream->fd);
49 if (!fdesc)
51 errno = EBADF;
52 return EOF;
55 if (!str) str = "(null)";
57 if (FPuts((BPTR)fdesc->fcb->fh, str) == -1)
59 errno = __arosc_ioerr2errno(IoErr());
60 return EOF;
63 return 0;
64 } /* fputs */