1 /* Copyright (c) 2007 Corinna Vinschen <corinna@vinschen.de> */
2 /*
3 FUNCTION
4 <<wcsxfrm>>---locale-specific wide-character string transformation
5
6 INDEX
7 wcsxfrm
8
9 SYNOPSIS
10 #include <wchar.h>
11 int wcsxfrm(wchar_t *__restrict <[stra]>,
12 const wchar_t *__restrict <[strb]>, size_t <[n]>);
13
14 DESCRIPTION
15 <<wcsxfrm>> transforms the wide-character string pointed to by
16 <[strb]> to the wide-character string pointed to by <[stra]>,
17 Comparing two transformed wide strings with <<wcscmp>> should return
18 the same result as comparing the original strings with <<wcscoll>>.
19 No more than <[n]> wide characters are transformed, including the
20 trailing null character.
21
22 If <[n]> is 0, <[stra]> may be a NULL pointer.
23
24 (NOT Cygwin:) The current implementation of <<wcsxfrm>> simply uses
25 <<wcslcpy>> and does not support any language-specific transformations.
26
27 RETURNS
28 <<wcsxfrm>> returns the length of the transformed wide character
29 string. if the return value is greater or equal to <[n]>, the
30 content of <[stra]> is undefined.
31
32 PORTABILITY
33 <<wcsxfrm>> is ISO/IEC 9899/AMD1:1995 (ISO C).
34 */
35
36 #include <_ansi.h>
37 #include <wchar.h>
38
39 size_t
wcsxfrm(wchar_t * __restrict a,const wchar_t * __restrict b,size_t n)40 wcsxfrm (wchar_t *__restrict a,
41 const wchar_t *__restrict b,
42 size_t n)
43
44 {
45 return wcslcpy (a, b, n);
46 }
47