USB device can now be unbind
[AROS.git] / compiler / stdc / strxfrm.c
blob9c4a3d7b507379af1737cf9040705aac2379e432
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 C99 function strxfrm().
6 */
8 /*****************************************************************************
10 NAME */
11 #include <string.h>
13 size_t strxfrm (
15 /* SYNOPSIS */
16 char * restrict dst,
17 const char * restrict src,
18 size_t n)
20 /* FUNCTION
21 The strxfrm() function transforms a null-terminated string pointed to by
22 src according to the current locale collation if any, then copies the
23 transformed string into dst. Not more than n characters are copied into
24 dst, including the terminating null character added. If n is set to 0
25 (it helps to determine an actual size needed for transformation), dst is
26 permitted to be a NULL pointer.
28 Comparing two strings using strcmp() after strxfrm() is equal to compar-
29 ing two original strings with strcoll().
31 INPUTS
32 dst - the destination string's buffer
33 src - the source string
34 n - the size of the dst buffer.
36 RESULT
37 Upon successful completion, strxfrm() returns the length of the trans-
38 formed string not including the terminating null character. If this
39 value is n or more, the contents of dst are indeterminate.
41 NOTES
42 stdc.library only support "C" locale so strxfrm is equivalent to
43 strncpy.
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 INTERNALS
53 ******************************************************************************/
55 size_t srclen = strlen(src);
56 strncpy(dst, src, n);
58 return srclen;
59 } /* strxfrm */