-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestmap.c
More file actions
26 lines (19 loc) · 708 Bytes
/
testmap.c
File metadata and controls
26 lines (19 loc) · 708 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
#include "map.h"
int main(){
map_t map;
initMap(&map);
char str1[] = "test str";
printf("going to add '%s' to map\n", str1);
addMapMembers(&map, str1, STR, false, "SsdS", STRVIEW("test1"), "other test" , 5, STRVIEW("diff" ));
int i = 5;
addMapMembers(&map, &i, INT, true , "SsdS", STRVIEW("test2"), "another thing", 5, STRVIEW("i dunno"));
printMap(&map);
int j = getMapMember_int(&map, "another", 5);
printf("j = %d (%.*s)\n", j, 5, "another");
const char * teststr = getMapMemberData(&map, "diff", 4);
printf("teststr = '%s' (%.*s)\n", teststr, 4, "diff");
printf("going to free map\n");
freeMap(&map);
puts("done");
return 0;
}