Updated PCI IDs to latest snapshot.
[tangerine.git] / rom / dos / vprintf.c
blob0da474e992f75eab7d04b858c020b843c32aa8a9
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #include <proto/exec.h>
10 #include <dos/dos.h>
11 #include <aros/asmcall.h>
12 #include "dos_intern.h"
14 AROS_UFP2(void, vfp_hook,
15 AROS_UFPA(UBYTE, chr, D0),
16 AROS_UFPA(struct vfp *, vfp, A3)
19 /*****************************************************************************
21 NAME */
22 #include <proto/dos.h>
24 AROS_LH2(LONG, VPrintf,
26 /* SYNOPSIS */
27 AROS_LHA(CONST_STRPTR, format, D1),
28 AROS_LHA(IPTR *, argarray, D2),
30 /* LOCATION */
31 struct DosLibrary *, DOSBase, 159, Dos)
33 /* FUNCTION
34 Writes a formatted string to standard output.
36 INPUTS
37 format - RawDoFmt like format string
38 argarray - Pointer to array of formatting values
40 RESULT
41 Number of bytes written or -1 for an error
43 NOTES
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 INTERNALS
53 *****************************************************************************/
55 AROS_LIBFUNC_INIT
57 struct vfp vfp;
58 BPTR file = ((struct Process *)FindTask(NULL))->pr_COS;
60 vfp.file = file;
61 vfp.count = 0;
62 vfp.DOSBase = DOSBase;
64 (void)RawDoFmt(format, argarray,
65 (VOID_FUNC)AROS_ASMSYMNAME(vfp_hook), &vfp);
67 /* Remove the last character (which is a NUL character) */
69 if (vfp.count > 0)
71 vfp.count--;
72 ((struct FileHandle *)BADDR(file))->fh_Pos--;
76 return vfp.count;
77 AROS_LIBFUNC_EXIT
78 } /* VPrintf */