From a37215120b3461103df702186805a3d4a88d5b77 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 4 Jul 2007 16:18:34 +0000 Subject: * libc/include/wchar.h: Add prototype for wcsxfrm. * libc/string/Makefile.am (GENERAL_SOURCES): Add wcsxfrm.c. (CHEWOUT_FILES): Add wcsxfrm.def. * libc/string/Makefile.in: Regenerate. * libc/string/wcsxfrm.c: New file. * libc/string/wcstrings.tex: Add wcsxfrm. --- newlib/libc/string/wcsxfrm.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 newlib/libc/string/wcsxfrm.c (limited to 'newlib/libc/string/wcsxfrm.c') diff --git a/newlib/libc/string/wcsxfrm.c b/newlib/libc/string/wcsxfrm.c new file mode 100644 index 000000000..439bdd036 --- /dev/null +++ b/newlib/libc/string/wcsxfrm.c @@ -0,0 +1,52 @@ +/* +FUNCTION + <>---locale-specific wide-character string transformation + +INDEX + wcsxfrm + +ANSI_SYNOPSIS + #include + int wcsxfrm(wchar_t *<[stra]>, const wchar_t * <[strb]>, size_t <[n]>); + +TRAD_SYNOPSIS + #include + size_t wcsxfrm(<[stra]>, <[strb]>, <[n]>) + wchar_t *<[stra]>; + wchar_t *<[strb]>; + size_t <[n]> + +DESCRIPTION + <> transforms the wide-character string pointed to by + <[strb]> to the wide-character string pointed to by <[stra]>, + Comparing two transformed wide strings with <> should return + the same result as comparing the original strings with <>. + No more than <[n]> wide characters are transformed, including the + trailing null character. + + If <[n]> is 0, <[stra]> may be a NULL pointer. + + The current implementation of <> simply uses <> + and does not support any language-specific transformations. + +RETURNS + <> returns the length of the transformed wide character + string. if the return value is greater or equal to <[n]>, the + content of <[stra]> is undefined. + +PORTABILITY +<> is ISO/IEC 9899/AMD1:1995 (ISO C). +*/ + +#include <_ansi.h> +#include + +size_t +_DEFUN (wcsxfrm, (a, b, n), + wchar_t *a _AND + _CONST wchar_t *b _AND + size_t n) + +{ + return wcslcpy (a, b, n); +} -- cgit v1.2.3