Loading...
--- Libc/Libc-1725.40.4/stdio/FreeBSD/fputws.c
+++ Libc/Libc-583/stdio/FreeBSD/fputws.c
@@ -25,9 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/fputws.c,v 1.8 2009/01/15 18:53:52 rdivacky Exp $");
-
-#include "xlocale_private.h"
+__FBSDID("$FreeBSD: src/lib/libc/stdio/fputws.c,v 1.6 2004/07/21 10:54:57 tjr Exp $");
#include "namespace.h"
#include <errno.h>
@@ -41,18 +39,13 @@
#include "mblocal.h"
int
-fputws_l(const wchar_t * __restrict ws, FILE * __restrict fp, locale_t loc)
+fputws(const wchar_t * __restrict ws, FILE * __restrict fp)
{
size_t nbytes;
char buf[BUFSIZ];
struct __suio uio;
struct __siov iov;
- const wchar_t *wsp = ws;
- size_t (*__wcsnrtombs)(char * __restrict, const wchar_t ** __restrict,
- size_t, size_t, mbstate_t * __restrict, locale_t);
- NORMALIZE_LOCALE(loc);
- __wcsnrtombs = XLOCALE_CTYPE(loc)->__wcsnrtombs;
FLOCKFILE(fp);
ORIENT(fp, 1);
if (prepwrite(fp) != 0)
@@ -61,14 +54,14 @@
uio.uio_iovcnt = 1;
iov.iov_base = buf;
do {
- nbytes = __wcsnrtombs(buf, &wsp, SIZE_T_MAX, sizeof(buf),
- &fp->_mbstate, loc);
+ nbytes = __wcsnrtombs(buf, &ws, SIZE_T_MAX, sizeof(buf),
+ &fp->_extra->mbstate);
if (nbytes == (size_t)-1)
goto error;
iov.iov_len = uio.uio_resid = nbytes;
if (__sfvwrite(fp, &uio) != 0)
goto error;
- } while (wsp != NULL);
+ } while (ws != NULL);
FUNLOCKFILE(fp);
return (0);
@@ -76,9 +69,3 @@
FUNLOCKFILE(fp);
return (-1);
}
-
-int
-fputws(const wchar_t * __restrict ws, FILE * __restrict fp)
-{
- return fputws_l(ws, fp, __current_locale());
-}