diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-07-04 20:18:34 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-07-04 20:18:34 +0400 |
commit | a37215120b3461103df702186805a3d4a88d5b77 (patch) | |
tree | 2d9d2c8b51f03b23f2e9c22aa10e0d54077c464e /newlib/libc/string | |
parent | c467d17e7c0aa05e3087c462954ee942a479c197 (diff) |
* 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.
Diffstat (limited to 'newlib/libc/string')
-rw-r--r-- | newlib/libc/string/Makefile.am | 3 | ||||
-rw-r--r-- | newlib/libc/string/Makefile.in | 20 | ||||
-rw-r--r-- | newlib/libc/string/wcstrings.tex | 4 | ||||
-rw-r--r-- | newlib/libc/string/wcsxfrm.c | 52 |
4 files changed, 72 insertions, 7 deletions
diff --git a/newlib/libc/string/Makefile.am b/newlib/libc/string/Makefile.am index 94d1868fa..7c2778b13 100644 --- a/newlib/libc/string/Makefile.am +++ b/newlib/libc/string/Makefile.am @@ -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 diff --git a/newlib/libc/string/Makefile.in b/newlib/libc/string/Makefile.in index 8c5406cf0..687725943 100644 --- a/newlib/libc/string/Makefile.in +++ b/newlib/libc/string/Makefile.in @@ -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 diff --git a/newlib/libc/string/wcstrings.tex b/newlib/libc/string/wcstrings.tex index df6edc47c..04a95f6de 100644 --- a/newlib/libc/string/wcstrings.tex +++ b/newlib/libc/string/wcstrings.tex @@ -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 @@ -102,5 +103,8 @@ declarations are in @file{wchar.h}. @include string/wcswidth.def @page +@include string/wcsxfrm.def + +@page @include string/wcwidth.def 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 + <<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); +} |