xref: /openbsd-src/gnu/lib/libiberty/src/mempcpy.c (revision 20fce977aadac3358da45d5027d7d19cdc03b0fe)
132d62142Sespie /* Implement the mempcpy function.
2*20fce977Smiod    Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
332d62142Sespie    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
432d62142Sespie 
532d62142Sespie This file is part of the libiberty library.
632d62142Sespie Libiberty is free software; you can redistribute it and/or
732d62142Sespie modify it under the terms of the GNU Library General Public
832d62142Sespie License as published by the Free Software Foundation; either
932d62142Sespie version 2 of the License, or (at your option) any later version.
1032d62142Sespie 
1132d62142Sespie Libiberty is distributed in the hope that it will be useful,
1232d62142Sespie but WITHOUT ANY WARRANTY; without even the implied warranty of
1332d62142Sespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1432d62142Sespie Library General Public License for more details.
1532d62142Sespie 
1632d62142Sespie You should have received a copy of the GNU Library General Public
1732d62142Sespie License along with libiberty; see the file COPYING.LIB.  If
18*20fce977Smiod not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
19*20fce977Smiod Boston, MA 02110-1301, USA.  */
2032d62142Sespie 
2132d62142Sespie /*
2232d62142Sespie 
2332d62142Sespie @deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, size_t @var{length})
2432d62142Sespie 
2532d62142Sespie Copies @var{length} bytes from memory region @var{in} to region
2632d62142Sespie @var{out}.  Returns a pointer to @var{out} + @var{length}.
2732d62142Sespie 
2832d62142Sespie @end deftypefn
2932d62142Sespie 
3032d62142Sespie */
3132d62142Sespie 
3232d62142Sespie #include <ansidecl.h>
3332d62142Sespie #include <stddef.h>
3432d62142Sespie 
35*20fce977Smiod extern PTR memcpy (PTR, const PTR, size_t);
3632d62142Sespie 
3732d62142Sespie PTR
mempcpy(PTR dst,const PTR src,size_t len)38*20fce977Smiod mempcpy (PTR dst, const PTR src, size_t len)
3932d62142Sespie {
4032d62142Sespie   return (char *) memcpy (dst, src, len) + len;
4132d62142Sespie }
42