2000-08-04 06:21:02 +02:00
|
|
|
/*
|
2000-08-06 04:42:46 +02:00
|
|
|
* USER string functions
|
2000-08-04 06:21:02 +02:00
|
|
|
*
|
|
|
|
* Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
|
2000-08-06 04:42:46 +02:00
|
|
|
* Copyright 1996 Alexandre Julliard
|
2000-08-04 06:21:02 +02:00
|
|
|
* Copyright 1996 Marcus Meissner
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-08-04 06:21:02 +02:00
|
|
|
*/
|
|
|
|
|
2001-07-18 23:04:23 +02:00
|
|
|
#include "config.h"
|
2003-11-26 23:29:30 +01:00
|
|
|
#include "wine/port.h"
|
2001-07-18 23:04:23 +02:00
|
|
|
|
2000-08-06 04:42:46 +02:00
|
|
|
#include <ctype.h>
|
2000-08-04 06:21:02 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2001-01-22 03:17:29 +01:00
|
|
|
#include <string.h>
|
2000-08-04 06:21:02 +02:00
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
2000-08-04 06:21:02 +02:00
|
|
|
#include "winbase.h"
|
2016-03-29 13:40:57 +02:00
|
|
|
#include "winnls.h"
|
2005-03-29 15:15:44 +02:00
|
|
|
#include "winuser.h"
|
2001-04-16 22:27:16 +02:00
|
|
|
#include "winerror.h"
|
2001-07-18 23:04:23 +02:00
|
|
|
|
|
|
|
#include "wine/exception.h"
|
2002-02-25 21:10:35 +01:00
|
|
|
|
2001-04-16 22:27:16 +02:00
|
|
|
|
2000-08-06 04:42:46 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* CharNextA (USER32.@)
|
|
|
|
*/
|
|
|
|
LPSTR WINAPI CharNextA( LPCSTR ptr )
|
|
|
|
{
|
|
|
|
if (!*ptr) return (LPSTR)ptr;
|
|
|
|
if (IsDBCSLeadByte( ptr[0] ) && ptr[1]) return (LPSTR)(ptr + 2);
|
|
|
|
return (LPSTR)(ptr + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharNextExA (USER32.@)
|
|
|
|
*/
|
|
|
|
LPSTR WINAPI CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags )
|
|
|
|
{
|
|
|
|
if (!*ptr) return (LPSTR)ptr;
|
|
|
|
if (IsDBCSLeadByteEx( codepage, ptr[0] ) && ptr[1]) return (LPSTR)(ptr + 2);
|
|
|
|
return (LPSTR)(ptr + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharNextExW (USER32.@)
|
|
|
|
*/
|
|
|
|
LPWSTR WINAPI CharNextExW( WORD codepage, LPCWSTR ptr, DWORD flags )
|
|
|
|
{
|
|
|
|
/* doesn't make sense, there are no codepages for Unicode */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharNextW (USER32.@)
|
|
|
|
*/
|
|
|
|
LPWSTR WINAPI CharNextW(LPCWSTR x)
|
|
|
|
{
|
|
|
|
if (*x) x++;
|
2000-08-07 04:33:50 +02:00
|
|
|
|
|
|
|
return (LPWSTR)x;
|
2000-08-06 04:42:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharPrevA (USER32.@)
|
|
|
|
*/
|
|
|
|
LPSTR WINAPI CharPrevA( LPCSTR start, LPCSTR ptr )
|
|
|
|
{
|
|
|
|
while (*start && (start < ptr))
|
|
|
|
{
|
|
|
|
LPCSTR next = CharNextA( start );
|
|
|
|
if (next >= ptr) break;
|
|
|
|
start = next;
|
|
|
|
}
|
|
|
|
return (LPSTR)start;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharPrevExA (USER32.@)
|
|
|
|
*/
|
|
|
|
LPSTR WINAPI CharPrevExA( WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags )
|
|
|
|
{
|
|
|
|
while (*start && (start < ptr))
|
|
|
|
{
|
|
|
|
LPCSTR next = CharNextExA( codepage, start, flags );
|
2005-01-28 12:29:37 +01:00
|
|
|
if (next >= ptr) break;
|
2000-08-06 04:42:46 +02:00
|
|
|
start = next;
|
|
|
|
}
|
|
|
|
return (LPSTR)start;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharPrevExW (USER32.@)
|
|
|
|
*/
|
|
|
|
LPSTR WINAPI CharPrevExW( WORD codepage, LPCWSTR start, LPCWSTR ptr, DWORD flags )
|
|
|
|
{
|
|
|
|
/* doesn't make sense, there are no codepages for Unicode */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharPrevW (USER32.@)
|
|
|
|
*/
|
|
|
|
LPWSTR WINAPI CharPrevW(LPCWSTR start,LPCWSTR x)
|
|
|
|
{
|
|
|
|
if (x>start) return (LPWSTR)(x-1);
|
|
|
|
else return (LPWSTR)x;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharToOemA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CharToOemA( LPCSTR s, LPSTR d )
|
|
|
|
{
|
|
|
|
if ( !s || !d ) return TRUE;
|
|
|
|
return CharToOemBuffA( s, d, strlen( s ) + 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharToOemBuffA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CharToOemBuffA( LPCSTR s, LPSTR d, DWORD len )
|
|
|
|
{
|
|
|
|
WCHAR *bufW;
|
|
|
|
|
|
|
|
bufW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
|
|
|
|
if( bufW )
|
|
|
|
{
|
|
|
|
MultiByteToWideChar( CP_ACP, 0, s, len, bufW, len );
|
|
|
|
WideCharToMultiByte( CP_OEMCP, 0, bufW, len, d, len, NULL, NULL );
|
|
|
|
HeapFree( GetProcessHeap(), 0, bufW );
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharToOemBuffW (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CharToOemBuffW( LPCWSTR s, LPSTR d, DWORD len )
|
|
|
|
{
|
2012-12-21 20:18:48 +01:00
|
|
|
if ( !s || !d ) return TRUE;
|
2000-08-06 04:42:46 +02:00
|
|
|
WideCharToMultiByte( CP_OEMCP, 0, s, len, d, len, NULL, NULL );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharToOemW (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d )
|
|
|
|
{
|
2016-03-29 13:40:57 +02:00
|
|
|
return CharToOemBuffW( s, d, lstrlenW( s ) + 1 );
|
2000-08-06 04:42:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* OemToCharA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI OemToCharA( LPCSTR s, LPSTR d )
|
|
|
|
{
|
|
|
|
return OemToCharBuffA( s, d, strlen( s ) + 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* OemToCharBuffA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI OemToCharBuffA( LPCSTR s, LPSTR d, DWORD len )
|
|
|
|
{
|
|
|
|
WCHAR *bufW;
|
|
|
|
|
|
|
|
bufW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
|
|
|
|
if( bufW )
|
|
|
|
{
|
|
|
|
MultiByteToWideChar( CP_OEMCP, 0, s, len, bufW, len );
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, bufW, len, d, len, NULL, NULL );
|
|
|
|
HeapFree( GetProcessHeap(), 0, bufW );
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* OemToCharBuffW (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI OemToCharBuffW( LPCSTR s, LPWSTR d, DWORD len )
|
|
|
|
{
|
|
|
|
MultiByteToWideChar( CP_OEMCP, 0, s, len, d, len );
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* OemToCharW (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI OemToCharW( LPCSTR s, LPWSTR d )
|
|
|
|
{
|
|
|
|
return OemToCharBuffW( s, d, strlen( s ) + 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-14 19:39:15 +02:00
|
|
|
/***********************************************************************
|
2001-01-25 23:22:21 +01:00
|
|
|
* CharLowerA (USER32.@)
|
2000-08-14 19:39:15 +02:00
|
|
|
*/
|
2003-12-12 07:07:28 +01:00
|
|
|
LPSTR WINAPI CharLowerA(LPSTR str)
|
2000-08-14 19:39:15 +02:00
|
|
|
{
|
2010-04-19 10:29:49 +02:00
|
|
|
if (IS_INTRESOURCE(str))
|
2003-12-12 07:07:28 +01:00
|
|
|
{
|
|
|
|
char ch = LOWORD(str);
|
|
|
|
CharLowerBuffA( &ch, 1 );
|
|
|
|
return (LPSTR)(UINT_PTR)(BYTE)ch;
|
|
|
|
}
|
2000-08-14 19:39:15 +02:00
|
|
|
|
2001-04-16 22:27:16 +02:00
|
|
|
__TRY
|
2000-08-14 19:39:15 +02:00
|
|
|
{
|
2003-12-12 07:07:28 +01:00
|
|
|
CharLowerBuffA( str, strlen(str) );
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
2005-12-16 17:17:57 +01:00
|
|
|
__EXCEPT_PAGE_FAULT
|
2001-04-16 22:27:16 +02:00
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
__ENDTRY
|
2003-12-12 07:07:28 +01:00
|
|
|
return str;
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharUpperA (USER32.@)
|
|
|
|
*/
|
2003-12-12 07:07:28 +01:00
|
|
|
LPSTR WINAPI CharUpperA(LPSTR str)
|
2000-08-14 19:39:15 +02:00
|
|
|
{
|
2010-04-19 10:29:49 +02:00
|
|
|
if (IS_INTRESOURCE(str))
|
2003-12-12 07:07:28 +01:00
|
|
|
{
|
|
|
|
char ch = LOWORD(str);
|
|
|
|
CharUpperBuffA( &ch, 1 );
|
|
|
|
return (LPSTR)(UINT_PTR)(BYTE)ch;
|
|
|
|
}
|
2001-04-16 22:27:16 +02:00
|
|
|
|
|
|
|
__TRY
|
2000-08-14 19:39:15 +02:00
|
|
|
{
|
2003-12-12 07:07:28 +01:00
|
|
|
CharUpperBuffA( str, strlen(str) );
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
2005-12-16 17:17:57 +01:00
|
|
|
__EXCEPT_PAGE_FAULT
|
2001-04-16 22:27:16 +02:00
|
|
|
{
|
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
__ENDTRY
|
2003-12-12 07:07:28 +01:00
|
|
|
return str;
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharLowerW (USER32.@)
|
|
|
|
*/
|
2016-03-29 13:40:57 +02:00
|
|
|
LPWSTR WINAPI CharLowerW( LPWSTR str )
|
2000-08-14 19:39:15 +02:00
|
|
|
{
|
2016-03-29 13:40:57 +02:00
|
|
|
if (!IS_INTRESOURCE( str ))
|
|
|
|
{
|
|
|
|
CharLowerBuffW( str, lstrlenW( str ));
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WCHAR ch = LOWORD( str );
|
|
|
|
CharLowerBuffW( &ch, 1 );
|
|
|
|
return (LPWSTR)(UINT_PTR)ch;
|
|
|
|
}
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharUpperW (USER32.@)
|
|
|
|
*/
|
2016-03-29 13:40:57 +02:00
|
|
|
LPWSTR WINAPI CharUpperW( LPWSTR str )
|
2000-08-14 19:39:15 +02:00
|
|
|
{
|
2016-03-29 13:40:57 +02:00
|
|
|
if (!IS_INTRESOURCE( str ))
|
|
|
|
{
|
|
|
|
CharUpperBuffW( str, lstrlenW( str ));
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WCHAR ch = LOWORD( str );
|
|
|
|
CharUpperBuffW( &ch, 1 );
|
|
|
|
return (LPWSTR)(UINT_PTR)ch;
|
|
|
|
}
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharLowerBuffA (USER32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI CharLowerBuffA( LPSTR str, DWORD len )
|
|
|
|
{
|
2001-06-14 21:27:01 +02:00
|
|
|
DWORD lenW;
|
2003-12-12 07:07:28 +01:00
|
|
|
WCHAR buffer[32];
|
|
|
|
WCHAR *strW = buffer;
|
|
|
|
|
2000-08-14 19:39:15 +02:00
|
|
|
if (!str) return 0; /* YES */
|
2001-06-14 21:27:01 +02:00
|
|
|
|
|
|
|
lenW = MultiByteToWideChar(CP_ACP, 0, str, len, NULL, 0);
|
2003-12-12 07:07:28 +01:00
|
|
|
if (lenW > sizeof(buffer)/sizeof(WCHAR))
|
2001-06-14 21:27:01 +02:00
|
|
|
{
|
2003-12-12 07:07:28 +01:00
|
|
|
strW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
|
|
|
|
if (!strW) return 0;
|
2001-06-14 21:27:01 +02:00
|
|
|
}
|
2003-12-12 07:07:28 +01:00
|
|
|
MultiByteToWideChar(CP_ACP, 0, str, len, strW, lenW);
|
|
|
|
CharLowerBuffW(strW, lenW);
|
|
|
|
len = WideCharToMultiByte(CP_ACP, 0, strW, lenW, str, len, NULL, NULL);
|
|
|
|
if (strW != buffer) HeapFree(GetProcessHeap(), 0, strW);
|
|
|
|
return len;
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharLowerBuffW (USER32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI CharLowerBuffW( LPWSTR str, DWORD len )
|
|
|
|
{
|
|
|
|
if (!str) return 0; /* YES */
|
2016-03-29 13:40:57 +02:00
|
|
|
return LCMapStringW( LOCALE_USER_DEFAULT, LCMAP_LOWERCASE, str, len, str, len );
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharUpperBuffA (USER32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI CharUpperBuffA( LPSTR str, DWORD len )
|
|
|
|
{
|
2001-06-14 21:27:01 +02:00
|
|
|
DWORD lenW;
|
2003-12-12 07:07:28 +01:00
|
|
|
WCHAR buffer[32];
|
|
|
|
WCHAR *strW = buffer;
|
|
|
|
|
2000-08-14 19:39:15 +02:00
|
|
|
if (!str) return 0; /* YES */
|
2001-06-14 21:27:01 +02:00
|
|
|
|
|
|
|
lenW = MultiByteToWideChar(CP_ACP, 0, str, len, NULL, 0);
|
2003-12-12 07:07:28 +01:00
|
|
|
if (lenW > sizeof(buffer)/sizeof(WCHAR))
|
2001-06-14 21:27:01 +02:00
|
|
|
{
|
2003-12-12 07:07:28 +01:00
|
|
|
strW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
|
|
|
|
if (!strW) return 0;
|
2001-06-14 21:27:01 +02:00
|
|
|
}
|
2003-12-12 07:07:28 +01:00
|
|
|
MultiByteToWideChar(CP_ACP, 0, str, len, strW, lenW);
|
|
|
|
CharUpperBuffW(strW, lenW);
|
|
|
|
len = WideCharToMultiByte(CP_ACP, 0, strW, lenW, str, len, NULL, NULL);
|
|
|
|
if (strW != buffer) HeapFree(GetProcessHeap(), 0, strW);
|
|
|
|
return len;
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CharUpperBuffW (USER32.@)
|
|
|
|
*/
|
|
|
|
DWORD WINAPI CharUpperBuffW( LPWSTR str, DWORD len )
|
|
|
|
{
|
|
|
|
if (!str) return 0; /* YES */
|
2016-03-29 13:40:57 +02:00
|
|
|
return LCMapStringW( LOCALE_USER_DEFAULT, LCMAP_UPPERCASE, str, len, str, len );
|
2000-08-14 19:39:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-08-11 22:53:40 +02:00
|
|
|
/***********************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* IsCharLower (USER.436)
|
2001-06-13 22:13:18 +02:00
|
|
|
* IsCharLowerA (USER32.@)
|
2000-08-11 22:53:40 +02:00
|
|
|
*/
|
|
|
|
BOOL WINAPI IsCharLowerA(CHAR x)
|
|
|
|
{
|
2001-06-14 21:27:01 +02:00
|
|
|
WCHAR wch;
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
|
|
|
|
return IsCharLowerW(wch);
|
2000-08-11 22:53:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* IsCharLowerW (USER32.@)
|
|
|
|
*/
|
2016-03-29 13:40:57 +02:00
|
|
|
BOOL WINAPI IsCharLowerW( WCHAR ch )
|
2000-08-11 22:53:40 +02:00
|
|
|
{
|
2016-03-29 13:40:57 +02:00
|
|
|
WORD type;
|
|
|
|
return GetStringTypeW( CT_CTYPE1, &ch, 1, &type ) && (type & C1_LOWER);
|
2000-08-11 22:53:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* IsCharUpper (USER.435)
|
2001-06-13 22:13:18 +02:00
|
|
|
* IsCharUpperA (USER32.@)
|
2000-08-11 22:53:40 +02:00
|
|
|
*/
|
|
|
|
BOOL WINAPI IsCharUpperA(CHAR x)
|
|
|
|
{
|
2001-06-14 21:27:01 +02:00
|
|
|
WCHAR wch;
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
|
|
|
|
return IsCharUpperW(wch);
|
2000-08-11 22:53:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* IsCharUpperW (USER32.@)
|
|
|
|
*/
|
2016-03-29 13:40:57 +02:00
|
|
|
BOOL WINAPI IsCharUpperW( WCHAR ch )
|
2000-08-11 22:53:40 +02:00
|
|
|
{
|
2016-03-29 13:40:57 +02:00
|
|
|
WORD type;
|
|
|
|
return GetStringTypeW( CT_CTYPE1, &ch, 1, &type ) && (type & C1_UPPER);
|
2001-06-14 21:27:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* IsCharAlphaNumeric (USER.434)
|
2001-06-14 21:27:01 +02:00
|
|
|
* IsCharAlphaNumericA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsCharAlphaNumericA(CHAR x)
|
|
|
|
{
|
|
|
|
WCHAR wch;
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
|
|
|
|
return IsCharAlphaNumericW(wch);
|
2000-08-11 22:53:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* IsCharAlphaNumericW (USER32.@)
|
|
|
|
*/
|
2016-03-29 13:40:57 +02:00
|
|
|
BOOL WINAPI IsCharAlphaNumericW( WCHAR ch )
|
2000-08-11 22:53:40 +02:00
|
|
|
{
|
2016-03-29 13:40:57 +02:00
|
|
|
WORD type;
|
|
|
|
return GetStringTypeW( CT_CTYPE1, &ch, 1, &type ) && (type & (C1_ALPHA|C1_DIGIT));
|
2001-06-14 21:27:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* IsCharAlpha (USER.433)
|
2001-06-14 21:27:01 +02:00
|
|
|
* IsCharAlphaA (USER32.@)
|
|
|
|
*/
|
|
|
|
BOOL WINAPI IsCharAlphaA(CHAR x)
|
|
|
|
{
|
|
|
|
WCHAR wch;
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, &x, 1, &wch, 1);
|
|
|
|
return IsCharAlphaW(wch);
|
2000-08-11 22:53:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* IsCharAlphaW (USER32.@)
|
|
|
|
*/
|
2016-03-29 13:40:57 +02:00
|
|
|
BOOL WINAPI IsCharAlphaW( WCHAR ch )
|
2000-08-11 22:53:40 +02:00
|
|
|
{
|
2016-03-29 13:40:57 +02:00
|
|
|
WORD type;
|
|
|
|
return GetStringTypeW( CT_CTYPE1, &ch, 1, &type ) && (type & C1_ALPHA);
|
2000-08-11 22:53:40 +02:00
|
|
|
}
|