FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
strw_rtrim.c
Go to the documentation of this file.
1
/* rtrimw$ function */
2
3
#include "
fb.h
"
4
5
FBCALL
FB_WCHAR
*
fb_WstrRTrim
(
const
FB_WCHAR
*src )
6
{
7
FB_WCHAR
*dst;
8
const
FB_WCHAR
*
p
;
9
ssize_t chars;
10
11
if
( src ==
NULL
)
12
return
NULL
;
13
14
chars =
fb_wstr_Len
( src );
15
if
( chars <= 0 )
16
return
NULL
;
17
18
p =
fb_wstr_SkipCharRev
( src, chars,
_LC
(
' '
) );
19
chars =
fb_wstr_CalcDiff
( src, p ) + 1;
20
if
( chars <= 0 )
21
return
NULL
;
22
23
/* alloc temp string */
24
dst =
fb_wstr_AllocTemp
( chars );
25
if
( dst !=
NULL
)
26
{
27
/* simple copy */
28
fb_wstr_Copy
( dst, src, chars );
29
}
30
31
return
dst;
32
}
rtlib
strw_rtrim.c
Generated on Thu Jan 23 2014 19:40:13 for FreeBASIC by
1.8.4