grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / dos / fputc.c
blob9e7ad6191135e091a58e7019c5cb880d73b1f7ef
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
8 #include <exec/memory.h>
9 #include <proto/exec.h>
11 #include <dos/stdio.h>
12 #include <dos/dosextens.h>
14 #include "dos_intern.h"
16 #include <aros/debug.h>
18 /*****************************************************************************
20 NAME */
21 #include <proto/dos.h>
23 AROS_LH2(LONG, FPutC,
25 /* SYNOPSIS */
26 AROS_LHA(BPTR, file, D1),
27 AROS_LHA(LONG, character, D2),
29 /* LOCATION */
30 struct DosLibrary *, DOSBase, 52, Dos)
32 /* FUNCTION
33 Write a character to a file handle.
35 The write is buffered.
37 If the file handle is an interactive stream,
38 the buffer is automatically flushed on a linefeed,
39 carriage return or ASCII NUL.
41 INPUTS
42 file - Filehandle to write to.
43 character - Character to write.
45 RESULT
46 The character written or EOF in case of an error.
47 IoErr() gives additional information in that case.
49 NOTES
50 You should use Flush() when switching between
51 buffered and unbuffered IO.
53 EXAMPLE
55 BUGS
57 SEE ALSO
58 FGetC(), IoErr(), Flush(), FWrite()
60 INTERNALS
62 *****************************************************************************/
64 AROS_LIBFUNC_INIT
66 UBYTE c = character;
67 return (1 == FWriteChars(file, &c, 1, DOSBase))
68 ? character
69 : EOF;
71 AROS_LIBFUNC_EXIT
72 } /* FPutC */