Reactos
at master 53 lines 1.3 kB view raw
1/*** 2*ismbprn.c - Test character for display character (MBCS) 3* 4* Copyright (c) Microsoft Corporation. All rights reserved. 5* 6*Purpose: 7* Test character for display character (MBCS) 8* 9*******************************************************************************/ 10#ifndef _MBCS 11 #error This file should only be compiled with _MBCS defined 12#endif 13 14#include <corecrt_internal_mbstring.h> 15#include <locale.h> 16 17 18/*** 19* _ismbcprint - Test character for display character (MBCS) 20* 21*Purpose: 22* Test if the character is a display character. 23* Handles MBCS chars correctly. 24* 25* Note: Use test against 0x00FF to ensure that we don't 26* call SBCS routine with a two-byte value. 27* 28*Entry: 29* unsigned int c = character to test 30* 31*Exit: 32* Returns TRUE if character is display character, else FALSE 33* 34*Exceptions: 35* 36*******************************************************************************/ 37 38extern "C" int __cdecl _ismbcprint_l(unsigned int const c, _locale_t const locale) 39{ 40 _LocaleUpdate locale_update(locale); 41 42 if (c <= 0x00FF) 43 { 44 return _ismbbprint_l(c, locale_update.GetLocaleT()); 45 } 46 47 return __dcrt_multibyte_check_type(c, locale_update.GetLocaleT(), _CONTROL, false); 48} 49 50extern "C" int __cdecl _ismbcprint(unsigned int const c) 51{ 52 return _ismbcprint_l(c, nullptr); 53}