2 char *_PDCLIB_restrict dst,
3 const char32_t **_PDCLIB_restrict src,
5 mbstate_t *_PDCLIB_restrict ps);
7 This file is part of the Public Domain C Library (PDCLib).
8 Permission is granted to use, modify, and / or redistribute at will.
15 #include <_PDCLIB_encoding.h>
16 #include <_PDCLIB_locale.h>
18 size_t _PDCLIB_c32srtombs_l(
20 const char32_t **restrict src,
22 mbstate_t *restrict ps,
23 _PDCLIB_locale_t restrict l)
25 char *restrict *restrict dstp = dst ? &dst : NULL;
26 len = dst ? len : SIZE_MAX;
28 size_t srclen = _PDCLIB_c32slen(*src);
31 if(l->_Codec->__c32stombs(dstp, &dstlen, src, &srclen, ps)) {
32 // Successful conversion
41 size_t _PDCLIB_c32srtombs(
43 const char32_t **restrict src,
45 mbstate_t *restrict ps
48 return _PDCLIB_c32srtombs_l(dst, src, len, ps, _PDCLIB_threadlocale());
54 #include <_PDCLIB_test.h>
58 TESTCASE( NO_TESTDRIVER );