- Cleanup the /lib directory, by putting more 3rd-party libs in /3rdparty, and by...
[reactos.git] / reactos / lib / sdk / crt / stdio / fprintf.c
1 /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
2 #include <precomp.h>
3
4 #include <wchar.h>
5 #include <tchar.h>
6
7 /*
8 * @implemented
9 */
10 int
11 _ftprintf(register FILE *iop, const _TCHAR *fmt, ...)
12 {
13 int len;
14 _TCHAR localbuf[BUFSIZ];
15 va_list a=0;
16
17
18 va_start( a, fmt );
19 if (iop->_flag & _IONBF)
20 {
21 iop->_flag &= ~_IONBF;
22 iop->_ptr = iop->_base = (char *)localbuf;
23 iop->_bufsiz = BUFSIZ;
24 len = _vftprintf(iop,fmt,a);
25 fflush(iop);
26 iop->_flag |= _IONBF;
27 iop->_base = NULL;
28 iop->_bufsiz = 0;
29 iop->_cnt = 0;
30 }
31 else
32 len = _vftprintf(iop, fmt, a);
33 return ferror(iop) ? -1 : len;
34 }