More stuff moved to EXT

This commit is contained in:
Leonardo Vencovsky committed 2020-06-02 15:20:34 -03:00
1 parent 424ba074ff
commit 97f46b3a81
4 files changed
+443 -346

No files matched your search

+35 -1
View File
@@ -9,6 +9,7 @@ C_MACRO_COLLECTIONS_ALL(CMC, HASHMULTIMAP, (hmm, hashmultimap, , int, int))
C_MACRO_COLLECTIONS_ALL(CMC, HASHMULTISET, (hms, hashmultiset, , , int))
C_MACRO_COLLECTIONS_ALL(CMC, HASHSET, ( hs, hashset, , , int))
C_MACRO_COLLECTIONS_ALL(CMC, HEAP, ( h, heap, , , int))
C_MACRO_COLLECTIONS_ALL(CMC, INTERVALHEAP, ( ih, intervalheap, , , int))
struct
{
@@ -33,6 +34,7 @@ int main(void)
struct hashset *hs = hs_new(100, 0.6,
(struct hashset_fval *)&int_ftab);
struct heap *h = h_new(100, CMC_MAX_HEAP, (struct heap_fval *)&int_ftab);
struct intervalheap *ih = ih_new(100, (struct intervalheap_fval *)&int_ftab);
d_to_string(d, stdout);
d_print(d, stdout, "\n[ ", ", ", " ]\n");
@@ -46,8 +48,35 @@ int main(void)
hs_print(hs, stdout, "\n[ ", ", ", " ]\n");
h_to_string(h, stdout);
h_print(h, stdout, "\n[ ", ", ", " ]\n");
ih_to_string(ih, stdout);
ih_print(ih, stdout, "\n[ ", ", ", " ]\n");
for (int i = 0; i < 20; i++)
fprintf(stdout, "\n");
d_push_back(d, 0);
hm_insert(hm, 0, 0);
hmm_insert(hmm, 0, 0);
hms_insert(hms, 0);
hs_insert(hs, 0);
h_insert(h, 0);
ih_insert(ih, 0);
d_to_string(d, stdout);
d_print(d, stdout, "\n[ ", ", ", " ]\n");
hm_to_string(hm, stdout);
hm_print(hm, stdout, "\n[ {", "}, {", "} ]\n", " : ");
hmm_to_string(hmm, stdout);
hmm_print(hmm, stdout, "\n[ {", "}, {", "} ]\n", " : ");
hms_to_string(hms, stdout);
hms_print(hms, stdout, "\n[ {", "}, {", "} ]\n", " : ");
hs_to_string(hs, stdout);
hs_print(hs, stdout, "\n[ ", ", ", " ]\n");
h_to_string(h, stdout);
h_print(h, stdout, "\n[ ", ", ", " ]\n");
ih_to_string(ih, stdout);
ih_print(ih, stdout, "\n[ ", ", ", " ]\n");
for (int i = 1; i < 20; i++)
{
d_push_back(d, i);
hm_insert(hm, i, i);
@@ -55,6 +84,7 @@ int main(void)
hms_insert(hms, i);
hs_insert(hs, i);
h_insert(h, i);
ih_insert(ih, i);
}
fprintf(stdout, "\n");
@@ -71,12 +101,16 @@ int main(void)
hs_print(hs, stdout, "\n[ ", ", ", " ]\n");
h_to_string(h, stdout);
h_print(h, stdout, "\n[ ", ", ", " ]\n");
ih_to_string(ih, stdout);
ih_print(ih, stdout, "\n[ ", ", ", " ]\n");
d_free(d);
hm_free(hm);
hmm_free(hmm);
hms_free(hms);
hs_free(hs);
h_free(h);
ih_free(ih);
}
// clang-format on