2007-03-14 20:24:57 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS system libraries
|
2015-09-19 13:50:57 +00:00
|
|
|
* FILE: lib/sdk/crt/mbstring/mbsupr.c
|
2007-03-14 20:24:57 +00:00
|
|
|
* PURPOSE:
|
|
|
|
* PROGRAMER: Ariadne
|
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 12/04/99: Created
|
|
|
|
*/
|
2008-06-06 17:49:24 +00:00
|
|
|
|
|
|
|
#include <precomp.h>
|
2007-03-14 20:24:57 +00:00
|
|
|
#include <mbstring.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
|
|
unsigned int _mbbtoupper(unsigned int c)
|
|
|
|
{
|
|
|
|
if (!_ismbblead(c) )
|
|
|
|
return toupper(c);
|
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
unsigned int _mbctoupper(unsigned int c)
|
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
return _ismbclower (c) ? c - 0x21 : c;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char *_mbset (unsigned char *string, int c)
|
|
|
|
{
|
|
|
|
unsigned char *save = string;
|
|
|
|
|
|
|
|
if (_MBIS16 (c)) {
|
|
|
|
|
|
|
|
if (_MBLMASK (c) == 0) {
|
|
|
|
*string++ = '\0';
|
|
|
|
*string++ = '\0';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
*string++ = _MBGETH (c);
|
|
|
|
*string++ = _MBGETL (c);
|
|
|
|
}
|
2007-03-14 20:24:57 +00:00
|
|
|
|
2008-06-06 17:49:24 +00:00
|
|
|
}
|
|
|
|
else {
|
2007-03-14 20:24:57 +00:00
|
|
|
|
2008-06-06 17:49:24 +00:00
|
|
|
*string++ = c;
|
2007-03-14 20:24:57 +00:00
|
|
|
|
2008-06-06 17:49:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return save;
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-06-06 17:49:24 +00:00
|
|
|
unsigned char *_mbsupr (unsigned char *string)
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
2008-06-06 17:49:24 +00:00
|
|
|
int c;
|
|
|
|
unsigned char *save = string;
|
|
|
|
|
|
|
|
while ((c = _mbsnextc (string))) {
|
|
|
|
|
|
|
|
if (_MBIS16 (c) == 0)
|
|
|
|
c = toupper (c);
|
|
|
|
|
|
|
|
_mbset (string, c);
|
|
|
|
|
|
|
|
string = _mbsinc (string);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return save;
|
2007-03-14 20:24:57 +00:00
|
|
|
}
|