skipstone/examples/map.c

26 lines
532 B
C
Raw Permalink Normal View History

2017-11-22 20:29:00 +00:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <skipstone/map.h>
int main(int argc, char **argv) {
skipstone_map *map;
if ((map = skipstone_map_new()) == NULL) {
perror("skipstone_map_new()");
return 1;
}
2017-11-23 17:22:36 +00:00
skipstone_map_set(map, 0xdead, (void *)0xdeadbeef);
skipstone_map_set(map, 0xbeef, (void *)0xcafebabe);
2017-11-22 20:29:00 +00:00
printf("%p\n", skipstone_map_get(map, 0xdead));
printf("%p\n", skipstone_map_get(map, 0xbeef));
skipstone_map_destroy(map, NULL);
2017-11-22 20:29:00 +00:00
return 0;
}