1#include <stdio.h>
2#include <stdlib.h>
3#include <string.h>
4#include <BSafe/bsafe.h>
5
6void T_free(POINTER block)
7{
8    if (block != NULL_PTR) {
9		free(block);
10    }
11}
12
13POINTER T_malloc(unsigned int len)
14{
15    return (POINTER) malloc(len ? len : 1);
16}
17
18int T_memcmp(POINTER firstBlock, POINTER secondBlock, unsigned int len)
19{
20    if (len == 0) {
21		return 0;
22    }
23    return memcmp(firstBlock, secondBlock, len);
24}
25
26void T_memcpy(POINTER output, POINTER input, unsigned int len)
27{
28    if (len != 0) {
29		memcpy(output, input, len);
30    }
31}
32
33void T_memmove(POINTER output, POINTER input, unsigned int len)
34{
35    if (len != 0) {
36		memmove(output, input, len);
37    }
38}
39
40void T_memset(POINTER output, int value, unsigned int len)
41{
42    if (len != 0) {
43		memset(output, value, len);
44    }
45}
46
47POINTER T_realloc(POINTER block, unsigned int len)
48{
49    if (block == NULL_PTR)
50		return (POINTER) malloc(len ? len : 1);
51
52	return (POINTER)realloc(block, len);
53}
54