12 printf("%i\n", (int)sizeof(struct mybucket));
15 uhtbl_init(&tbl, sizeof(struct mybucket), 16, hash_murmur2, NULL);
16 struct mybucket *bucket;
18 const char *t[] = {"null", "eins", "zwei", "drei", "vier", "fünf", "sechs",
19 "sieben", "acht", "neun", "zehn", "elf", "zwölf", "dreizehn",
20 "vierzehn", "fünfzehn", "sechzehn", "siebzehn", "achtzehn",
21 "neunzehn", "zwanzig", "einundzwanzig", "zweiundzwanzig",
22 "dreiundzwanzig", "virundzwanzig", "fünfundzwanzig", "sechsundzwanzig",
23 "siebenundzwanzig", "achtundzwanzig", "neunundzwanzig", "dreißig",
24 "einunddreißig", "zweiunddreißig"};
25 for (int i = 0; i < 33; i++) {
26 bucket = (struct mybucket*)uhtbl_set(&tbl, t[i], strlen(t[i]));
31 while ((bucket = (struct mybucket*)uhtbl_next(&tbl, &iter))) {
32 printf("%i\t", (int)bucket->mydata);
34 printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);
36 for (int i = 0; i < 33; i++) {
37 bucket = (struct mybucket*)uhtbl_set(&tbl, 0, i);
42 while ((bucket = (struct mybucket*)uhtbl_next(&tbl, &iter))) {
43 printf("%i\t", (int)bucket->mydata);
45 printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);
47 for (int i = 0; i < 33; i++) {
48 if (uhtbl_unset(&tbl, 0, i)) {
49 printf("Unset failed %i\n", i);
51 if (uhtbl_unset(&tbl, t[i], strlen(t[i]))) {
52 printf("Unset failed %s\n", t[i]);
57 while ((bucket = (struct mybucket*)uhtbl_next(&tbl, &iter))) {
58 printf("%i\t", (int)bucket->mydata);
60 printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);
62 for (int i = 0; i < 33; i++) {
63 bucket = (struct mybucket*)uhtbl_set(&tbl, t[i], strlen(t[i]));
67 for (int i = 0; i < 33; i++) {
68 bucket =(struct mybucket*) uhtbl_set(&tbl, 0, i);
72 for (int i = 0; i < 33; i++) {
73 bucket = (struct mybucket*)uhtbl_set(&tbl, t[i], strlen(t[i]));
77 for (int i = 0; i < 33; i++) {
78 bucket = (struct mybucket*)uhtbl_set(&tbl, 0, i);
83 while ((bucket = (struct mybucket*)uhtbl_next(&tbl, &iter))) {
84 printf("%i\t", (int)bucket->mydata);
86 printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);
88 for (int i = 0; i < 33; i++) {
89 bucket = (struct mybucket*)uhtbl_get(&tbl, t[i], strlen(t[i]));
90 printf("%i\t", (int)bucket->mydata);
91 bucket = (struct mybucket*)uhtbl_get(&tbl, 0, i);
92 printf("%i\t", (int)bucket->mydata);
94 printf("\nSize: %i, Used: %i\n\n", tbl.size, tbl.used);