FireBirdLib - Topfield TMS PVR TAP Programming Library
UpperCase.c
Go to the documentation of this file.
1
#include <ctype.h>
2
#include <string.h>
3
#include "
FBLib_string.h
"
4
5
void
UpperCase
(
char
*
string
)
6
{
7
TRACEENTER
();
8
9
char
*p, *s;
10
byte
UTF8[5];
11
byte
BytesPerCharacter;
12
13
p = string;
14
while
(*p)
15
{
16
isUTF8Char
(p, &BytesPerCharacter);
17
if
(BytesPerCharacter > 1)
18
{
19
memcpy(UTF8, p, BytesPerCharacter);
20
UTF8[BytesPerCharacter] =
'\0'
;
21
s = strstr(
UTF8Lower
, UTF8);
22
if
(s) memcpy(p, &
UTF8Upper
[(dword)s - (dword)
UTF8Lower
], BytesPerCharacter);
23
}
24
else
25
{
26
s = strchr(
AnsiLower
, *p);
27
if
(s)
28
{
29
*p =
AnsiUpper
[(dword)s - (dword)
AnsiLower
];
30
}
31
else
32
*p = toupper(*p);
33
}
34
35
p += BytesPerCharacter;
36
}
37
38
TRACEEXIT
();
39
}
FBLib_string.h
AnsiUpper
char AnsiUpper[30]
Definition:
StrToUTF8.c:132
UTF8Lower
char UTF8Lower[64]
Definition:
StrToUTF8.c:136
AnsiLower
char AnsiLower[30]
Definition:
StrToUTF8.c:133
UTF8Upper
char UTF8Upper[64]
Definition:
StrToUTF8.c:135
UpperCase
void UpperCase(char *string)
Definition:
UpperCase.c:5
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
isUTF8Char
bool isUTF8Char(const byte *p, byte *BytesPerChar)
Definition:
isUTF8Char.c:3
string
UpperCase.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3