add a missing section header table index conversion
[tangerine.git] / compiler / clib / fputs.c
blobf779ba3a8f31a8be993d8df758b7ebb03f06fa88
1 /*
2 Copyright © 1995-2003, 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 "__errno.h"
11 #include "__open.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->fh, str) == -1)
59 errno = IoErr2errno(IoErr());
60 return EOF;
63 return 0;
64 } /* fputs */