ReactOS 0.4.16-dev-889-g9563c07
ismbdgt.cpp
Go to the documentation of this file.
1/***
2*ismbdgt.cpp - Test if character is a digit (MBCS)
3*
4* Copyright (c) Microsoft Corporation. All rights reserved.
5*
6*Purpose:
7* Test if character is a digit (MBCS)
8*
9*******************************************************************************/
10#ifndef _MBCS
11 #error This file should only be compiled with _MBCS defined
12#endif
13
15#include <locale.h>
16
17
18/***
19* _ismbcdigit - Test if character is a digit (MBCS)
20*
21*Purpose:
22* Tests the character to see if it is a digit.
23* Handles MBCS chars correctly.
24*
25* Note: Use test against 0x00FF instead of _ISLEADBYTE
26* to ensure that we don't call SBCS routine with a two-byte
27* value.
28*
29*Entry:
30* unsigned int *c = character to test
31*
32*Exit:
33* Returns TRUE if character is a digit, else FALSE
34*
35*Exceptions:
36*
37*******************************************************************************/
38
39extern "C" int __cdecl _ismbcdigit_l(unsigned int const c, _locale_t const locale)
40{
41 _LocaleUpdate locale_update(locale);
42
43 if (c <= 0x00FF)
44 {
45 return _isdigit_fast_internal(static_cast<unsigned char>(c), locale_update.GetLocaleT());
46 }
47
48 return __dcrt_multibyte_check_type(c, locale_update.GetLocaleT(), _DIGIT, true);
49}
50
51extern "C" int __cdecl _ismbcdigit(unsigned int const c)
52{
53 return _ismbcdigit_l(c, nullptr);
54}
#define __cdecl
Definition: accygwin.h:79
Definition: _locale.h:75
_Check_return_ __forceinline unsigned short __cdecl _isdigit_fast_internal(_In_ unsigned char const c, _In_ _locale_t const locale)
const GLubyte * c
Definition: glext.h:8905
#define _DIGIT
Definition: ctype.h:67
int __cdecl _ismbcdigit_l(unsigned int const c, _locale_t const locale)
Definition: ismbdgt.cpp:39
int __cdecl _ismbcdigit(unsigned int const c)
Definition: ismbdgt.cpp:51