1*a9fa9459Szrj /* Implement the mempcpy function.
2*a9fa9459Szrj Copyright (C) 2003, 2004, 2005, 2011 Free Software Foundation, Inc.
3*a9fa9459Szrj Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
4*a9fa9459Szrj
5*a9fa9459Szrj This file is part of the libiberty library.
6*a9fa9459Szrj Libiberty is free software; you can redistribute it and/or
7*a9fa9459Szrj modify it under the terms of the GNU Library General Public
8*a9fa9459Szrj License as published by the Free Software Foundation; either
9*a9fa9459Szrj version 2 of the License, or (at your option) any later version.
10*a9fa9459Szrj
11*a9fa9459Szrj Libiberty is distributed in the hope that it will be useful,
12*a9fa9459Szrj but WITHOUT ANY WARRANTY; without even the implied warranty of
13*a9fa9459Szrj MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14*a9fa9459Szrj Library General Public License for more details.
15*a9fa9459Szrj
16*a9fa9459Szrj You should have received a copy of the GNU Library General Public
17*a9fa9459Szrj License along with libiberty; see the file COPYING.LIB. If
18*a9fa9459Szrj not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19*a9fa9459Szrj Boston, MA 02110-1301, USA. */
20*a9fa9459Szrj
21*a9fa9459Szrj /*
22*a9fa9459Szrj
23*a9fa9459Szrj @deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, @
24*a9fa9459Szrj size_t @var{length})
25*a9fa9459Szrj
26*a9fa9459Szrj Copies @var{length} bytes from memory region @var{in} to region
27*a9fa9459Szrj @var{out}. Returns a pointer to @var{out} + @var{length}.
28*a9fa9459Szrj
29*a9fa9459Szrj @end deftypefn
30*a9fa9459Szrj
31*a9fa9459Szrj */
32*a9fa9459Szrj
33*a9fa9459Szrj #include <ansidecl.h>
34*a9fa9459Szrj #include <stddef.h>
35*a9fa9459Szrj
36*a9fa9459Szrj extern PTR memcpy (PTR, const PTR, size_t);
37*a9fa9459Szrj
38*a9fa9459Szrj PTR
mempcpy(PTR dst,const PTR src,size_t len)39*a9fa9459Szrj mempcpy (PTR dst, const PTR src, size_t len)
40*a9fa9459Szrj {
41*a9fa9459Szrj return (char *) memcpy (dst, src, len) + len;
42*a9fa9459Szrj }
43