KallistiOS  2.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions
string.h File Reference

Variants on standard block memory copy/set functions. More...

#include <sys/cdefs.h>
#include <string.h>

Go to the source code of this file.

Functions

void * memcpy4 (void *dest, const void *src, size_t count)
 Copy a block of memory, 4 bytes at a time.
void * memset4 (void *s, unsigned long c, size_t count)
 Set a block of memory, 4 bytes at a time.
void * memcpy2 (void *dest, const void *src, size_t count)
 Copy a block of memory, 2 bytes at a time.
void * memset2 (void *s, unsigned short c, size_t count)
 Set a block of memory, 2 bytes at a time.

Detailed Description

Variants on standard block memory copy/set functions.

This file contains variants on the standard block memory copy/set functions. These variants copy/set memory in the specified block sizes, which may be helpful for interacting with memory-mapped hardware.

Author:
Dan Potter

Function Documentation

void* memcpy2 ( void *  dest,
const void *  src,
size_t  count 
)

Copy a block of memory, 2 bytes at a time.

This function is identical to memcpy(), except it copies 2 bytes at a time.

Parameters:
destThe destination of the copy.
srcThe source to copy.
countThe number of bytes to copy. This should be divisible by 2 (and will be rounded down if not).
Returns:
The original value of dest.
void* memcpy4 ( void *  dest,
const void *  src,
size_t  count 
)

Copy a block of memory, 4 bytes at a time.

This function is identical to memcpy(), except it copies 4 bytes at a time.

Parameters:
destThe destination of the copy.
srcThe source to copy.
countThe number of bytes to copy. This should be divisible by 4 (and will be rounded down if not).
Returns:
The original value of dest.
void* memset2 ( void *  s,
unsigned short  c,
size_t  count 
)

Set a block of memory, 2 bytes at a time.

This function is identical to memset(), except it sets 2 bytes at a time. This implies that all 16-bits of c are used, not just the first 8 as in memset().

Parameters:
sThe destination of the set.
cThe value to set to.
countThe number of bytes to set. This should be divisible by 2 (and will be rounded down if not).
Returns:
The original value of dest.
void* memset4 ( void *  s,
unsigned long  c,
size_t  count 
)

Set a block of memory, 4 bytes at a time.

This function is identical to memset(), except it sets 4 bytes at a time. This implies that all 32-bits of c are used, not just the first 8 as in memset().

Parameters:
sThe destination of the set.
cThe value to set to.
countThe number of bytes to set. This should be divisible by 4 (and will be rounded down if not).
Returns:
The original value of dest.