Sync up to trunk head.
[reactos.git] / lib / host / wcsfuncs / wcsfuncs.c
index fc40b74..58dafe1 100644 (file)
@@ -18,6 +18,17 @@ SIZE_T utf16_wcslen(PCWSTR str)
     return i;
 }
 
+
+SIZE_T strlenW(PCWSTR str)
+{
+    SIZE_T i;
+
+    for(i = 0; str[i]; i++);
+
+    return i;
+}
+
+
 PWSTR utf16_wcschr(PWSTR str, WCHAR c)
 {
     SIZE_T i;
@@ -30,6 +41,18 @@ PWSTR utf16_wcschr(PWSTR str, WCHAR c)
         return NULL;
 }
 
+PWSTR strchrW(PWSTR str, WCHAR c)
+{
+    SIZE_T i;
+
+    for(i = 0; str[i] && str[i] != c; i++);
+
+    if(str[i])
+        return &str[i];
+    else
+        return NULL;
+}
+
 INT utf16_wcsncmp(PCWSTR string1, PCWSTR string2, size_t count)
 {
     while(count--)
@@ -46,3 +69,20 @@ INT utf16_wcsncmp(PCWSTR string1, PCWSTR string2, size_t count)
 
     return 0;
 }
+
+INT strncmpW(PCWSTR string1, PCWSTR string2, size_t count)
+{
+    while(count--)
+    {
+        if(*string1 != *string2)
+            return 1;
+
+        if(*string1 == 0)
+            return 0;
+
+        string1++;
+        string2++;
+    }
+
+    return 0;
+}