Detabbed
[AROS.git] / rom / dos / fputs.c
blob1b40b674b9266ebc34abbbae00f1dfae41ef0bb4
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <dos/dosextens.h>
10 #include "dos_intern.h"
12 #include <aros/debug.h>
15 /*****************************************************************************
17 NAME */
18 #include <proto/dos.h>
20 AROS_LH2(LONG, FPuts,
21 /* FPuts -- Writes a string the the specified output (buffered) */
23 /* SYNOPSIS */
24 AROS_LHA(BPTR, file, D1),
25 AROS_LHA(CONST_STRPTR, string, D2),
27 /* LOCATION */
29 struct DosLibrary *, DOSBase, 57, Dos)
31 /* FUNCTION
32 This routine writes an unformatted string to the filehandle. No
33 newline is appended to the string. This routine is buffered.
35 INPUTS
36 file - Filehandle to write to.
37 string - String to write.
39 RESULT
40 0 if all went well or EOF in case of an error.
41 IoErr() gives additional information in that case.
43 SEE ALSO
44 FGetC(), IoErr()
46 *****************************************************************************/
48 AROS_LIBFUNC_INIT
50 if (file == BNULL) {
51 SetIoErr(ERROR_OBJECT_NOT_FOUND);
52 return EOF;
55 ASSERT_VALID_PTR(BADDR(file));
56 ASSERT_VALID_PTR(string);
58 ULONG
59 len = strlen(string);
61 return(FWriteChars(file, string, len, DOSBase) == len
62 ? 0
63 : -1);
65 AROS_LIBFUNC_EXIT
66 } /* FPuts */