OSDN Git Service

hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git] / libc / stdio / fputws.c
1 /* Copyright (C) 2004       Manuel Novoa III    <mjn3@codepoet.org>
2  *
3  * GNU Library General Public License (LGPL) version 2 or later.
4  *
5  * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
6  */
7
8 #include "_stdio.h"
9
10 libc_hidden_proto(fputws_unlocked)
11
12 libc_hidden_proto(wcslen)
13
14 #ifdef __DO_UNLOCKED
15
16 int fputws_unlocked(const wchar_t *__restrict ws,
17                                           register FILE *__restrict stream)
18 {
19         size_t n = wcslen(ws);
20
21         return (_wstdio_fwrite(ws, n, stream) == n) ? 0 : -1;
22 }
23 libc_hidden_def(fputws_unlocked)
24
25 #ifndef __UCLIBC_HAS_THREADS__
26 strong_alias(fputws_unlocked,fputws)
27 libc_hidden_proto(fputws)
28 libc_hidden_def(fputws)
29 #endif
30
31 #elif defined __UCLIBC_HAS_THREADS__
32
33 int fputws(const wchar_t *__restrict ws, register FILE *__restrict stream)
34 {
35         int retval;
36         __STDIO_AUTO_THREADLOCK_VAR;
37
38         __STDIO_AUTO_THREADLOCK(stream);
39
40         retval = fputws_unlocked(ws, stream);
41
42         __STDIO_AUTO_THREADUNLOCK(stream);
43
44         return retval;
45 }
46 libc_hidden_proto(fputws)
47 libc_hidden_def(fputws)
48
49 #endif