2 |
This function is in the public domain. */ |
This function is in the public domain. */ |
3 |
|
|
4 |
/* |
/* |
|
NAME |
|
|
memcpy -- copy memory regions of arbitary length |
|
5 |
|
|
6 |
SYNOPSIS |
@deftypefn Supplemental void* memcpy (void *@var{out}, const void *@var{in}, size_t @var{length}) |
7 |
void* memcpy (void *out, const void *in, size_t n); |
|
8 |
|
Copies @var{length} bytes from memory region @var{in} to region |
9 |
|
@var{out}. Returns a pointer to @var{out}. |
10 |
|
|
11 |
|
@end deftypefn |
12 |
|
|
|
DESCRIPTION |
|
|
Copy LENGTH bytes from memory region pointed to by IN to memory |
|
|
region pointed to by OUT. |
|
13 |
*/ |
*/ |
14 |
|
|
15 |
#include <ansidecl.h> |
#include <ansidecl.h> |
16 |
#ifdef __STDC__ |
#ifdef ANSI_PROTOTYPES |
17 |
#include <stddef.h> |
#include <stddef.h> |
18 |
#else |
#else |
19 |
#define size_t unsigned long |
#define size_t unsigned long |
20 |
#endif |
#endif |
21 |
|
|
22 |
|
void bcopy PARAMS((const void*, void*, size_t)); |
23 |
|
|
24 |
PTR |
PTR |
25 |
DEFUN(memcpy, (out, in, length), PTR out AND const PTR in AND size_t length) |
memcpy (out, in, length) |
26 |
|
PTR out; |
27 |
|
const PTR in; |
28 |
|
size_t length; |
29 |
{ |
{ |
30 |
bcopy(in, out, length); |
bcopy(in, out, length); |
31 |
return out; |
return out; |