Lines Matching refs:src
128 int32_t utf32_from_utf8_at(const char *src, size_t src_len, size_t index, size_t *next_index) in utf32_from_utf8_at() argument
138 int32_t ret = utf32_at_internal(src + index, &num_read); in utf32_from_utf8_at()
146 ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len) in utf32_to_utf8_length() argument
148 if (src == nullptr || src_len == 0) { in utf32_to_utf8_length()
153 const char32_t *end = src + src_len; in utf32_to_utf8_length()
154 while (src < end) { in utf32_to_utf8_length()
155 size_t char_len = utf32_codepoint_utf8_length(*src++); in utf32_to_utf8_length()
168 void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst, size_t dst_len) in utf32_to_utf8() argument
170 if (src == nullptr || src_len == 0 || dst == nullptr) { in utf32_to_utf8()
174 const char32_t *cur_utf32 = src; in utf32_to_utf8()
175 const char32_t *end_utf32 = src + src_len; in utf32_to_utf8()
246 char16_t* strstr16(const char16_t* src, const char16_t* target) in strstr16() argument
249 if (needle == '\0') return (char16_t*)src; in strstr16()
254 if (*src == '\0') { in strstr16()
257 } while (*src++ != needle); in strstr16()
258 } while (strncmp16(src, target, target_len) != 0); in strstr16()
259 src--; in strstr16()
261 return (char16_t*)src; in strstr16()
283 void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst, size_t dst_len) in utf16_to_utf8() argument
285 if (src == nullptr || src_len == 0 || dst == nullptr) { in utf16_to_utf8()
289 const char16_t* cur_utf16 = src; in utf16_to_utf8()
290 const char16_t* const end_utf16 = src + src_len; in utf16_to_utf8()
317 ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len) in utf16_to_utf8_length() argument
319 if (src == nullptr || src_len == 0) { in utf16_to_utf8_length()
324 const char16_t* const end = src + src_len; in utf16_to_utf8_length()
325 while (src < end) { in utf16_to_utf8_length()
327 if ((*src & 0xFC00) == 0xD800 && (src + 1) < end in utf16_to_utf8_length()
328 && (*(src + 1) & 0xFC00) == 0xDC00) { in utf16_to_utf8_length()
331 src += 2; in utf16_to_utf8_length()
333 char_len = utf32_codepoint_utf8_length((char32_t)*src++); in utf16_to_utf8_length()
367 static inline uint32_t utf8_to_utf32_codepoint(const uint8_t *src, size_t length) in utf8_to_utf32_codepoint() argument
374 return src[0]; in utf8_to_utf32_codepoint()
376 unicode = src[0] & 0x1f; in utf8_to_utf32_codepoint()
377 utf8_shift_and_mask(&unicode, src[1]); in utf8_to_utf32_codepoint()
380 unicode = src[0] & 0x0f; in utf8_to_utf32_codepoint()
381 utf8_shift_and_mask(&unicode, src[1]); in utf8_to_utf32_codepoint()
382 utf8_shift_and_mask(&unicode, src[2]); in utf8_to_utf32_codepoint()
385 unicode = src[0] & 0x07; in utf8_to_utf32_codepoint()
386 utf8_shift_and_mask(&unicode, src[1]); in utf8_to_utf32_codepoint()
387 utf8_shift_and_mask(&unicode, src[2]); in utf8_to_utf32_codepoint()
388 utf8_shift_and_mask(&unicode, src[3]); in utf8_to_utf32_codepoint()
446 const uint8_t* src, size_t srcLen, char16_t* dst, size_t dstLen) { in utf8_to_utf16_no_null_terminator() argument
452 const uint8_t* const u8end = src + srcLen; in utf8_to_utf16_no_null_terminator()
453 const uint8_t* u8cur = src; in utf8_to_utf16_no_null_terminator()