FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
strw_midassign.c
Go to the documentation of this file.
1
/* midw$ statement */
2
3
#include "
fb.h
"
4
5
FBCALL
void
fb_WstrAssignMid
6
(
7
FB_WCHAR
*dst,
8
ssize_t dst_len,
9
ssize_t start,
10
ssize_t len,
11
const
FB_WCHAR
*src
12
)
13
{
14
ssize_t src_len;
15
16
if
( (dst ==
NULL
) || (src ==
NULL
) )
17
return
;
18
19
src_len =
fb_wstr_Len
( src );
20
if
( src_len == 0 )
21
return
;
22
23
if
( dst_len == 0 )
24
{
25
/* it's a pointer, assume it's large enough */
26
dst_len =
fb_wstr_Len
( dst ) + src_len;
27
}
28
29
if
( (start > 0) && (start <= dst_len) )
30
{
31
--start;
32
33
if
( (len < 1) || (len > src_len) )
34
len = src_len;
35
36
if
( start + len > dst_len )
37
len = (dst_len - start) - 1;
38
39
/* without the null-term */
40
fb_wstr_Move
( &dst[start], src, len );
41
}
42
}
rtlib
strw_midassign.c
Generated on Thu Jan 23 2014 19:40:13 for FreeBASIC by
1.8.4