17 #include "lt-memory.h"
20 #define Realloc srealloc
33 int strcasecmp8(
const char8 *s1,
const char8 *s2)
41 if(c1 == 0 && c2 == 0)
54 int strncasecmp8(
const char8 *s1,
const char8 *s2,
size_t n)
62 if(c1 == 0 && c2 == 0)
77 char8 *strdup8(
const char8 *s)
83 buf = Malloc(len + 1);
99 char16 *char8tochar16(
const char8 *s)
101 static char16 *buf = 0;
105 buf = Realloc(buf, (len + 1) *
sizeof(char16));
118 char8 *char16tochar8(
const char16 *s)
120 static char8 *buf = 0;
124 buf = Realloc(buf, len + 1);
129 buf[i] = s[i] > 255 ?
'X' : s[i];
135 char16 *strcpy16(char16 *s1,
const char16 *s2)
146 char16 *strncpy16(char16 *s1,
const char16 *s2,
size_t n)
150 while(n-- > 0 && *s2)
158 char16 *strdup16(
const char16 *s)
164 buf = Malloc((len + 1) *
sizeof(char16));
173 size_t strlen16(
const char16 *s)
183 char16 *strchr16(
const char16 *s,
int c)
192 int strcmp16(
const char16 *s1,
const char16 *s2)
200 if(c1 == 0 && c2 == 0)
213 int strncmp16(
const char16 *s1,
const char16 *s2,
size_t n)
221 if(c1 == 0 && c2 == 0)
238 int strcasecmp16(
const char16 *s1,
const char16 *s2)
246 if(c1 == 0 && c2 == 0)
259 int strncasecmp16(
const char16 *s1,
const char16 *s2,
size_t n)
267 if(c1 == 0 && c2 == 0)
284 char16 *strstr16(
const char16 *s1,
const char16 *s2)
294 while((s1 = strchr16(s1, first)))
296 if(strncmp16(s1, s2, len) == 0)