safec  3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
memcmp32_s.c File Reference
#include "safe_mem_lib.h"
+ Include dependency graph for memcmp32_s.c:

Functions

EXPORT errno_t memcmp32_s (const uint32_t *dest, rsize_t dmax, const uint32_t *src, rsize_t smax, int *diff)
 Compares memory until they differ, and their difference is returned in diff. More...
 

Function Documentation

◆ memcmp32_s()

EXPORT errno_t memcmp32_s ( const uint32_t *  dest,
rsize_t  dmax,
const uint32_t *  src,
rsize_t  smax,
int *  diff 
)

Compares memory until they differ, and their difference is returned in diff.

If the block of memory is the same, diff=0.

Remarks
EXTENSION TO ISO/IEC JTC1 SC22 WG14 N1172, Programming languages, environments and system software interfaces, Extensions to the C Library, Part I: Bounds-checking interfaces
Parameters
destpointer to memory to compare against
srcpointer to the source memory to compare with dest
dmaxmaximum length of dest, in bytess
smaxlength of the source memory block
*diffpointer to the diff which is an integer greater than, equal to or less than zero according to whether the object pointed to by dest is greater than, equal to or less than the object pointed to by src.
Precondition
Neither dest nor src shall be a null pointer.
Neither dmax nor smax shall be 0.
dmax shall not be greater than RSIZE_MAX_MEM.
smax shall not be greater than dmax.
Return values
EOKwhen operation is successful
ESNULLPwhen dst/src is NULL POINTER
ESZEROLwhen dmax/smax = ZERO
ESLEMAXwhen dmax/smax > RSIZE_MAX_MEM
ESNOSPCwhen dmax < smax
See also
memcmp_s(), memcmp16_s()