blob: b19435264afa7533e30bf12ae936060600e9c760 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "hash.h"
#include <string.h>
#include <stdio.h>
int main()
{
void *map = hash_init(10000, hash_djb, compare_strings);
hash_insert(map, "a",1);
hash_insert(map, "b",2);
hash_resize(map, 2);
void *ptr = map, *save, *key;
while(1)
{
void *data = hash_iterate(ptr, &save, &key);
ptr = NULL;
if(data)
printf("%s %d\n", key, data);
else
break;
}
}
|