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