Contents
Notes
This module provides three functions for copying, moving, and filling memory blocks, respectively.
Include
string.h |
Functions
ao_mem_copy
#define ao_mem_copy(d, s, n) \
( \
memcpy(d, s, n) \
)
Copies the first n
bytes from the memory block beginning at s
to the memory block beginning at d
. This function copies the data directly. Therefore, the memory blocks should not overlap. This function returns d
.
ao_mem_move
#define ao_mem_move(d, s, n) \
( \
memmove(d, s, n) \
)
Copies the first n
bytes from the memory block beginning at s
to the memory block beginning at d
. This function copies the data using a temporary buffer. Therefore, the memory blocks can overlap. This function returns d
.
ao_mem_set
#define ao_mem_set(p, v, n) \
( \
memset(p, (int) (v), n) \
)
Writes v
to the first n
bytes of the memory block beginning at p
. This function returns p
.