Started migrating things to EXT

This commit is contained in:
Leonardo Vencovsky committed 2020-05-29 20:19:47 -03:00
1 parent e39d60ade9
commit 89254ab5db
11 files changed
+1131 -1071

No files matched your search

+12 -2
View File
@@ -3,8 +3,9 @@
#include "macro_collections.h"
// clang-format off
C_MACRO_COLLECTIONS_ALL(CMC, DEQUE, ( d, deque, , , int))
C_MACRO_COLLECTIONS_ALL(CMC, HASHMAP, ( hm, hashmap, , int, int))
C_MACRO_COLLECTIONS_ALL(CMC, DEQUE, ( d, deque, , , int))
C_MACRO_COLLECTIONS_ALL(CMC, HASHMAP, ( hm, hashmap, , int, int))
C_MACRO_COLLECTIONS_ALL(CMC, HASHMULTIMAP, (hmm, hashmultimap, , int, int))
struct
{
@@ -21,16 +22,22 @@ int main(void)
struct deque *d = d_new(100, (struct deque_fval *)&int_ftab);
struct hashmap *hm = hm_new(100, 0.6, (struct hashmap_fkey *)&int_ftab,
(struct hashmap_fval *)&int_ftab);
struct hashmultimap *hmm = hmm_new(100, 0.6,
(struct hashmultimap_fkey *)&int_ftab,
(struct hashmultimap_fval *)&int_ftab);
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", " : ");
for (int i = 0; i < 20; i++)
{
d_push_back(d, i);
hm_insert(hm, i, i);
hmm_insert(hmm, i, i);
}
fprintf(stdout, "\n");
@@ -39,9 +46,12 @@ int main(void)
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", " : ");
d_free(d);
hm_free(hm);
hmm_free(hmm);
}
// clang-format on