FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
strw_concat.c
Go to the documentation of this file.
1
/* wstring concatenation function */
2
3
#include "
fb.h
"
4
5
FBCALL
FB_WCHAR
*
fb_WstrConcat
(
const
FB_WCHAR
*str1,
const
FB_WCHAR
*str2 )
6
{
7
FB_WCHAR
*dst, *d;
8
ssize_t str1_len, str2_len;
9
10
if
( str1 !=
NULL
)
11
str1_len =
fb_wstr_Len
( str1 );
12
else
13
str1_len = 0;
14
15
if
( str2 !=
NULL
)
16
str2_len =
fb_wstr_Len
( str2 );
17
else
18
str2_len = 0;
19
20
/* NULL? */
21
if
( str1_len + str2_len == 0 )
22
return
NULL
;
23
24
/* alloc temp string */
25
dst =
fb_wstr_AllocTemp
( str1_len + str2_len );
26
27
/* do the concatenation */
28
d =
fb_wstr_Move
( dst, str1, str1_len );
29
d =
fb_wstr_Move
( d, str2, str2_len );
30
*d = L
'\0'
;
31
32
return
dst;
33
}
rtlib
strw_concat.c
Generated on Thu Jan 23 2014 19:40:13 for FreeBASIC by
1.8.4