Lines Matching defs:output
104 static uint16_t *wchar_to_utf16(uint16_t *output, wchar_t wc, size_t outsize)
109 output[0] = cpu_to_le16(wc);
110 return output + 1;
115 output[0] = cpu_to_le16(0xd800 | ((wc >> 10) & 0x3ff));
116 output[1] = cpu_to_le16(0xdc00 | (wc & 0x3ff));
117 return output + 2;
120 int utf8_to_utf16(uint16_t *output, const char *input, size_t outsize,
124 uint16_t *outp = output;
133 outp = wchar_to_utf16(outp, wc, outsize - (outp - output));
159 static char *wchar_to_utf8(char *output, wchar_t wc, size_t outsize)
164 *output++ = (char) wc;
168 *output++ = 0xc0 | (wc >> 6);
169 *output++ = 0x80 | (wc & 0x3f);
173 *output++ = 0xe0 | (wc >> 12);
174 *output++ = 0x80 | ((wc >> 6) & 0x3f);
175 *output++ = 0x80 | (wc & 0x3f);
179 *output++ = 0xf0 | (wc >> 18);
180 *output++ = 0x80 | ((wc >> 12) & 0x3f);
181 *output++ = 0x80 | ((wc >> 6) & 0x3f);
182 *output++ = 0x80 | (wc & 0x3f);
186 *output++ = 0xf8 | (wc >> 24);
187 *output++ = 0x80 | ((wc >> 18) & 0x3f);
188 *output++ = 0x80 | ((wc >> 12) & 0x3f);
189 *output++ = 0x80 | ((wc >> 6) & 0x3f);
190 *output++ = 0x80 | (wc & 0x3f);
194 *output++ = 0xfc | (wc >> 30);
195 *output++ = 0x80 | ((wc >> 24) & 0x3f);
196 *output++ = 0x80 | ((wc >> 18) & 0x3f);
197 *output++ = 0x80 | ((wc >> 12) & 0x3f);
198 *output++ = 0x80 | ((wc >> 6) & 0x3f);
199 *output++ = 0x80 | (wc & 0x3f);
203 return output;
206 int utf16_to_utf8(char *output, const uint16_t *input, size_t outsize,
210 char *outp = output;
219 outp = wchar_to_utf8(outp, wc, outsize - (outp - output));