source: asp3_tinet_ecnl_arm/trunk/musl-1.1.18/src/stdio/fgetws.c@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 427 bytes
Line 
1#include "stdio_impl.h"
2#include <wchar.h>
3
4wint_t __fgetwc_unlocked(FILE *);
5
6wchar_t *fgetws(wchar_t *restrict s, int n, FILE *restrict f)
7{
8 wchar_t *p = s;
9
10 if (!n--) return s;
11
12 FLOCK(f);
13
14 for (; n; n--) {
15 wint_t c = __fgetwc_unlocked(f);
16 if (c == WEOF) break;
17 *p++ = c;
18 if (c == '\n') break;
19 }
20 *p = 0;
21 if (ferror(f)) p = s;
22
23 FUNLOCK(f);
24
25 return (p == s) ? NULL : s;
26}
27
28weak_alias(fgetws, fgetws_unlocked);
Note: See TracBrowser for help on using the repository browser.