Back to index

cell-binutils  2.17cvs20070401
Functions
memmove.c File Reference
#include <ansidecl.h>
#include <stddef.h>

Go to the source code of this file.

Functions

void bcopy (const void *, void *, size_t)
PTR memmove (PTR s1, const PTR s2, size_t n)

Function Documentation

void bcopy ( const void *  ,
void *  ,
size_t   
)

Definition at line 15 of file bcopy.c.

{
  if (dest < src)
    {
      const char *firsts = (const char *) src;
      char *firstd = (char *) dest;
      while (len--)
       *firstd++ = *firsts++;
    }
  else
    {
      const char *lasts = (const char *)src + (len-1);
      char *lastd = (char *)dest + (len-1);
      while (len--)
        *lastd-- = *lasts--;
    }
}
PTR memmove ( PTR  s1,
const PTR  s2,
size_t  n 
)

Definition at line 21 of file memmove.c.

{
  bcopy (s2, s1, n);
  return s1;
}

Here is the caller graph for this function: