Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
077fc97a
Commit
077fc97a
authored
Mar 21, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Forward string functions to kernelbase.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ffe6548d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
697 deletions
+24
-697
comctl32.spec
dlls/comctl32/comctl32.spec
+24
-24
string.c
dlls/comctl32/string.c
+0
-673
No files found.
dlls/comctl32/comctl32.spec
View file @
077fc97a
...
...
@@ -63,30 +63,30 @@
342 stdcall -noname SendNotifyEx(long long long ptr long)
344 stdcall -ordinal TaskDialog(long long wstr wstr wstr long wstr ptr)
345 stdcall -ordinal TaskDialogIndirect(ptr ptr ptr ptr)
350 stdcall -noname -private StrChrA(str long)
351 stdcall -noname -private StrRChrA(str str long)
352 stdcall -noname -private StrCmpNA(str str long)
353 stdcall -noname -private StrCmpNIA(str str long)
354 stdcall -noname -private StrStrA(str str)
355 stdcall -noname -private StrStrIA(str str)
356 stdcall -noname -private StrCSpnA(str str)
357 stdcall -noname -private StrToIntA(str)
358 stdcall -noname -private StrChrW(wstr long)
359 stdcall -noname -private StrRChrW(wstr wstr long)
360 stdcall -noname -private StrCmpNW(wstr wstr long)
361 stdcall -noname -private StrCmpNIW(wstr wstr long)
362 stdcall -noname -private StrStrW(wstr wstr)
363 stdcall -noname -private StrStrIW(wstr wstr)
364 stdcall -noname -private StrCSpnW(wstr wstr)
365 stdcall -noname -private StrToIntW(wstr)
366 stdcall -noname -private StrChrIA(str long)
367 stdcall -noname -private StrChrIW(wstr long)
368 stdcall -noname -private StrRChrIA(str str long)
369 stdcall -noname -private StrRChrIW(wstr wstr long)
372 stdcall -noname -private StrRStrIA(str str str)
373 stdcall -noname -private StrRStrIW(wstr wstr wstr)
374 stdcall -noname -private StrCSpnIA(str str)
375 stdcall -noname -private StrCSpnIW(wstr wstr)
350 stdcall -noname -private StrChrA(str long)
kernelbase.StrChrA
351 stdcall -noname -private StrRChrA(str str long)
kernelbase.StrRChrA
352 stdcall -noname -private StrCmpNA(str str long)
kernelbase.StrCmpNA
353 stdcall -noname -private StrCmpNIA(str str long)
kernelbase.StrCmpNIA
354 stdcall -noname -private StrStrA(str str)
kernelbase.StrStrA
355 stdcall -noname -private StrStrIA(str str)
kernelbase.StrStrIA
356 stdcall -noname -private StrCSpnA(str str)
kernelbase.StrCSpnA
357 stdcall -noname -private StrToIntA(str)
kernelbase.StrToIntA
358 stdcall -noname -private StrChrW(wstr long)
kernelbase.StrChrW
359 stdcall -noname -private StrRChrW(wstr wstr long)
kernelbase.StrRChrW
360 stdcall -noname -private StrCmpNW(wstr wstr long)
kernelbase.StrCmpNW
361 stdcall -noname -private StrCmpNIW(wstr wstr long)
kernelbase.StrCmpNIW
362 stdcall -noname -private StrStrW(wstr wstr)
kernelbase.StrStrW
363 stdcall -noname -private StrStrIW(wstr wstr)
kernelbase.StrStrIW
364 stdcall -noname -private StrCSpnW(wstr wstr)
kernelbase.StrCSpnW
365 stdcall -noname -private StrToIntW(wstr)
kernelbase.StrToIntW
366 stdcall -noname -private StrChrIA(str long)
kernelbase.StrChrIA
367 stdcall -noname -private StrChrIW(wstr long)
kernelbase.StrChrIW
368 stdcall -noname -private StrRChrIA(str str long)
kernelbase.StrRChrIA
369 stdcall -noname -private StrRChrIW(wstr wstr long)
kernelbase.StrRChrIW
372 stdcall -noname -private StrRStrIA(str str str)
kernelbase.StrRStrIA
373 stdcall -noname -private StrRStrIW(wstr wstr wstr)
kernelbase.StrRStrIW
374 stdcall -noname -private StrCSpnIA(str str)
kernelbase.StrCSpnIA
375 stdcall -noname -private StrCSpnIW(wstr wstr)
kernelbase.StrCSpnIW
376 stdcall -noname -private IntlStrEqWorkerA(long str str long)
377 stdcall -noname -private IntlStrEqWorkerW(long wstr wstr long)
380 stdcall -ordinal LoadIconMetric(ptr wstr long ptr)
...
...
dlls/comctl32/string.c
View file @
077fc97a
...
...
@@ -32,90 +32,10 @@
#include "winnls.h"
#include "comctl32.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
commctrl
);
/*************************************************************************
* COMCTL32_ChrCmpHelperA
*
* Internal helper for ChrCmpA/COMCTL32_ChrCmpIA.
*
* NOTES
* Both this function and its Unicode counterpart are very inefficient. To
* fix this, CompareString must be completely implemented and optimised
* first. Then the core character test can be taken out of that function and
* placed here, so that it need never be called at all. Until then, do not
* attempt to optimise this code unless you are willing to test that it
* still performs correctly.
*/
static
BOOL
COMCTL32_ChrCmpHelperA
(
WORD
ch1
,
WORD
ch2
,
DWORD
dwFlags
)
{
char
str1
[
3
],
str2
[
3
];
str1
[
0
]
=
LOBYTE
(
ch1
);
if
(
IsDBCSLeadByte
(
str1
[
0
]))
{
str1
[
1
]
=
HIBYTE
(
ch1
);
str1
[
2
]
=
'\0'
;
}
else
str1
[
1
]
=
'\0'
;
str2
[
0
]
=
LOBYTE
(
ch2
);
if
(
IsDBCSLeadByte
(
str2
[
0
]))
{
str2
[
1
]
=
HIBYTE
(
ch2
);
str2
[
2
]
=
'\0'
;
}
else
str2
[
1
]
=
'\0'
;
return
CompareStringA
(
GetThreadLocale
(),
dwFlags
,
str1
,
-
1
,
str2
,
-
1
)
-
CSTR_EQUAL
;
}
/*************************************************************************
* COMCTL32_ChrCmpA (internal)
*
* Internal helper function.
*/
static
BOOL
COMCTL32_ChrCmpA
(
WORD
ch1
,
WORD
ch2
)
{
return
COMCTL32_ChrCmpHelperA
(
ch1
,
ch2
,
0
);
}
/*************************************************************************
* COMCTL32_ChrCmpIA (internal)
*
* Compare two characters, ignoring case.
*
* PARAMS
* ch1 [I] First character to compare
* ch2 [I] Second character to compare
*
* RETURNS
* FALSE, if the characters are equal.
* Non-zero otherwise.
*/
static
BOOL
COMCTL32_ChrCmpIA
(
WORD
ch1
,
WORD
ch2
)
{
TRACE
(
"(%d,%d)
\n
"
,
ch1
,
ch2
);
return
COMCTL32_ChrCmpHelperA
(
ch1
,
ch2
,
NORM_IGNORECASE
);
}
/*************************************************************************
* COMCTL32_ChrCmpIW
*
* Internal helper function.
*/
static
inline
BOOL
COMCTL32_ChrCmpIW
(
WCHAR
ch1
,
WCHAR
ch2
)
{
return
CompareStringW
(
GetThreadLocale
(),
NORM_IGNORECASE
,
&
ch1
,
1
,
&
ch2
,
1
)
-
CSTR_EQUAL
;
}
/**************************************************************************
* Str_GetPtrA [COMCTL32.233]
*
...
...
@@ -249,599 +169,6 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
return
TRUE
;
}
/**************************************************************************
* StrChrA [COMCTL32.350]
*
* Find a given character in a string.
*
* PARAMS
* lpszStr [I] String to search in.
* ch [I] Character to search for.
*
* RETURNS
* Success: A pointer to the first occurrence of ch in lpszStr, or NULL if
* not found.
* Failure: NULL, if any arguments are invalid.
*/
LPSTR
WINAPI
StrChrA
(
LPCSTR
lpszStr
,
WORD
ch
)
{
TRACE
(
"(%s,%i)
\n
"
,
debugstr_a
(
lpszStr
),
ch
);
if
(
lpszStr
)
{
while
(
*
lpszStr
)
{
if
(
!
COMCTL32_ChrCmpA
(
*
lpszStr
,
ch
))
return
(
LPSTR
)
lpszStr
;
lpszStr
=
CharNextA
(
lpszStr
);
}
}
return
NULL
;
}
/**************************************************************************
* StrCmpNIA [COMCTL32.353]
*
* Compare two strings, up to a maximum length, ignoring case.
*
* PARAMS
* lpszStr [I] First string to compare
* lpszComp [I] Second string to compare
* iLen [I] Number of chars to compare
*
* RETURNS
* An integer less than, equal to or greater than 0, indicating that
* lpszStr is less than, the same, or greater than lpszComp.
*/
INT
WINAPI
StrCmpNIA
(
LPCSTR
lpszStr
,
LPCSTR
lpszComp
,
INT
iLen
)
{
TRACE
(
"(%s,%s,%i)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszComp
),
iLen
);
return
CompareStringA
(
GetThreadLocale
(),
NORM_IGNORECASE
,
lpszStr
,
iLen
,
lpszComp
,
iLen
)
-
CSTR_EQUAL
;
}
/*************************************************************************
* StrCmpNIW [COMCTL32.361]
*
* See StrCmpNIA.
*/
INT
WINAPI
StrCmpNIW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszComp
,
INT
iLen
)
{
TRACE
(
"(%s,%s,%i)
\n
"
,
debugstr_w
(
lpszStr
),
debugstr_w
(
lpszComp
),
iLen
);
return
CompareStringW
(
GetThreadLocale
(),
NORM_IGNORECASE
,
lpszStr
,
iLen
,
lpszComp
,
iLen
)
-
CSTR_EQUAL
;
}
/*************************************************************************
* COMCTL32_StrStrHelperA
*
* Internal implementation of StrStrA/StrStrIA
*/
static
LPSTR
COMCTL32_StrStrHelperA
(
LPCSTR
lpszStr
,
LPCSTR
lpszSearch
,
INT
(
WINAPI
*
pStrCmpFn
)(
LPCSTR
,
LPCSTR
,
INT
))
{
size_t
iLen
;
LPCSTR
end
;
if
(
!
lpszStr
||
!
lpszSearch
||
!*
lpszSearch
)
return
NULL
;
iLen
=
strlen
(
lpszSearch
);
end
=
lpszStr
+
strlen
(
lpszStr
);
while
(
lpszStr
+
iLen
<=
end
)
{
if
(
!
pStrCmpFn
(
lpszStr
,
lpszSearch
,
iLen
))
return
(
LPSTR
)
lpszStr
;
lpszStr
=
CharNextA
(
lpszStr
);
}
return
NULL
;
}
/**************************************************************************
* StrStrIA [COMCTL32.355]
*
* Find a substring within a string, ignoring case.
*
* PARAMS
* lpszStr [I] String to search in
* lpszSearch [I] String to look for
*
* RETURNS
* The start of lpszSearch within lpszStr, or NULL if not found.
*/
LPSTR
WINAPI
StrStrIA
(
LPCSTR
lpszStr
,
LPCSTR
lpszSearch
)
{
TRACE
(
"(%s,%s)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszSearch
));
return
COMCTL32_StrStrHelperA
(
lpszStr
,
lpszSearch
,
StrCmpNIA
);
}
/**************************************************************************
* StrToIntA [COMCTL32.357]
*
* Read a signed integer from a string.
*
* PARAMS
* lpszStr [I] String to read integer from
*
* RETURNS
* The signed integer value represented by the string, or 0 if no integer is
* present.
*/
INT
WINAPI
StrToIntA
(
LPCSTR
lpszStr
)
{
return
atoi
(
lpszStr
);
}
/**************************************************************************
* StrStrIW [COMCTL32.363]
*
* See StrStrIA.
*/
LPWSTR
WINAPI
StrStrIW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszSearch
)
{
int
iLen
;
LPCWSTR
end
;
TRACE
(
"(%s,%s)
\n
"
,
debugstr_w
(
lpszStr
),
debugstr_w
(
lpszSearch
));
if
(
!
lpszStr
||
!
lpszSearch
||
!*
lpszSearch
)
return
NULL
;
iLen
=
lstrlenW
(
lpszSearch
);
end
=
lpszStr
+
lstrlenW
(
lpszStr
);
while
(
lpszStr
+
iLen
<=
end
)
{
if
(
!
StrCmpNIW
(
lpszStr
,
lpszSearch
,
iLen
))
return
(
LPWSTR
)
lpszStr
;
lpszStr
++
;
}
return
NULL
;
}
/**************************************************************************
* StrToIntW [COMCTL32.365]
*
* See StrToIntA.
*/
INT
WINAPI
StrToIntW
(
LPCWSTR
lpString
)
{
return
wcstol
(
lpString
,
NULL
,
10
);
}
/*************************************************************************
* COMCTL32_StrSpnHelperA (internal)
*
* Internal implementation of StrSpnA/StrCSpnA/StrCSpnIA
*/
static
int
COMCTL32_StrSpnHelperA
(
LPCSTR
lpszStr
,
LPCSTR
lpszMatch
,
LPSTR
(
WINAPI
*
pStrChrFn
)(
LPCSTR
,
WORD
),
BOOL
bInvert
)
{
LPCSTR
lpszRead
=
lpszStr
;
if
(
lpszStr
&&
*
lpszStr
&&
lpszMatch
)
{
while
(
*
lpszRead
)
{
LPCSTR
lpszTest
=
pStrChrFn
(
lpszMatch
,
*
lpszRead
);
if
(
!
bInvert
&&
!
lpszTest
)
break
;
if
(
bInvert
&&
lpszTest
)
break
;
lpszRead
=
CharNextA
(
lpszRead
);
};
}
return
lpszRead
-
lpszStr
;
}
/**************************************************************************
* StrCSpnA [COMCTL32.356]
*
* Find the length of the start of a string that does not contain certain
* characters.
*
* PARAMS
* lpszStr [I] String to search
* lpszMatch [I] Characters that cannot be in the substring
*
* RETURNS
* The length of the part of lpszStr containing only chars not in lpszMatch,
* or 0 if any parameter is invalid.
*/
int
WINAPI
StrCSpnA
(
LPCSTR
lpszStr
,
LPCSTR
lpszMatch
)
{
TRACE
(
"(%s,%s)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszMatch
));
return
COMCTL32_StrSpnHelperA
(
lpszStr
,
lpszMatch
,
StrChrA
,
TRUE
);
}
/**************************************************************************
* StrChrW [COMCTL32.358]
*
* See StrChrA.
*/
LPWSTR
WINAPI
StrChrW
(
LPCWSTR
lpszStr
,
WCHAR
ch
)
{
LPWSTR
lpszRet
=
NULL
;
TRACE
(
"(%s,%i)
\n
"
,
debugstr_w
(
lpszStr
),
ch
);
if
(
lpszStr
)
lpszRet
=
wcschr
(
lpszStr
,
ch
);
return
lpszRet
;
}
/**************************************************************************
* StrCmpNA [COMCTL32.352]
*
* Compare two strings, up to a maximum length.
*
* PARAMS
* lpszStr [I] First string to compare
* lpszComp [I] Second string to compare
* iLen [I] Number of chars to compare
*
* RETURNS
* An integer less than, equal to or greater than 0, indicating that
* lpszStr is less than, the same, or greater than lpszComp.
*/
INT
WINAPI
StrCmpNA
(
LPCSTR
lpszStr
,
LPCSTR
lpszComp
,
INT
iLen
)
{
TRACE
(
"(%s,%s,%i)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszComp
),
iLen
);
return
CompareStringA
(
GetThreadLocale
(),
0
,
lpszStr
,
iLen
,
lpszComp
,
iLen
)
-
CSTR_EQUAL
;
}
/**************************************************************************
* StrCmpNW [COMCTL32.360]
*
* See StrCmpNA.
*/
INT
WINAPI
StrCmpNW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszComp
,
INT
iLen
)
{
TRACE
(
"(%s,%s,%i)
\n
"
,
debugstr_w
(
lpszStr
),
debugstr_w
(
lpszComp
),
iLen
);
return
CompareStringW
(
GetThreadLocale
(),
0
,
lpszStr
,
iLen
,
lpszComp
,
iLen
)
-
CSTR_EQUAL
;
}
/**************************************************************************
* StrRChrA [COMCTL32.351]
*
* Find the last occurrence of a character in string.
*
* PARAMS
* lpszStr [I] String to search in
* lpszEnd [I] Place to end search, or NULL to search until the end of lpszStr
* ch [I] Character to search for.
*
* RETURNS
* Success: A pointer to the last occurrence of ch in lpszStr before lpszEnd,
* or NULL if not found.
* Failure: NULL, if any arguments are invalid.
*/
LPSTR
WINAPI
StrRChrA
(
LPCSTR
lpszStr
,
LPCSTR
lpszEnd
,
WORD
ch
)
{
LPCSTR
lpszRet
=
NULL
;
TRACE
(
"(%s,%s,%x)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszEnd
),
ch
);
if
(
lpszStr
)
{
WORD
ch2
;
if
(
!
lpszEnd
)
lpszEnd
=
lpszStr
+
lstrlenA
(
lpszStr
);
while
(
*
lpszStr
&&
lpszStr
<=
lpszEnd
)
{
ch2
=
IsDBCSLeadByte
(
*
lpszStr
)
?
*
lpszStr
<<
8
|
lpszStr
[
1
]
:
*
lpszStr
;
if
(
!
COMCTL32_ChrCmpA
(
ch
,
ch2
))
lpszRet
=
lpszStr
;
lpszStr
=
CharNextA
(
lpszStr
);
}
}
return
(
LPSTR
)
lpszRet
;
}
/**************************************************************************
* StrRChrW [COMCTL32.359]
*
* See StrRChrA.
*/
LPWSTR
WINAPI
StrRChrW
(
LPCWSTR
str
,
LPCWSTR
end
,
WORD
ch
)
{
WCHAR
*
ret
=
NULL
;
if
(
!
str
)
return
NULL
;
if
(
!
end
)
end
=
str
+
lstrlenW
(
str
);
while
(
str
<
end
)
{
if
(
*
str
==
ch
)
ret
=
(
WCHAR
*
)
str
;
str
++
;
}
return
ret
;
}
/**************************************************************************
* StrStrA [COMCTL32.354]
*
* Find a substring within a string.
*
* PARAMS
* lpszStr [I] String to search in
* lpszSearch [I] String to look for
*
* RETURNS
* The start of lpszSearch within lpszStr, or NULL if not found.
*/
LPSTR
WINAPI
StrStrA
(
LPCSTR
lpszStr
,
LPCSTR
lpszSearch
)
{
TRACE
(
"(%s,%s)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszSearch
));
return
COMCTL32_StrStrHelperA
(
lpszStr
,
lpszSearch
,
StrCmpNA
);
}
/**************************************************************************
* StrStrW [COMCTL32.362]
*
* See StrStrA.
*/
LPWSTR
WINAPI
StrStrW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszSearch
)
{
if
(
!
lpszStr
||
!
lpszSearch
)
return
NULL
;
return
wcsstr
(
lpszStr
,
lpszSearch
);
}
/*************************************************************************
* StrChrIA [COMCTL32.366]
*
* Find a given character in a string, ignoring case.
*
* PARAMS
* lpszStr [I] String to search in.
* ch [I] Character to search for.
*
* RETURNS
* Success: A pointer to the first occurrence of ch in lpszStr, or NULL if
* not found.
* Failure: NULL, if any arguments are invalid.
*/
LPSTR
WINAPI
StrChrIA
(
LPCSTR
lpszStr
,
WORD
ch
)
{
TRACE
(
"(%s,%i)
\n
"
,
debugstr_a
(
lpszStr
),
ch
);
if
(
lpszStr
)
{
while
(
*
lpszStr
)
{
if
(
!
COMCTL32_ChrCmpIA
(
*
lpszStr
,
ch
))
return
(
LPSTR
)
lpszStr
;
lpszStr
=
CharNextA
(
lpszStr
);
}
}
return
NULL
;
}
/*************************************************************************
* StrChrIW [COMCTL32.367]
*
* See StrChrA.
*/
LPWSTR
WINAPI
StrChrIW
(
LPCWSTR
lpszStr
,
WCHAR
ch
)
{
TRACE
(
"(%s,%i)
\n
"
,
debugstr_w
(
lpszStr
),
ch
);
if
(
lpszStr
)
{
ch
=
towupper
(
ch
);
while
(
*
lpszStr
)
{
if
(
towupper
(
*
lpszStr
)
==
ch
)
return
(
LPWSTR
)
lpszStr
;
lpszStr
++
;
}
lpszStr
=
NULL
;
}
return
(
LPWSTR
)
lpszStr
;
}
/*************************************************************************
* StrRStrIA [COMCTL32.372]
*
* Find the last occurrence of a substring within a string.
*
* PARAMS
* lpszStr [I] String to search in
* lpszEnd [I] End of lpszStr
* lpszSearch [I] String to look for
*
* RETURNS
* The last occurrence lpszSearch within lpszStr, or NULL if not found.
*/
LPSTR
WINAPI
StrRStrIA
(
LPCSTR
lpszStr
,
LPCSTR
lpszEnd
,
LPCSTR
lpszSearch
)
{
LPSTR
lpszRet
=
NULL
;
WORD
ch1
,
ch2
;
INT
iLen
;
TRACE
(
"(%s,%s)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszSearch
));
if
(
!
lpszStr
||
!
lpszSearch
||
!*
lpszSearch
)
return
NULL
;
if
(
IsDBCSLeadByte
(
*
lpszSearch
))
ch1
=
*
lpszSearch
<<
8
|
(
UCHAR
)
lpszSearch
[
1
];
else
ch1
=
*
lpszSearch
;
iLen
=
lstrlenA
(
lpszSearch
);
if
(
!
lpszEnd
)
lpszEnd
=
lpszStr
+
lstrlenA
(
lpszStr
);
else
/* reproduce the broken behaviour on Windows */
lpszEnd
+=
min
(
iLen
-
1
,
lstrlenA
(
lpszEnd
));
while
(
lpszStr
+
iLen
<=
lpszEnd
&&
*
lpszStr
)
{
ch2
=
IsDBCSLeadByte
(
*
lpszStr
)
?
*
lpszStr
<<
8
|
(
UCHAR
)
lpszStr
[
1
]
:
*
lpszStr
;
if
(
!
COMCTL32_ChrCmpIA
(
ch1
,
ch2
))
{
if
(
!
StrCmpNIA
(
lpszStr
,
lpszSearch
,
iLen
))
lpszRet
=
(
LPSTR
)
lpszStr
;
}
lpszStr
=
CharNextA
(
lpszStr
);
}
return
lpszRet
;
}
/*************************************************************************
* StrRStrIW [COMCTL32.373]
*
* See StrRStrIA.
*/
LPWSTR
WINAPI
StrRStrIW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszEnd
,
LPCWSTR
lpszSearch
)
{
LPWSTR
lpszRet
=
NULL
;
INT
iLen
;
TRACE
(
"(%s,%s)
\n
"
,
debugstr_w
(
lpszStr
),
debugstr_w
(
lpszSearch
));
if
(
!
lpszStr
||
!
lpszSearch
||
!*
lpszSearch
)
return
NULL
;
iLen
=
lstrlenW
(
lpszSearch
);
if
(
!
lpszEnd
)
lpszEnd
=
lpszStr
+
lstrlenW
(
lpszStr
);
else
/* reproduce the broken behaviour on Windows */
lpszEnd
+=
min
(
iLen
-
1
,
lstrlenW
(
lpszEnd
));
while
(
lpszStr
+
iLen
<=
lpszEnd
&&
*
lpszStr
)
{
if
(
!
COMCTL32_ChrCmpIW
(
*
lpszSearch
,
*
lpszStr
))
{
if
(
!
StrCmpNIW
(
lpszStr
,
lpszSearch
,
iLen
))
lpszRet
=
(
LPWSTR
)
lpszStr
;
}
lpszStr
++
;
}
return
lpszRet
;
}
/*************************************************************************
* StrCSpnIA [COMCTL32.374]
*
* Find the length of the start of a string that does not contain certain
* characters, ignoring case.
*
* PARAMS
* lpszStr [I] String to search
* lpszMatch [I] Characters that cannot be in the substring
*
* RETURNS
* The length of the part of lpszStr containing only chars not in lpszMatch,
* or 0 if any parameter is invalid.
*/
int
WINAPI
StrCSpnIA
(
LPCSTR
lpszStr
,
LPCSTR
lpszMatch
)
{
TRACE
(
"(%s,%s)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszMatch
));
return
COMCTL32_StrSpnHelperA
(
lpszStr
,
lpszMatch
,
StrChrIA
,
TRUE
);
}
/*************************************************************************
* StrCSpnIW [COMCTL32.375]
*
* See StrCSpnIA.
*/
int
WINAPI
StrCSpnIW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszMatch
)
{
LPCWSTR
lpszRead
=
lpszStr
;
TRACE
(
"(%s,%s)
\n
"
,
debugstr_w
(
lpszStr
),
debugstr_w
(
lpszMatch
));
if
(
lpszStr
&&
*
lpszStr
&&
lpszMatch
)
{
while
(
*
lpszRead
)
{
if
(
StrChrIW
(
lpszMatch
,
*
lpszRead
))
break
;
lpszRead
++
;
}
}
return
lpszRead
-
lpszStr
;
}
/**************************************************************************
* StrRChrIA [COMCTL32.368]
*
* Find the last occurrence of a character in string, ignoring case.
*
* PARAMS
* lpszStr [I] String to search in
* lpszEnd [I] Place to end search, or NULL to search until the end of lpszStr
* ch [I] Character to search for.
*
* RETURNS
* Success: A pointer to the last occurrence of ch in lpszStr before lpszEnd,
* or NULL if not found.
* Failure: NULL, if any arguments are invalid.
*/
LPSTR
WINAPI
StrRChrIA
(
LPCSTR
lpszStr
,
LPCSTR
lpszEnd
,
WORD
ch
)
{
LPCSTR
lpszRet
=
NULL
;
TRACE
(
"(%s,%s,%x)
\n
"
,
debugstr_a
(
lpszStr
),
debugstr_a
(
lpszEnd
),
ch
);
if
(
lpszStr
)
{
WORD
ch2
;
if
(
!
lpszEnd
)
lpszEnd
=
lpszStr
+
lstrlenA
(
lpszStr
);
while
(
*
lpszStr
&&
lpszStr
<=
lpszEnd
)
{
ch2
=
IsDBCSLeadByte
(
*
lpszStr
)
?
*
lpszStr
<<
8
|
lpszStr
[
1
]
:
*
lpszStr
;
if
(
ch
==
ch2
)
lpszRet
=
lpszStr
;
lpszStr
=
CharNextA
(
lpszStr
);
}
}
return
(
LPSTR
)
lpszRet
;
}
/**************************************************************************
* StrRChrIW [COMCTL32.369]
*
* See StrRChrIA.
*/
LPWSTR
WINAPI
StrRChrIW
(
LPCWSTR
str
,
LPCWSTR
end
,
WORD
ch
)
{
WCHAR
*
ret
=
NULL
;
if
(
!
str
)
return
NULL
;
if
(
!
end
)
end
=
str
+
lstrlenW
(
str
);
while
(
str
<
end
)
{
if
(
!
COMCTL32_ChrCmpIW
(
*
str
,
ch
))
ret
=
(
WCHAR
*
)
str
;
str
++
;
}
return
ret
;
}
/*************************************************************************
* StrCSpnW [COMCTL32.364]
*
* See StrCSpnA.
*/
int
WINAPI
StrCSpnW
(
LPCWSTR
lpszStr
,
LPCWSTR
lpszMatch
)
{
if
(
!
lpszStr
||
!
lpszMatch
)
return
0
;
return
wcscspn
(
lpszStr
,
lpszMatch
);
}
/*************************************************************************
* IntlStrEqWorkerA [COMCTL32.376]
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment