ucrtbase: Add _isblank_l.

Signed-off-by: Daniel Lehman <dlehman@esri.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Daniel Lehman 2017-04-03 09:24:40 -07:00 committed by Alexandre Julliard
parent 21d6e97d8d
commit 724a09abb5
6 changed files with 51 additions and 8 deletions

View File

@ -7,7 +7,7 @@
@ stub __wcsncnt
@ cdecl _isalnum_l(long ptr) ucrtbase._isalnum_l
@ cdecl _isalpha_l(long ptr) ucrtbase._isalpha_l
@ stub _isblank_l
@ cdecl _isblank_l(long ptr) ucrtbase._isblank_l
@ cdecl _iscntrl_l(long ptr) ucrtbase._iscntrl_l
@ cdecl _isctype(long long) ucrtbase._isctype
@ cdecl _isctype_l(long long ptr) ucrtbase._isctype_l
@ -100,7 +100,7 @@
@ cdecl is_wctype(long long) ucrtbase.is_wctype
@ cdecl isalnum(long) ucrtbase.isalnum
@ cdecl isalpha(long) ucrtbase.isalpha
@ stub isblank
@ cdecl isblank(long) ucrtbase.isblank
@ cdecl iscntrl(long) ucrtbase.iscntrl
@ cdecl isdigit(long) ucrtbase.isdigit
@ cdecl isgraph(long) ucrtbase.isgraph

View File

@ -1291,7 +1291,7 @@
@ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l
@ cdecl _isalpha_l(long ptr) MSVCRT__isalpha_l
@ cdecl _isatty(long) MSVCRT__isatty
@ stub _isblank_l
@ cdecl _isblank_l(long ptr) MSVCRT__isblank_l
@ cdecl _iscntrl_l(long ptr) MSVCRT__iscntrl_l
@ cdecl _isctype(long long) MSVCRT__isctype
@ cdecl _isctype_l(long long ptr) MSVCRT__isctype_l
@ -2215,7 +2215,7 @@
@ cdecl is_wctype(long long) ntdll.iswctype
@ cdecl isalnum(long) MSVCRT_isalnum
@ cdecl isalpha(long) MSVCRT_isalpha
@ stub isblank
@ cdecl isblank(long) MSVCRT_isblank
@ cdecl iscntrl(long) MSVCRT_iscntrl
@ cdecl isdigit(long) MSVCRT_isdigit
@ cdecl isgraph(long) MSVCRT_isgraph

View File

@ -1194,7 +1194,7 @@
@ cdecl _isalnum_l(long ptr) msvcr120._isalnum_l
@ cdecl _isalpha_l(long ptr) msvcr120._isalpha_l
@ cdecl _isatty(long) msvcr120._isatty
@ stub _isblank_l
@ cdecl _isblank_l(long ptr) msvcr120._isblank_l
@ cdecl _iscntrl_l(long ptr) msvcr120._iscntrl_l
@ cdecl _isctype(long long) msvcr120._isctype
@ cdecl _isctype_l(long long ptr) msvcr120._isctype_l
@ -1878,7 +1878,7 @@
@ stub imaxdiv
@ cdecl isalnum(long) msvcr120.isalnum
@ cdecl isalpha(long) msvcr120.isalpha
@ stub isblank
@ cdecl isblank(long) msvcr120.isblank
@ cdecl iscntrl(long) msvcr120.iscntrl
@ cdecl isdigit(long) msvcr120.isdigit
@ cdecl isgraph(long) msvcr120.isgraph

View File

@ -292,6 +292,22 @@ int CDECL MSVCRT_isxdigit(int c)
return MSVCRT__isctype( c, MSVCRT__HEX );
}
/*********************************************************************
* _isblank_l (MSVCRT.@)
*/
int CDECL MSVCRT__isblank_l(int c, MSVCRT__locale_t locale)
{
return c == '\t' || MSVCRT__isctype_l( c, MSVCRT__BLANK, locale );
}
/*********************************************************************
* isblank (MSVCRT.@)
*/
int CDECL MSVCRT_isblank(int c)
{
return c == '\t' || MSVCRT__isctype( c, MSVCRT__BLANK );
}
/*********************************************************************
* __isascii (MSVCRT.@)
*/

View File

@ -86,6 +86,9 @@ static char* (CDECL *p__get_narrow_winmain_command_line)(void);
static int (CDECL *p_sopen_dispatch)(const char *, int, int, int, int *, int);
static int (CDECL *p_sopen_s)(int *, const char *, int, int, int);
static MSVCRT_lldiv_t (CDECL *p_lldiv)(LONGLONG,LONGLONG);
static int (CDECL *p__isctype)(int,int);
static int (CDECL *p_isblank)(int);
static int (CDECL *p__isblank_l)(int,_locale_t);
static void test__initialize_onexit_table(void)
{
@ -380,6 +383,9 @@ static BOOL init(void)
p_sopen_dispatch = (void*)GetProcAddress(module, "_sopen_dispatch");
p_sopen_s = (void*)GetProcAddress(module, "_sopen_s");
p_lldiv = (void*)GetProcAddress(module, "lldiv");
p__isctype = (void*)GetProcAddress(module, "_isctype");
p_isblank = (void*)GetProcAddress(module, "isblank");
p__isblank_l = (void*)GetProcAddress(module, "_isblank_l");
return TRUE;
}
@ -460,6 +466,26 @@ static void test_lldiv(void)
ok(r.rem == 0x222, "rem = %x%08x\n", (INT32)(r.rem >> 32), (UINT32)r.rem);
}
static void test_isblank(void)
{
int c;
for(c = 0; c <= 0xff; c++) {
if(c == '\t' || c == ' ') {
if(c == '\t')
ok(!p__isctype(c, _BLANK), "tab shouldn't be blank\n");
else
ok(p__isctype(c, _BLANK), "space should be blank\n");
ok(p_isblank(c), "%d should be blank\n", c);
ok(p__isblank_l(c, NULL), "%d should be blank\n", c);
} else {
ok(!p__isctype(c, _BLANK), "%d shouldn't be blank\n", c);
ok(!p_isblank(c), "%d shouldn't be blank\n", c);
ok(!p__isblank_l(c, NULL), "%d shouldn't be blank\n", c);
}
}
}
START_TEST(misc)
{
int arg_c;
@ -483,4 +509,5 @@ START_TEST(misc)
test__sopen_dispatch();
test__sopen_s();
test_lldiv();
test_isblank();
}

View File

@ -430,7 +430,7 @@
@ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l
@ cdecl _isalpha_l(long ptr) MSVCRT__isalpha_l
@ cdecl _isatty(long) MSVCRT__isatty
@ stub _isblank_l
@ cdecl _isblank_l(long ptr) MSVCRT__isblank_l
@ cdecl _iscntrl_l(long ptr) MSVCRT__iscntrl_l
@ cdecl _isctype(long long) MSVCRT__isctype
@ cdecl _isctype_l(long long ptr) MSVCRT__isctype_l
@ -2349,7 +2349,7 @@
@ cdecl is_wctype(long long) ntdll.iswctype
@ cdecl isalnum(long) MSVCRT_isalnum
@ cdecl isalpha(long) MSVCRT_isalpha
@ stub isblank
@ cdecl isblank(long) MSVCRT_isblank
@ cdecl iscntrl(long) MSVCRT_iscntrl
@ cdecl isdigit(long) MSVCRT_isdigit
@ cdecl isgraph(long) MSVCRT_isgraph