Partially finished client

This commit is contained in:
2025-04-09 17:21:49 -05:00
parent 6c71debd05
commit 1b336ff559
19 changed files with 664 additions and 47 deletions

View File

@@ -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);
}

View File

@@ -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
);