-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.h
More file actions
46 lines (33 loc) · 726 Bytes
/
Array.h
File metadata and controls
46 lines (33 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef ARRAY_H_
#define ARRAY_H_
#include <stdint.h>
#include "generics.h"
def_all(uint8_t)
def_all(int8_t)
def_all(uint16_t)
def_all(int16_t)
def_all(uint32_t)
def_all(int32_t)
def_all(uint64_t)
def_all(int64_t)
#define unsigned char u_char
def_all(char)
def_all(short)
def_all(int)
def_all(float)
def_all(double)
#define var(T) \
array_##T
#define alloc(T, len) \
alloc_memory_##T(len);
#define Array(T, len) \
alloc(T, len);
#define realloc(T, obj, len) \
realloc_memory_##T(obj, len);
#define get(T, obj, pos, status) \
get_##T(obj, pos, status);
#define set(T, obj, pos, value) \
set_##T(obj, pos, value);
#define free_array(T, obj) \
free_array_##T(obj);
#endif