Don't call ReadArgs() if started from WB.
[tangerine.git] / compiler / clib / vfprintf.c
blobe9d4fe04a6d3a274cd2370421499f7709fa08445
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Format a string and call a usercallback to output each char.
6 */
7 /* Original source from libnix */
10 #include <proto/dos.h>
11 #include <errno.h>
12 #include "__errno.h"
13 #include "__open.h"
15 static int __putc(int c, BPTR fh);
17 /*****************************************************************************
19 NAME */
20 #include <stdio.h>
21 #include <stdarg.h>
23 int vfprintf (
25 /* SYNOPSIS */
26 FILE * stream,
27 const char * format,
28 va_list args)
30 /* FUNCTION
31 Format a list of arguments and print them on the specified stream.
33 INPUTS
34 stream - A stream on which one can write
35 format - A printf() format string.
36 args - A list of arguments for the format string.
38 RESULT
39 The number of characters written.
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 INTERNALS
51 ******************************************************************************/
53 fdesc *fdesc = __getfdesc(stream->fd);
55 if (!fdesc)
57 errno = EBADF;
58 return 0;
61 return __vcformat (fdesc->fh, __putc, format, args);
62 } /* vfprintf */
65 static int __putc(int c, BPTR fh)
67 AROS_GET_SYSBASE_OK
68 AROS_GET_DOSBASE
69 if (FPutC(fh, c) == EOF)
71 errno = IoErr2errno(IoErr());
72 return EOF;
75 return c;