FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
strw_ucase.c
Go to the documentation of this file.
1
/* ucasew$ function */
2
3
#include "
fb.h
"
4
5
FBCALL
FB_WCHAR
*
fb_WstrUcase2
(
const
FB_WCHAR
*src,
int
mode )
6
{
7
FB_WCHAR
*dst, *d;
8
const
FB_WCHAR
*s;
9
FB_WCHAR
c;
10
ssize_t chars, i;
11
12
if
( src ==
NULL
)
13
return
NULL
;
14
15
chars =
fb_wstr_Len
( src );
16
17
/* alloc temp string */
18
dst =
fb_wstr_AllocTemp
( chars );
19
if
( dst ==
NULL
)
20
return
NULL
;
21
22
s = src;
23
d = dst;
24
25
if
( mode == 1 ) {
26
for
( i = 0; i < chars; i++ ) {
27
c = *s++;
28
if
( (c >= 97) && (c <= 122) )
29
c -= 97 - 65;
30
*d++ = c;
31
}
32
}
else
{
33
for
( i = 0; i < chars; i++ ) {
34
c = *s++;
35
if
(
fb_wstr_IsLower
( c ) )
36
c =
fb_wstr_ToUpper
( c );
37
*d++ = c;
38
}
39
}
40
41
/* null char */
42
*d =
_LC
(
'\0'
);
43
44
return
dst;
45
}
rtlib
strw_ucase.c
Generated on Thu Jan 23 2014 19:40:13 for FreeBASIC by
1.8.4