Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / dos / writechars.c
blob3baf4b0883e4104ea560a1ad6c5166355923aabb
1 /*
2 Copyright © 1995-2001, 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(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 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
53 ULONG i;
54 BPTR file = Output();
56 for (i = 0; i < buflen; i++)
57 if (FPutC(file, buf[i]) < 0)
58 return EOF;
60 return (LONG)i;
61 AROS_LIBFUNC_EXIT
62 } /* WriteChars */