grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / dos / writechars.c
blobdc4e2b426db1a7af6a521a1e89b4e998cb2f81e3
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Writes a buffer to the current output.
6 Lang: english
7 */
8 #include <proto/exec.h>
9 #include <dos/dosextens.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/dos.h>
17 AROS_LH2(LONG, WriteChars,
19 /* SYNOPSIS */
20 AROS_LHA(CONST_STRPTR, buf, D1),
21 AROS_LHA(ULONG, buflen, D2),
23 /* LOCATION */
24 struct DosLibrary *, DOSBase, 157, Dos)
26 /* FUNCTION
27 Writes the contents of the buffer to the current output stream.
28 The number of bytes written is returned.
30 INPUTS
31 buf - Buffer to be written.
32 buflen - Size of the buffer in bytes.
34 RESULT
35 The number of bytes written or EOF on failure. IoErr() gives
36 additional information in that case.
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 FPuts(), FPutC(), FWrite(), PutStr()
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
52 ULONG i;
53 BPTR file = Output();
55 for (i = 0; i < buflen; i++)
56 if (FPutC(file, buf[i]) < 0)
57 return EOF;
59 return (LONG)i;
60 AROS_LIBFUNC_EXIT
61 } /* WriteChars */