From 16cc2b87530947415dcff6e545bdd77a232edbb1 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 20 Dec 2012 08:43:27 +0400 Subject: [PATCH] shlwapi: Implement IsCharSpaceA(). --- dlls/shlwapi/ordinal.c | 19 ------------------- dlls/shlwapi/shlwapi.spec | 1 + dlls/shlwapi/string.c | 25 +++++++++++++++++++++++++ include/shlwapi.h | 4 ++++ 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 88f415b7200..19ab3d9aa34 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -637,25 +637,6 @@ INT WINAPI SHStringFromGUIDW(REFGUID guid, LPWSTR lpszDest, INT cchMax) return iLen; } -/************************************************************************* - * @ [SHLWAPI.29] - * - * Determine if a Unicode character is a space. - * - * PARAMS - * wc [I] Character to check. - * - * RETURNS - * TRUE, if wc is a space, - * FALSE otherwise. - */ -BOOL WINAPI IsCharSpaceW(WCHAR wc) -{ - WORD CharType; - - return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_SPACE); -} - /************************************************************************* * @ [SHLWAPI.30] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index 025d48afe62..bf33e62879b 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -566,6 +566,7 @@ @ stdcall HashData (ptr long ptr long) @ stdcall IntlStrEqWorkerA(long str str long) StrIsIntlEqualA @ stdcall IntlStrEqWorkerW(long wstr wstr long) StrIsIntlEqualW +@ stdcall IsCharSpaceA(long) @ stdcall PathAddBackslashA (str) @ stdcall PathAddBackslashW (wstr) @ stdcall PathAddExtensionA (str str) diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c index 18606ce021b..1a4ad146439 100644 --- a/dlls/shlwapi/string.c +++ b/dlls/shlwapi/string.c @@ -2824,3 +2824,28 @@ end: HeapFree(GetProcessHeap(), 0, dllname); return hr; } + +BOOL WINAPI IsCharSpaceA(CHAR c) +{ + WORD CharType; + return GetStringTypeA(GetSystemDefaultLCID(), CT_CTYPE1, &c, 1, &CharType) && (CharType & C1_SPACE); +} + +/************************************************************************* + * @ [SHLWAPI.29] + * + * Determine if a Unicode character is a space. + * + * PARAMS + * wc [I] Character to check. + * + * RETURNS + * TRUE, if wc is a space, + * FALSE otherwise. + */ +BOOL WINAPI IsCharSpaceW(WCHAR wc) +{ + WORD CharType; + + return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_SPACE); +} diff --git a/include/shlwapi.h b/include/shlwapi.h index 067ef7b2138..a1436fa9d94 100644 --- a/include/shlwapi.h +++ b/include/shlwapi.h @@ -935,6 +935,10 @@ HRESULT WINAPI StrRetToBufW(STRRET*,LPCITEMIDLIST,LPWSTR,UINT); HRESULT WINAPI StrRetToBSTR(STRRET*,LPCITEMIDLIST,BSTR*); +BOOL WINAPI IsCharSpaceA(CHAR); +BOOL WINAPI IsCharSpaceW(WCHAR); +#define IsCharSpace WINELIB_NAME_AW(IsCharSpace) + #endif /* NO_SHLWAPI_STRFCNS */