* 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.
+2007-07-04 Corinna Vinschen <corinna@vinschen.de>
+
+ * 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.
+
2007-06-28 Corinna Vinschen <corinna@vinschen.de>
* libc/include/string.h: Add prototypes for stpcpy and stpncpy.
size_t _EXFUN(wcsspn, (const wchar_t *, const wchar_t *));
wchar_t *_EXFUN(wcsstr, (const wchar_t *, const wchar_t *));
int _EXFUN(wcswidth, (const wchar_t *, size_t));
+size_t _EXFUN(wcsxfrm, (wchar_t *, const wchar_t *, size_t));
int _EXFUN(wcwidth, (const wchar_t));
wchar_t *_EXFUN(wmemchr, (const wchar_t *, wchar_t, size_t));
int _EXFUN(wmemcmp, (const wchar_t *, const wchar_t *, size_t));
wcsspn.c \
wcsstr.c \
wcswidth.c \
+ wcsxfrm.c \
wcwidth.c \
wmemchr.c \
wmemcmp.c \
wcslcat.def wcslcpy.def wcslen.def wcsncat.def \
wcsncmp.def wcsncpy.def wcsnlen.def wcspbrk.def \
wcsrchr.def wcsspn.def wcsstr.def \
-wcswidth.def wcwidth.def wmemchr.def \
+wcswidth.def wcsxfrm.def wcwidth.def wmemchr.def \
wmemcmp.def wmemcpy.def wmemmove.def wmemset.def
SUFFIXES = .def
lib_a-wcsnlen.$(OBJEXT) lib_a-wcspbrk.$(OBJEXT) \
lib_a-wcsrchr.$(OBJEXT) lib_a-wcsspn.$(OBJEXT) \
lib_a-wcsstr.$(OBJEXT) lib_a-wcswidth.$(OBJEXT) \
- lib_a-wcwidth.$(OBJEXT) lib_a-wmemchr.$(OBJEXT) \
- lib_a-wmemcmp.$(OBJEXT) lib_a-wmemcpy.$(OBJEXT) \
- lib_a-wmemmove.$(OBJEXT) lib_a-wmemset.$(OBJEXT)
+ lib_a-wcsxfrm.$(OBJEXT) lib_a-wcwidth.$(OBJEXT) \
+ lib_a-wmemchr.$(OBJEXT) lib_a-wmemcmp.$(OBJEXT) \
+ lib_a-wmemcpy.$(OBJEXT) lib_a-wmemmove.$(OBJEXT) \
+ lib_a-wmemset.$(OBJEXT)
@ELIX_LEVEL_1_FALSE@am__objects_2 = lib_a-bcmp.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-memccpy.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@ lib_a-mempcpy.$(OBJEXT) \
wcschr.lo wcscmp.lo wcscoll.lo wcscpy.lo wcscspn.lo \
wcslcat.lo wcslcpy.lo wcslen.lo wcsncat.lo wcsncmp.lo \
wcsncpy.lo wcsnlen.lo wcspbrk.lo wcsrchr.lo wcsspn.lo wcsstr.lo \
- wcswidth.lo wcwidth.lo wmemchr.lo wmemcmp.lo wmemcpy.lo \
- wmemmove.lo wmemset.lo
+ wcswidth.lo wcsxfrm.lo wcwidth.lo wmemchr.lo wmemcmp.lo \
+ wmemcpy.lo wmemmove.lo wmemset.lo
@ELIX_LEVEL_1_FALSE@am__objects_4 = bcmp.lo memccpy.lo mempcpy.lo \
@ELIX_LEVEL_1_FALSE@ stpcpy.lo stpncpy.lo strndup.lo \
@ELIX_LEVEL_1_FALSE@ strcasestr.lo strndup_r.lo
wcsspn.c \
wcsstr.c \
wcswidth.c \
+ wcsxfrm.c \
wcwidth.c \
wmemchr.c \
wmemcmp.c \
wcslcat.def wcslcpy.def wcslen.def wcsncat.def \
wcsncmp.def wcsncpy.def wcsnlen.def wcspbrk.def \
wcsrchr.def wcsspn.def wcsstr.def \
-wcswidth.def wcwidth.def wmemchr.def \
+wcswidth.def wcsxfrm.def wcwidth.def wmemchr.def \
wmemcmp.def wmemcpy.def wmemmove.def wmemset.def
SUFFIXES = .def
lib_a-wcswidth.obj: wcswidth.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcswidth.obj `if test -f 'wcswidth.c'; then $(CYGPATH_W) 'wcswidth.c'; else $(CYGPATH_W) '$(srcdir)/wcswidth.c'; fi`
+lib_a-wcsxfrm.o: wcsxfrm.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsxfrm.o `test -f 'wcsxfrm.c' || echo '$(srcdir)/'`wcsxfrm.c
+
+lib_a-wcsxfrm.obj: wcsxfrm.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsxfrm.obj `if test -f 'wcsxfrm.c'; then $(CYGPATH_W) 'wcsxfrm.c'; else $(CYGPATH_W) '$(srcdir)/wcsxfrm.c'; fi`
+
lib_a-wcwidth.o: wcwidth.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcwidth.o `test -f 'wcwidth.c' || echo '$(srcdir)/'`wcwidth.c
* wcsspn:: Find initial match in wide-character string
* wcsstr:: Find wide-character string segment
* wcswidth:: Number of column positions of a wide-character string
+* wcsxfrm:: Locale-specific wide-character string transformation
* wcwidth:: Number of column positions of a wide-character code
@end menu
@include string/wcswidth.def
@page
+@include string/wcsxfrm.def
+
+@page
@include string/wcwidth.def
--- /dev/null
+/*
+FUNCTION
+ <<wcsxfrm>>---locale-specific wide-character string transformation
+
+INDEX
+ wcsxfrm
+
+ANSI_SYNOPSIS
+ #include <wchar.h>
+ int wcsxfrm(wchar_t *<[stra]>, const wchar_t * <[strb]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ #include <wchar.h>
+ size_t wcsxfrm(<[stra]>, <[strb]>, <[n]>)
+ wchar_t *<[stra]>;
+ wchar_t *<[strb]>;
+ size_t <[n]>
+
+DESCRIPTION
+ <<wcsxfrm>> transforms the wide-character string pointed to by
+ <[strb]> to the wide-character string pointed to by <[stra]>,
+ Comparing two transformed wide strings with <<wcscmp>> should return
+ the same result as comparing the original strings with <<wcscoll>>.
+ 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 <<wcsxfrm>> simply uses <<wcslcpy>>
+ and does not support any language-specific transformations.
+
+RETURNS
+ <<wcsxfrm>> 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
+<<wcsxfrm>> is ISO/IEC 9899/AMD1:1995 (ISO C).
+*/
+
+#include <_ansi.h>
+#include <wchar.h>
+
+size_t
+_DEFUN (wcsxfrm, (a, b, n),
+ wchar_t *a _AND
+ _CONST wchar_t *b _AND
+ size_t n)
+
+{
+ return wcslcpy (a, b, n);
+}