2008-06-06 17:49:24 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
|
|
|
* FILE: lib/sdk/crt/mbstring/ismbc.c
|
|
|
|
* PURPOSE:
|
2021-06-11 12:29:21 +00:00
|
|
|
* PROGRAMER:
|
2008-06-06 17:49:24 +00:00
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 05/30/08: Samuel Serapion adapted from PROJECT C Library
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2007-03-14 20:24:57 +00:00
|
|
|
|
2008-06-06 17:49:24 +00:00
|
|
|
#include <precomp.h>
|
|
|
|
#include <mbstring.h>
|
|
|
|
#include <mbctype.h>
|
|
|
|
|
2007-03-14 20:24:57 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
int _ismbcalnum( unsigned int c )
|
|
|
|
{
|
|
|
|
if ((c & 0xFF00) != 0) {
|
|
|
|
// true multibyte character
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return _ismbbalnum(c);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
int _ismbcalpha( unsigned int c )
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return (_ismbcupper (c) || _ismbclower (c));
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
int _ismbcdigit( unsigned int c )
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return ((c) >= 0x824f && (c) <= 0x8258);
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2008-06-06 17:49:24 +00:00
|
|
|
* @implemented
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
|
|
|
int _ismbcprint( unsigned int c )
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return (_MBHMASK (c) ? _ismbclegal (c) : (isprint (c) || _ismbbkana (c)));
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2008-06-06 17:49:24 +00:00
|
|
|
* @implemented
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
|
|
|
int _ismbcsymbol( unsigned int c )
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return (c >= 0x8141 && c <= 0x817e) || (c >= 0x8180 && c <= 0x81ac);
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2008-06-06 17:49:24 +00:00
|
|
|
* @implemented
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
|
|
|
int _ismbcspace( unsigned int c )
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return ((c) == 0x8140);
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
int _ismbclegal(unsigned int c)
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return (_ismbblead (_MBGETH (c)) && _ismbbtrail (_MBGETL (c)));
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2008-06-06 17:49:24 +00:00
|
|
|
* @implemented
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
|
|
|
int _ismbcl0(unsigned int c)
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return (c >= 0x8140 && c <= 0x889e);
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2008-06-06 17:49:24 +00:00
|
|
|
* @implemented
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
|
|
|
int _ismbcl1(unsigned int c)
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return (c >= 0x889f && c <= 0x9872);
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2008-06-06 17:49:24 +00:00
|
|
|
* @implemented
|
2007-03-14 20:24:57 +00:00
|
|
|
*/
|
|
|
|
int _ismbcl2(unsigned int c)
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return (c >= 0x989f && c <= 0xea9e);
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
2008-05-28 21:08:23 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
int _ismbcgraph(unsigned int ch)
|
|
|
|
{
|
|
|
|
//wchar_t wch = msvcrt_mbc_to_wc( ch );
|
|
|
|
//return (get_char_typeW( wch ) & (C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_ALPHA));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
int _ismbcpunct(unsigned int ch)
|
|
|
|
{
|
|
|
|
//wchar_t wch = msvcrt_mbc_to_wc( ch );
|
|
|
|
//return (get_char_typeW( wch ) & C1_PUNCT);
|
|
|
|
return 0;
|
|
|
|
}
|