1 /* c32rtomb( char *, char32_t, mbstate_t * )
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
13 #include "_PDCLIB_encoding.h"
14 #include "_PDCLIB_locale.h"
19 mbstate_t *restrict ps,
23 char buf[s ? 0 : MB_CUR_MAX];
26 const char32_t *restrict psrc = &c32;
28 size_t dstsz = MB_CUR_MAX;
29 size_t dstrem = dstsz;
31 if(l->_Codec->__c32stombs(&s, &dstrem, &psrc, &srcsz, ps)) {
32 // Successful conversion
33 return dstsz - dstrem;
43 mbstate_t *restrict ps
46 return c32rtomb_l(s, c32, ps, _PDCLIB_threadlocale());
52 #include "_PDCLIB_test.h"
56 TESTCASE( NO_TESTDRIVER );