1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3
4#include "mem.h"
5
6void mem_copy(void *dest, const void *source, size_t size)
7{
8 memcpy(dest: dest, src: source, n: size);
9}
10
11void mem_move(void *dest, const void *source, size_t size)
12{
13 memmove(dest: dest, src: source, n: size);
14}
15
16int mem_comp(const void *a, const void *b, size_t size)
17{
18 return memcmp(s1: a, s2: b, n: size);
19}
20
21bool mem_has_null(const void *block, size_t size)
22{
23 const unsigned char *bytes = (const unsigned char *)block;
24 for(size_t i = 0; i < size; i++)
25 {
26 if(bytes[i] == 0)
27 {
28 return true;
29 }
30 }
31 return false;
32}
33