diff options
author | Bruno Haible <bruno@clisp.org> | 2011-02-05 12:58:40 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-02-07 23:36:02 +0100 |
commit | c20b0560d1c6f31c35e502a58a283f07e1a72869 (patch) | |
tree | 5141afbc09f73f641204d6a1675059f5af1266c3 /lib/wmemcpy-impl.h | |
parent | c5c66975f77962d53fee68bc2766cc59cabf95e1 (diff) | |
download | gnulib-c20b0560d1c6f31c35e502a58a283f07e1a72869.tar.gz |
New module 'wmemcpy'.
* modules/wmemcpy: New file.
* lib/wchar.in.h (wmemcpy): New declaration.
* lib/wmemcpy.c: New file.
* lib/wmemcpy-impl.h: New file, from libutf8 with modifications.
* m4/wmemcpy.m4: New file.
* m4/wchar_h.m4 (gl_WCHAR_H): Test whether wmemcpy is declared.
(gl_WCHAR_H_DEFAULTS): Initialize GNULIB_WMEMCPY, HAVE_WMEMCPY.
* modules/wchar (Makefile.am): Substitute GNULIB_WMEMCPY, HAVE_WMEMCPY.
* tests/test-wchar-c++.cc: Test the declaration of wmemcpy.
* doc/posix-functions/wmemcpy.texi: Mention the new module.
Diffstat (limited to 'lib/wmemcpy-impl.h')
-rw-r--r-- | lib/wmemcpy-impl.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/wmemcpy-impl.h b/lib/wmemcpy-impl.h new file mode 100644 index 0000000000..6802e76732 --- /dev/null +++ b/lib/wmemcpy-impl.h @@ -0,0 +1,26 @@ +/* Copy wide character array. + Copyright (C) 1999, 2011 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 1999. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +wchar_t * +wmemcpy (wchar_t *dest, const wchar_t *src, size_t n) +{ + wchar_t *destptr = dest; + + for (; n > 0; n--) + *destptr++ = *src++; + return dest; +} |