Lines Matching refs:src
156 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
166 int32_t ret = utf32_at_internal(src + index, &num_read); in utf32_from_utf8_at()
174 ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len) in utf32_to_utf8_length() argument
176 if (src == NULL || src_len == 0) { in utf32_to_utf8_length()
181 const char32_t *end = src + src_len; in utf32_to_utf8_length()
182 while (src < end) { in utf32_to_utf8_length()
183 ret += utf32_codepoint_utf8_length(*src++); in utf32_to_utf8_length()
188 void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst, size_t dst_len) in utf32_to_utf8() argument
190 if (src == NULL || src_len == 0 || dst == NULL) { in utf32_to_utf8()
194 const char32_t *cur_utf32 = src; in utf32_to_utf8()
195 const char32_t *end_utf32 = src + src_len; in utf32_to_utf8()
245 char16_t *strcpy16(char16_t *dst, const char16_t *src) in strcpy16() argument
248 const char16_t *p = src; in strcpy16()
267 char16_t *strncpy16(char16_t *dst, const char16_t *src, size_t n) in strncpy16() argument
270 const char16_t *p = src; in strncpy16()
298 char16_t* strstr16(const char16_t* src, const char16_t* target) in strstr16() argument
305 if (*src == '\0') { in strstr16()
308 } while (*src++ != needle); in strstr16()
309 } while (strncmp16(src, target, target_len) != 0); in strstr16()
310 src--; in strstr16()
313 return (char16_t*)src; in strstr16()
357 void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst, size_t dst_len) in utf16_to_utf8() argument
359 if (src == NULL || src_len == 0 || dst == NULL) { in utf16_to_utf8()
363 const char16_t* cur_utf16 = src; in utf16_to_utf8()
364 const char16_t* const end_utf16 = src + src_len; in utf16_to_utf8()
391 ssize_t utf8_length(const char *src) in utf8_length() argument
393 const char *cur = src; in utf8_length()
434 ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len) in utf16_to_utf8_length() argument
436 if (src == NULL || src_len == 0) { in utf16_to_utf8_length()
441 const char16_t* const end = src + src_len; in utf16_to_utf8_length()
442 while (src < end) { in utf16_to_utf8_length()
443 if ((*src & 0xFC00) == 0xD800 && (src + 1) < end in utf16_to_utf8_length()
444 && (*(src + 1) & 0xFC00) == 0xDC00) { in utf16_to_utf8_length()
447 src += 2; in utf16_to_utf8_length()
449 ret += utf32_codepoint_utf8_length((char32_t) *src++); in utf16_to_utf8_length()
475 size_t utf8_to_utf32_length(const char *src, size_t src_len) in utf8_to_utf32_length() argument
477 if (src == NULL || src_len == 0) { in utf8_to_utf32_length()
484 for (cur = src, end = src + src_len, num_to_skip = 1; in utf8_to_utf32_length()
500 void utf8_to_utf32(const char* src, size_t src_len, char32_t* dst) in utf8_to_utf32() argument
502 if (src == NULL || src_len == 0 || dst == NULL) { in utf8_to_utf32()
506 const char* cur = src; in utf8_to_utf32()
507 const char* const end = src + src_len; in utf8_to_utf32()
517 static inline uint32_t utf8_to_utf32_codepoint(const uint8_t *src, size_t length) in utf8_to_utf32_codepoint() argument
524 return src[0]; in utf8_to_utf32_codepoint()
526 unicode = src[0] & 0x1f; in utf8_to_utf32_codepoint()
527 utf8_shift_and_mask(&unicode, src[1]); in utf8_to_utf32_codepoint()
530 unicode = src[0] & 0x0f; in utf8_to_utf32_codepoint()
531 utf8_shift_and_mask(&unicode, src[1]); in utf8_to_utf32_codepoint()
532 utf8_shift_and_mask(&unicode, src[2]); in utf8_to_utf32_codepoint()
535 unicode = src[0] & 0x07; in utf8_to_utf32_codepoint()
536 utf8_shift_and_mask(&unicode, src[1]); in utf8_to_utf32_codepoint()
537 utf8_shift_and_mask(&unicode, src[2]); in utf8_to_utf32_codepoint()
538 utf8_shift_and_mask(&unicode, src[3]); in utf8_to_utf32_codepoint()
596 const uint8_t* src, size_t srcLen, char16_t* dst, size_t dstLen) { in utf8_to_utf16_no_null_terminator() argument
602 const uint8_t* const u8end = src + srcLen; in utf8_to_utf16_no_null_terminator()
603 const uint8_t* u8cur = src; in utf8_to_utf16_no_null_terminator()