RTI Connext DDS Micro C API  Version 4.1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
OSAPI Memory API

Functions

void OSAPI_Memory_copy (void *dest, const void *src, RTI_SIZE_T size)
 Copies size bytes from non-overlapping src to dest.
void OSAPI_Memory_zero (void *mem, RTI_SIZE_T size)
 Sets memory region to 0.
RTI_INT32 OSAPI_Memory_compare (const void *left, const void *right, RTI_SIZE_T size)
 Byte-wise compare of two memory regions.
void OSAPI_Memory_move (void *dest, const void *src, RTI_SIZE_T size)
 Moves size bytes from non-overlapping src to dest.
void * OSAPI_Memory_fndchr (const void *s, RTI_INT32 c, RTI_SIZE_T n)
 Locate byte in byte string.

Detailed Description


Function Documentation

void OSAPI_Memory_copy ( void *  dest,
const void *  src,
RTI_SIZE_T  size 
)

Copies size bytes from non-overlapping src to dest.

Valid dest and src >= size, where size >= 0. The src and dst memory regions should NOT overlap or the results will be undetermined. On success move size number of bytes from in [dest, dest+size) are identical to [src, src+size).

Parameters:
[out]destPointer to destination memory region.
[in]srcPointer to source memory region.
[in]sizeNumber of bytes to copy starting at dest.
Exceptions:
None.
MT Safety:
src cannot be modified concurrently and dest cannot be modified or read concurrently.
void OSAPI_Memory_zero ( void *  mem,
RTI_SIZE_T  size 
)

Sets memory region to 0.

Clear a memory region. Valid memory >= size, where size >= 0. On On success [mem, mem+size) is filled with 0.

Parameters:
[out]memPointer to memory region to be modified.
[in]sizeNumber of bytes to fill with zeroes, starting at mem.
Exceptions:
None.
MT Safety:
mem cannot be modified or read concurrently.
RTI_INT32 OSAPI_Memory_compare ( const void *  left,
const void *  right,
RTI_SIZE_T  size 
)

Byte-wise compare of two memory regions.

This function performs a byte-wise comparison of two memory regions of size bytes. left and right must be >= 0 and size >= 0. This function does not alter any memory content.

Parameters:
[in]leftPointer to logical "left" side of the inequality test.
[in]rightPointer to logical "right" side of the inequality test.
[in]sizeNumber of bytes to compare, starting from left to right.
Returns:
less than, equal to, or greater than 0, according to whether left is lexicographically less than, equal to, or greater than right when taken as unsigned characters.
void OSAPI_Memory_move ( void *  dest,
const void *  src,
RTI_SIZE_T  size 
)

Moves size bytes from non-overlapping src to dest.

Copy size bytes from source to dest. Valid dest and source must point to memory regions >= size, where size >= 0. The source and dest memory regions may overlap. On return, size number of bytes from source has been copied to[dest, dest + size) and is identical to [source, source + size].

Parameters:
[out]destPointer to destination memory region.
[in]srcPointer to source memory region.
[in]sizeNumber of bytes to copy from source to dest.
Exceptions:
None.
MT Safety:
source cannot be modified concurrently; dest cannot be modified or read concurrently.
void* OSAPI_Memory_fndchr ( const void *  s,
RTI_INT32  c,
RTI_SIZE_T  n 
)

Locate byte in byte string.

Locate byte in byte string.

Parameters:
[in]sPointer to beginning of byte string.
[in]cByte to search for.
[in]nMaximum search length.
Returns:
pointer to first occurrence of c if found, NULL otherwise.

RTI Connext DDS Micro C API Version 4.1.0 Copyright © Sun Dec 8 2024 Real-Time Innovations, Inc