ReactOS 0.4.16-dev-88-ga65b6ae
mbsupr.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/sdk/crt/mbstring/mbsupr.c
5 * PURPOSE:
6 * PROGRAMER: Ariadne
7 * UPDATE HISTORY:
8 * 12/04/99: Created
9 */
10
11#include <precomp.h>
12#include <mbstring.h>
13#include <ctype.h>
14
15unsigned int _mbbtoupper(unsigned int c)
16{
17 if (!_ismbblead(c) )
18 return toupper(c);
19
20 return c;
21}
22
23/*
24 * @implemented
25 */
26unsigned int _mbctoupper(unsigned int c)
27{
28 return _ismbclower (c) ? c - 0x21 : c;
29}
30
31unsigned char *_mbset (unsigned char *string, int c)
32{
33 unsigned char *save = string;
34
35 if (_MBIS16 (c)) {
36
37 if (_MBLMASK (c) == 0) {
38 *string++ = '\0';
39 *string++ = '\0';
40 }
41 else {
42 *string++ = _MBGETH (c);
43 *string++ = _MBGETL (c);
44 }
45
46 }
47 else {
48
49 *string++ = c;
50
51 }
52
53 return save;
54}
55
56/*
57 * @implemented
58 */
59unsigned char *_mbsupr (unsigned char *string)
60{
61 int c;
62 unsigned char *save = string;
63
64 while ((c = _mbsnextc (string))) {
65
66 if (_MBIS16 (c) == 0)
67 c = toupper (c);
68
69 _mbset (string, c);
70
71 string = _mbsinc (string);
72
73 }
74
75 return save;
76}
int toupper(int c)
Definition: utclib.c:881
const GLubyte * c
Definition: glext.h:8905
_Check_return_ _CRTIMP unsigned int __cdecl _mbsnextc(_In_z_ const unsigned char *_Str)
_Check_return_ _CRTIMP unsigned char *__cdecl _mbsinc(_In_z_ const unsigned char *_Ptr)
_Check_return_ _CRTIMP int __cdecl _ismbclower(_In_ unsigned int _Ch)
#define c
Definition: ke_i.h:80
#define _MBLMASK(c)
Definition: mbstring.h:20
#define _MBGETH(c)
Definition: mbstring.h:23
#define _MBGETL(c)
Definition: mbstring.h:22
#define _MBIS16(c)
Definition: mbstring.h:25
unsigned char * _mbsupr(unsigned char *string)
Definition: mbsupr.c:59
unsigned char * _mbset(unsigned char *string, int c)
Definition: mbsupr.c:31
unsigned int _mbbtoupper(unsigned int c)
Definition: mbsupr.c:15
unsigned int _mbctoupper(unsigned int c)
Definition: mbsupr.c:26
char string[160]
Definition: util.h:11
int __cdecl _ismbblead(unsigned int)
Definition: ismblead.c:20