22#ifndef LELY_UTIL_USTRING_H_
23#define LELY_UTIL_USTRING_H_
30#ifndef LELY_UTIL_USTRING_INLINE
31#define LELY_UTIL_USTRING_INLINE static inline
46LELY_UTIL_USTRING_INLINE
size_t str16len(
const char16_t *s);
61LELY_UTIL_USTRING_INLINE
char16_t *
str16ncpy(
62 char16_t *dst,
const char16_t *src,
size_t n);
75 const char16_t *s1,
const char16_t *s2,
size_t n);
77LELY_UTIL_USTRING_INLINE
size_t
80 const char16_t *cp = s;
87LELY_UTIL_USTRING_INLINE
char16_t *
88str16ncpy(
char16_t *dst,
const char16_t *src,
size_t n)
91 for (; (n != 0) && (*src != 0); n--, cp++, src++)
99LELY_UTIL_USTRING_INLINE
int
100str16ncmp(
const char16_t *s1,
const char16_t *s2,
size_t n)
102 for (; n != 0; n--, s1++, s2++) {
103 const int cmp = *s1 - *s2;
104 if ((cmp != 0) || (*s1 == 0))
This header file is part of the C11 and POSIX compatibility library; it includes <stddef....
This header file is part of the C11 and POSIX compatibility library; it includes <uchar....
int str16ncmp(const char16_t *s1, const char16_t *s2, size_t n)
Compares two (16-bit) Unicode strings.
char16_t * str16ncpy(char16_t *dst, const char16_t *src, size_t n)
Copies n (16-bit) Unicode characters from the string at src to dst.
size_t str16len(const char16_t *s)
Returns the number of (16-bit) Unicode characters, excluding the terminating null bytes,...