FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
strw_set.c
Go to the documentation of this file.
1
/* lsetw and rsetw functions */
2
3
#include "
fb.h
"
4
5
FBCALL
void
fb_WstrLset
(
FB_WCHAR
*dst,
FB_WCHAR
*src )
6
{
7
ssize_t slen, dlen, len;
8
9
if
( (dst !=
NULL
) && (src !=
NULL
) )
10
{
11
slen =
fb_wstr_Len
( src );
12
dlen =
fb_wstr_Len
( dst );
13
14
if
( dlen > 0 )
15
{
16
len = (dlen <= slen? dlen: slen );
17
18
fb_wstr_Copy
( dst, src, len );
19
20
len = dlen - slen;
21
if
( len > 0 )
22
fb_wstr_Fill
( &dst[slen], 32, len );
23
}
24
}
25
}
26
27
FBCALL
void
fb_WstrRset
(
FB_WCHAR
*dst,
FB_WCHAR
*src )
28
{
29
ssize_t slen, dlen, len, padlen;
30
31
if
( (dst !=
NULL
) && (src !=
NULL
) )
32
{
33
slen =
fb_wstr_Len
( src );
34
dlen =
fb_wstr_Len
( dst );
35
36
if
( dlen > 0 )
37
{
38
padlen = dlen - slen;
39
if
( padlen > 0 )
40
fb_wstr_Fill
( dst, 32, padlen );
41
else
42
padlen = 0;
43
44
len = (dlen <= slen? dlen: slen );
45
46
fb_wstr_Copy
( &dst[padlen], src, len );
47
}
48
}
49
}
rtlib
strw_set.c
Generated on Thu Jan 23 2014 19:40:13 for FreeBASIC by
1.8.4