summaryrefslogtreecommitdiffstats
path: root/newlib/libc/string/wcpcpy.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-12-19 17:33:12 +0000
committerCorinna Vinschen <corinna@vinschen.de>2007-12-19 17:33:12 +0000
commitac26b7272357d9e3fced9dc24351cbb69f13d6fb (patch)
tree215f3d9840acd0a5a4a5431f8b93e0749a94d49a /newlib/libc/string/wcpcpy.c
parent478df8bb912080e5b1d6aa39fb8a58cddcfc6567 (diff)
downloadcygnal-ac26b7272357d9e3fced9dc24351cbb69f13d6fb.tar.gz
cygnal-ac26b7272357d9e3fced9dc24351cbb69f13d6fb.tar.bz2
cygnal-ac26b7272357d9e3fced9dc24351cbb69f13d6fb.zip
* libc/include/wchar.h: Add prototypes for wcpcpy and wcpncpy.
* libc/string/Makefile.am (ELIX_SOURCES): Add wcpcpy.c and wcpncpy.c. (CHEWOUT_FILES): Add wcpcpy.def and wcpncpy.def. * libc/string/Makefile.in: Regenerate. * libc/string/wcpcpy.c: New file. * libc/string/wcpncpy.c: New file. * libc/string/wcstrings.tex: Add wcpcpy and wcpncpy.
Diffstat (limited to 'newlib/libc/string/wcpcpy.c')
-rw-r--r--newlib/libc/string/wcpcpy.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/newlib/libc/string/wcpcpy.c b/newlib/libc/string/wcpcpy.c
new file mode 100644
index 000000000..7bb9a1e9f
--- /dev/null
+++ b/newlib/libc/string/wcpcpy.c
@@ -0,0 +1,41 @@
+/*
+FUNCTION
+ <<wcpcpy>>---copy a wide-character string returning a pointer to its end
+
+ANSI_SYNOPSIS
+ #include <wchar.h>
+ wchar_t *wcpcpy(wchar_t *<[s1]>, const wchar_t *,<[s2]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcpcpy(<[s1]>, <[s2]>
+ wchar_t *<[s1]>;
+ const wchar_t *<[s2]>;
+
+DESCRIPTION
+ The <<wcpcpy>> function copies the wide-character string pointed to by
+ <[s2]> (including the terminating null wide-character code) into the
+ array pointed to by <[s1]>. If copying takes place between objects that
+ overlap, the behaviour is undefined.
+
+RETURNS
+ This function returns a pointer to the end of the destination string,
+ thus pointing to the trailing '\0'.
+
+PORTABILITY
+<<wcpcpy>> is a GNU extension.
+
+No supporting OS subroutines are required.
+*/
+
+#include <_ansi.h>
+#include <wchar.h>
+
+wchar_t *
+_DEFUN (wcpcpy, (s1, s2),
+ wchar_t * s1 _AND
+ _CONST wchar_t * s2)
+{
+ while ((*s1++ = *s2++))
+ ;
+ return --s1;
+}