Lines Matching refs:src
153 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
163 int32_t ret = utf32_at_internal(src + index, &num_read); in utf32_from_utf8_at()
171 ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len) in utf32_to_utf8_length() argument
173 if (src == NULL || src_len == 0) { in utf32_to_utf8_length()
178 const char32_t *end = src + src_len; in utf32_to_utf8_length()
179 while (src < end) { in utf32_to_utf8_length()
180 ret += utf32_codepoint_utf8_length(*src++); in utf32_to_utf8_length()
185 void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst) in utf32_to_utf8() argument
187 if (src == NULL || src_len == 0 || dst == NULL) { in utf32_to_utf8()
191 const char32_t *cur_utf32 = src; in utf32_to_utf8()
192 const char32_t *end_utf32 = src + src_len; in utf32_to_utf8()
239 char16_t *strcpy16(char16_t *dst, const char16_t *src) in strcpy16() argument
242 const char16_t *p = src; in strcpy16()
261 char16_t *strncpy16(char16_t *dst, const char16_t *src, size_t n) in strncpy16() argument
264 const char16_t *p = src; in strncpy16()
292 char16_t* strstr16(const char16_t* src, const char16_t* target) in strstr16() argument
299 if (*src == '\0') { in strstr16()
302 } while (*src++ != needle); in strstr16()
303 } while (strncmp16(src, target, target_len) != 0); in strstr16()
304 src--; in strstr16()
307 return (char16_t*)src; in strstr16()
351 void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst) in utf16_to_utf8() argument
353 if (src == NULL || src_len == 0 || dst == NULL) { in utf16_to_utf8()
357 const char16_t* cur_utf16 = src; in utf16_to_utf8()
358 const char16_t* const end_utf16 = src + src_len; in utf16_to_utf8()
382 ssize_t utf8_length(const char *src) in utf8_length() argument
384 const char *cur = src; in utf8_length()
425 ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len) in utf16_to_utf8_length() argument
427 if (src == NULL || src_len == 0) { in utf16_to_utf8_length()
432 const char16_t* const end = src + src_len; in utf16_to_utf8_length()
433 while (src < end) { in utf16_to_utf8_length()
434 if ((*src & 0xFC00) == 0xD800 && (src + 1) < end in utf16_to_utf8_length()
435 && (*++src & 0xFC00) == 0xDC00) { in utf16_to_utf8_length()
438 src++; in utf16_to_utf8_length()
440 ret += utf32_codepoint_utf8_length((char32_t) *src++); in utf16_to_utf8_length()
466 size_t utf8_to_utf32_length(const char *src, size_t src_len) in utf8_to_utf32_length() argument
468 if (src == NULL || src_len == 0) { in utf8_to_utf32_length()
475 for (cur = src, end = src + src_len, num_to_skip = 1; in utf8_to_utf32_length()
491 void utf8_to_utf32(const char* src, size_t src_len, char32_t* dst) in utf8_to_utf32() argument
493 if (src == NULL || src_len == 0 || dst == NULL) { in utf8_to_utf32()
497 const char* cur = src; in utf8_to_utf32()
498 const char* const end = src + src_len; in utf8_to_utf32()
508 static inline uint32_t utf8_to_utf32_codepoint(const uint8_t *src, size_t length) in utf8_to_utf32_codepoint() argument
515 return src[0]; in utf8_to_utf32_codepoint()
517 unicode = src[0] & 0x1f; in utf8_to_utf32_codepoint()
518 utf8_shift_and_mask(&unicode, src[1]); in utf8_to_utf32_codepoint()
521 unicode = src[0] & 0x0f; in utf8_to_utf32_codepoint()
522 utf8_shift_and_mask(&unicode, src[1]); in utf8_to_utf32_codepoint()
523 utf8_shift_and_mask(&unicode, src[2]); in utf8_to_utf32_codepoint()
526 unicode = src[0] & 0x07; in utf8_to_utf32_codepoint()
527 utf8_shift_and_mask(&unicode, src[1]); in utf8_to_utf32_codepoint()
528 utf8_shift_and_mask(&unicode, src[2]); in utf8_to_utf32_codepoint()
529 utf8_shift_and_mask(&unicode, src[3]); in utf8_to_utf32_codepoint()
595 char16_t* utf8_to_utf16_n(const uint8_t* src, size_t srcLen, char16_t* dst, size_t dstLen) { in utf8_to_utf16_n() argument
596 const uint8_t* const u8end = src + srcLen; in utf8_to_utf16_n()
597 const uint8_t* u8cur = src; in utf8_to_utf16_n()