#include <wchar.h>
size_t wcsnrtombs(size_t dsize;
char dest[restrict dsize],
const wchar_t **restrict src,
size_t nwc, size_t dsize, mbstate_t *restrict ps);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
wcsnrtombs():
Since glibc 2.10:
_POSIX_C_SOURCE >= 200809L
Before glibc 2.10:
_GNU_SOURCE
If dest is not NULL, the wcsnrtombs() function converts at most nwc wide characters from the wide-character string *src to a multibyte string starting at dest. At most dsize bytes are written to dest. The shift state *ps is updated. The conversion is effectively performed by repeatedly calling wcrtomb(dest, *src, ps), as long as this call succeeds, and then incrementing dest by the number of bytes written and *src by one. The conversion can stop for three reasons:
If dest is NULL, dsize is ignored, and the conversion proceeds as above, except that the converted bytes are not written out to memory, and that no destination size limit exists.
上記のいずれの場合も、ps が NULL ならば、wcsnrtombs() 関数 だけが知っている静的な匿名の状態がシフト状態の代わりに用いられる。
The programmer must ensure that there is room for at least dsize bytes at dest.
| インターフェース | 属性 | 値 |
| wcsnrtombs() | Thread safety |
MT-Unsafe race:wcsnrtombs/!ps
|
ps に NULL を渡した際の動作はマルチスレッドセーフでない。