Partially finished client
This commit is contained in:
@@ -57,4 +57,15 @@ void memoryMove(void *dest, const void *src, const size_t size) {
|
||||
assertTrue(size > 0, "Cannot move 0 bytes of memory.");
|
||||
assertTrue(dest != src, "Cannot move memory to itself.");
|
||||
memmove(dest, src, size);
|
||||
}
|
||||
|
||||
ssize_t memoryCompare(
|
||||
const void *a,
|
||||
const void *b,
|
||||
const size_t size
|
||||
) {
|
||||
assertNotNull(a, "Cannot compare NULL memory.");
|
||||
assertNotNull(b, "Cannot compare NULL memory.");
|
||||
assertTrue(size > 0, "Cannot compare 0 bytes of memory.");
|
||||
return memcmp(a, b, size);
|
||||
}
|
||||
@@ -73,4 +73,18 @@ void memoryCopyRangeSafe(
|
||||
* @param src The source to move from.
|
||||
* @param size The size of the memory to move.
|
||||
*/
|
||||
void memoryMove(void *dest, const void *src, const size_t size);
|
||||
void memoryMove(void *dest, const void *src, const size_t size);
|
||||
|
||||
/**
|
||||
* Compares memory.
|
||||
*
|
||||
* @param a The first memory to compare.
|
||||
* @param b The second memory to compare.
|
||||
* @param size The size of the memory to compare.
|
||||
* @return 0 if the memory is equal, < 0 if a < b, > 0 if a > b.
|
||||
*/
|
||||
ssize_t memoryCompare(
|
||||
const void *a,
|
||||
const void *b,
|
||||
const size_t size
|
||||
);
|
||||
Reference in New Issue
Block a user