compiler/clib: Rename IoErr2errno() to __arosc_ioerr2errno(); function is now defined...
[AROS.git] / compiler / clib / fputs.c
blob0baa1c2eccff60dcba30c9186803a487070b67fe
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 ANSI C function fputs().
6 */
8 #include <proto/dos.h>
9 #include <errno.h>
10 #include "__fdesc.h"
12 /*****************************************************************************
14 NAME */
15 #include <stdio.h>
17 int fputs (
19 /* SYNOPSIS */
20 const char * str,
21 FILE * stream)
23 /* FUNCTION
24 Write a string to the specified stream.
26 INPUTS
27 str - Output this string...
28 fh - ...to this stream
30 RESULT
31 > 0 on success and EOF on error.
33 NOTES
35 EXAMPLE
37 BUGS
39 SEE ALSO
40 puts(), fputc(), putc()
42 INTERNALS
44 ******************************************************************************/
46 fdesc *fdesc = __getfdesc(stream->fd);
48 if (!fdesc)
50 errno = EBADF;
51 return EOF;
54 if (!str) str = "(null)";
56 if (FPuts((BPTR)fdesc->fcb->fh, str) == -1)
58 errno = __arosc_ioerr2errno(IoErr());
59 return EOF;
62 return 0;
63 } /* fputs */