1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2 #include <msvcrt/stdio.h>
3 #include <msvcrt/wchar.h>
4 #include <msvcrt/internal/file.h>
7 fprintf(register FILE *iop
, const char *fmt
, ...)
10 char localbuf
[BUFSIZ
];
15 if (iop
->_flag
& _IONBF
)
17 iop
->_flag
&= ~_IONBF
;
18 iop
->_ptr
= iop
->_base
= localbuf
;
19 iop
->_bufsiz
= BUFSIZ
;
20 len
= vfprintf(iop
,fmt
,a
);
28 len
= vfprintf(iop
, fmt
, a
);
29 return ferror(iop
) ? EOF
: len
;
33 fwprintf(register FILE *iop
, const wchar_t *fmt
, ...)
36 wchar_t localbuf
[BUFSIZ
];
41 if (iop
->_flag
& _IONBF
)
43 iop
->_flag
&= ~_IONBF
;
44 iop
->_ptr
= iop
->_base
= (char *)localbuf
;
45 iop
->_bufsiz
= BUFSIZ
;
46 len
= vfwprintf(iop
,fmt
,a
);
54 len
= vfwprintf(iop
, fmt
, a
);
55 return ferror(iop
) ? EOF
: len
;