add a missing section header table index conversion
[tangerine.git] / compiler / clib / fputc.c
blob0093cbb7f04b745f742412fff4900c80b124e7dc
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
5 ANSI C function fputc().
6 */
8 #include <errno.h>
9 #include <dos/dos.h>
10 #include <dos/dosextens.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
13 #include "__open.h"
14 #include "__errno.h"
16 /*****************************************************************************
18 NAME */
19 #include <stdio.h>
21 int fputc (
23 /* SYNOPSIS */
24 int c,
25 FILE * stream)
27 /* FUNCTION
28 Write one character to the specified stream.
30 INPUTS
31 c - The character to output
32 stream - The character is written to this stream
34 RESULT
35 The character written or EOF on error.
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 ******************************************************************************/
49 fdesc *fdesc = __getfdesc(stream->fd);
51 if (!fdesc)
53 errno = EBADF;
54 return EOF;
57 if (FPutC((BPTR)fdesc->fh, c) == EOF)
59 errno = IoErr2errno(IoErr());
60 c = EOF;
63 return c;
64 } /* fputc */