* 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.
This commit is contained in:
Corinna Vinschen 2007-07-04 16:18:34 +00:00
parent c467d17e7c
commit a37215120b
6 changed files with 82 additions and 7 deletions

View File

@ -1,3 +1,12 @@
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.

View File

@ -71,6 +71,7 @@ wchar_t *_EXFUN(wcsrchr, (const wchar_t *, wchar_t));
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));

View File

@ -63,6 +63,7 @@ GENERAL_SOURCES = \
wcsspn.c \
wcsstr.c \
wcswidth.c \
wcsxfrm.c \
wcwidth.c \
wmemchr.c \
wmemcmp.c \
@ -113,7 +114,7 @@ wcscpy.def wcscspn.def \
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

View File

@ -84,9 +84,10 @@ am__objects_1 = lib_a-bcopy.$(OBJEXT) lib_a-bzero.$(OBJEXT) \
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) \
@ -111,8 +112,8 @@ am__objects_3 = bcopy.lo bzero.lo index.lo memchr.lo memcmp.lo \
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
@ -354,6 +355,7 @@ GENERAL_SOURCES = \
wcsspn.c \
wcsstr.c \
wcswidth.c \
wcsxfrm.c \
wcwidth.c \
wmemchr.c \
wmemcmp.c \
@ -394,7 +396,7 @@ wcscpy.def wcscspn.def \
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
@ -816,6 +818,12 @@ lib_a-wcswidth.o: wcswidth.c
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

View File

@ -29,6 +29,7 @@ declarations are in @file{wchar.h}.
* 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
@ -101,6 +102,9 @@ declarations are in @file{wchar.h}.
@page
@include string/wcswidth.def
@page
@include string/wcsxfrm.def
@page
@include string/wcwidth.def

View File

@ -0,0 +1,52 @@
/*
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);
}