1 #include <newlib.h> 2 3 #ifdef _FVWRITE_IN_STREAMIO 4 5 #include <stdio.h> 6 #include <wchar.h> 7 #include "fvwrite.h" 8 9 extern int __ssputs (FILE *fp, const char *buf, 10 size_t len); 11 12 int __sswprint(FILE * fp,register struct __suio * uio)13__sswprint ( 14 FILE *fp, 15 register struct __suio *uio) 16 { 17 register struct __siov *iov = uio->uio_iov; 18 register size_t len; 19 int ret = 0; 20 21 while (uio->uio_resid > 0 && uio->uio_iovcnt-- > 0) { 22 if ((len = iov->iov_len) > 0) { 23 if (__ssputs (fp, iov->iov_base, 24 len * sizeof (wchar_t)) == EOF) { 25 ret = -1; 26 break; 27 } 28 uio->uio_resid -= len; /* pretend we copied all */ 29 } 30 iov++; 31 } 32 uio->uio_resid = 0; 33 uio->uio_iovcnt = 0; 34 return ret; 35 } 36 37 #endif 38