|
Last change
on this file since 5755 was 5450, checked in by sandervl, 25 years ago |
|
Wine's unicode translation functions & tables
|
|
File size:
790 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * Unicode string manipulation functions
|
|---|
| 3 | *
|
|---|
| 4 | * Copyright 2000 Alexandre Julliard
|
|---|
| 5 | */
|
|---|
| 6 |
|
|---|
| 7 | #include "wine/unicode.h"
|
|---|
| 8 |
|
|---|
| 9 | int strcmpiW( const WCHAR *str1, const WCHAR *str2 )
|
|---|
| 10 | {
|
|---|
| 11 | for (;;)
|
|---|
| 12 | {
|
|---|
| 13 | int ret = toupperW(*str1) - toupperW(*str2);
|
|---|
| 14 | if (ret || !*str1) return ret;
|
|---|
| 15 | str1++;
|
|---|
| 16 | str2++;
|
|---|
| 17 | }
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | int strncmpiW( const WCHAR *str1, const WCHAR *str2, int n )
|
|---|
| 21 | {
|
|---|
| 22 | int ret = 0;
|
|---|
| 23 | for ( ; n > 0; n--, str1++, str2++)
|
|---|
| 24 | if ((ret = toupperW(*str1) - toupperW(*str2)) || !*str1) break;
|
|---|
| 25 | return ret;
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | WCHAR *strstrW( const WCHAR *str, const WCHAR *sub )
|
|---|
| 29 | {
|
|---|
| 30 | while (*str)
|
|---|
| 31 | {
|
|---|
| 32 | const WCHAR *p1 = str, *p2 = sub;
|
|---|
| 33 | while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
|
|---|
| 34 | if (!*p2) return (WCHAR *)str;
|
|---|
| 35 | str++;
|
|---|
| 36 | }
|
|---|
| 37 | return NULL;
|
|---|
| 38 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.