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