source:
EcnlProtoTool/trunk/musl-1.1.18/src/multibyte/mbrtoc32.c
Last change on this file was 444, checked in by , 4 years ago | |
---|---|
|
|
File size: 354 bytes |
Line | |
---|---|
1 | #include <uchar.h> |
2 | #include <wchar.h> |
3 | |
4 | size_t mbrtoc32(char32_t *restrict pc32, const char *restrict s, size_t n, mbstate_t *restrict ps) |
5 | { |
6 | static unsigned internal_state; |
7 | if (!ps) ps = (void *)&internal_state; |
8 | if (!s) return mbrtoc32(0, "", 1, ps); |
9 | wchar_t wc; |
10 | size_t ret = mbrtowc(&wc, s, n, ps); |
11 | if (ret <= 4 && pc32) *pc32 = wc; |
12 | return ret; |
13 | } |
Note:
See TracBrowser
for help on using the repository browser.