xref: /openbsd/gnu/usr.bin/cvs/lib/memmove.c (revision 1e72d8d2)
1 /* memmove -- copy memory regions of arbitary length
2    Copyright (C) 1991 Free Software Foundation, Inc.
3 
4 This file is part of the libiberty library.
5 Libiberty is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9 
10 Libiberty is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 Library General Public License for more details.
14 
15 You should have received a copy of the GNU Library General Public
16 License along with libiberty; see the file COPYING.LIB.  If
17 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
18 Cambridge, MA 02139, USA.  */
19 
20 
21 /*
22 
23 NAME
24 
25 	memmove -- copy memory regions of arbitary length
26 
27 SYNOPSIS
28 
29 	void memmove (void *out, const void *in, size_t n);
30 
31 DESCRIPTION
32 
33 	Copy LENGTH bytes from memory region pointed to by IN to memory
34 	region pointed to by OUT.
35 
36 	Regions can be overlapping.
37 */
38 
39 #ifdef HAVE_CONFIG_H
40 #include "config.h"
41 #endif
42 
43 #ifdef __STDC__
44 #include <stddef.h>
45 #else
46 #define size_t unsigned long
47 #endif
48 
49 void *
50 memmove (out, in, length)
51      void *out;
52      const void* in;
53      size_t length;
54 {
55     bcopy(in, out, length);
56     return out;
57 }
58