Compares memory until they differ, and their difference is returned in diff.
If the block of memory is the same, diff=0.
- Parameters
-
dest | pointer to memory to compare against |
src | pointer to the source memory to compare with dest |
dmax | maximum length of dest, in bytess |
smax | length of the source memory block |
*diff | pointer 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
-
EOK | when operation is successful |
ESNULLP | when dst/src is NULL POINTER |
ESZEROL | when dmax/smax = ZERO |
ESLEMAX | when dmax/smax > RSIZE_MAX_MEM |
ESNOSPC | when dmax < smax |
- See also
- memcmp_s(), memcmp32_s()