Completely removed typedefs
This commit is contained in:
1 parent
db61269d42
commit
33c33e8947
55 files changed
+8637
-8651
No files matched your search
@@ -18,7 +18,7 @@
|
||||
|
||||
int main(void)
|
||||
{
|
||||
cmc_timer timer;
|
||||
struct cmc_timer timer;
|
||||
|
||||
cmc_timer_start(timer);
|
||||
uintmax_t failed = 0;
|
||||
|
||||
@@ -52,7 +52,7 @@ size_t bm_capacity(bidimap *_map_);
|
||||
double bm_load(bidimap *_map_);
|
||||
bidimap *bm_copy_of(bidimap *_map_, size_t (*key_copy_func)(size_t), size_t (*value_copy_func)(size_t));
|
||||
_Bool bm_equals(bidimap *_map1_, bidimap *_map2_);
|
||||
cmc_string bm_to_string(bidimap *_map_);
|
||||
struct cmc_string bm_to_string(bidimap *_map_);
|
||||
bidimap_iter *bm_iter_new(bidimap *target);
|
||||
void bm_iter_free(bidimap_iter *iter);
|
||||
void bm_iter_init(bidimap_iter *iter, bidimap *target);
|
||||
@@ -201,9 +201,9 @@ size_t bm_capacity(bidimap *_map_) { return _map_->capacity; }
|
||||
double bm_load(bidimap *_map_) { return _map_->load; }
|
||||
bidimap *bm_copy_of(bidimap *_map_, size_t (*key_copy_func)(size_t), size_t (*value_copy_func)(size_t)) { return ((void *)0); }
|
||||
_Bool bm_equals(bidimap *_map1_, bidimap *_map2_) { return 0; }
|
||||
cmc_string bm_to_string(bidimap *_map_)
|
||||
struct cmc_string bm_to_string(bidimap *_map_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
bidimap *m_ = _map_;
|
||||
const char *name = "bidimap";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_bidimap, name, m_, m_->key_buffer, m_->val_buffer, m_->capacity, m_->count, m_->load, m_->key_cmp, m_->val_cmp, m_->key_hash, m_->val_hash);
|
||||
|
||||
@@ -37,7 +37,7 @@ size_t d_capacity(deque *_deque_);
|
||||
_Bool d_resize(deque *_deque_, size_t capacity);
|
||||
deque *d_copy_of(deque *_deque_, size_t (*copy_func)(size_t));
|
||||
_Bool d_equals(deque *_deque1_, deque *_deque2_, int (*comparator)(size_t, size_t));
|
||||
cmc_string d_to_string(deque *_deque_);
|
||||
struct cmc_string d_to_string(deque *_deque_);
|
||||
deque_iter *d_iter_new(deque *target);
|
||||
void d_iter_free(deque_iter *iter);
|
||||
void d_iter_init(deque_iter *iter, deque *target);
|
||||
@@ -232,9 +232,9 @@ _Bool d_equals(deque *_deque1_, deque *_deque2_, int (*comparator)(size_t, size_
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string d_to_string(deque *_deque_)
|
||||
struct cmc_string d_to_string(deque *_deque_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
deque *d_ = _deque_;
|
||||
const char *name = "deque";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_deque, name, d_, d_->buffer, d_->capacity, d_->count, d_->front, d_->back);
|
||||
|
||||
@@ -18,7 +18,7 @@ typedef struct hashmap_entry_s
|
||||
size_t key;
|
||||
size_t value;
|
||||
size_t dist;
|
||||
enum cmc_entry_state_e state;
|
||||
enum cmc_entry_state state;
|
||||
} hashmap_entry, *hashmap_entry_ptr;
|
||||
typedef struct hashmap_iter_s
|
||||
{
|
||||
@@ -49,7 +49,7 @@ double hm_load(hashmap *_map_);
|
||||
_Bool hm_resize(hashmap *_map_, size_t capacity);
|
||||
hashmap *hm_copy_of(hashmap *_map_, size_t (*key_copy_func)(size_t), size_t (*value_copy_func)(size_t));
|
||||
_Bool hm_equals(hashmap *_map1_, hashmap *_map2_, int (*value_comparator)(size_t, size_t));
|
||||
cmc_string hm_to_string(hashmap *_map_);
|
||||
struct cmc_string hm_to_string(hashmap *_map_);
|
||||
hashmap_iter *hm_iter_new(hashmap *target);
|
||||
void hm_iter_free(hashmap_iter *iter);
|
||||
void hm_iter_init(hashmap_iter *iter, hashmap *target);
|
||||
@@ -363,9 +363,9 @@ _Bool hm_equals(hashmap *_map1_, hashmap *_map2_, int (*value_comparator)(size_t
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string hm_to_string(hashmap *_map_)
|
||||
struct cmc_string hm_to_string(hashmap *_map_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
hashmap *m_ = _map_;
|
||||
const char *name = "hashmap";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_hashmap, name, m_, m_->buffer, m_->capacity, m_->count, m_->load, m_->cmp, m_->hash);
|
||||
|
||||
@@ -17,7 +17,7 @@ typedef struct hashset_entry_s
|
||||
{
|
||||
size_t value;
|
||||
size_t dist;
|
||||
enum cmc_entry_state_e state;
|
||||
enum cmc_entry_state state;
|
||||
} hashset_entry, *hashset_entry_ptr;
|
||||
typedef struct hashset_iter_s
|
||||
{
|
||||
@@ -45,7 +45,7 @@ double hs_load(hashset *_set_);
|
||||
_Bool hs_resize(hashset *_set_, size_t capacity);
|
||||
hashset *hs_copy_of(hashset *_set_, size_t (*copy_func)(size_t));
|
||||
_Bool hs_equals(hashset *_set1_, hashset *_set2_);
|
||||
cmc_string hs_to_string(hashset *_set_);
|
||||
struct cmc_string hs_to_string(hashset *_set_);
|
||||
hashset *hs_union(hashset *_set1_, hashset *_set2_);
|
||||
hashset *hs_intersection(hashset *_set1_, hashset *_set2_);
|
||||
hashset *hs_difference(hashset *_set1_, hashset *_set2_);
|
||||
@@ -304,9 +304,9 @@ _Bool hs_equals(hashset *_set1_, hashset *_set2_)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string hs_to_string(hashset *_set_)
|
||||
struct cmc_string hs_to_string(hashset *_set_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
hashset *s_ = _set_;
|
||||
const char *name = "hashset";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_hashset, name, s_, s_->buffer, s_->capacity, s_->count, s_->load, s_->cmp, s_->hash);
|
||||
|
||||
@@ -7,7 +7,7 @@ typedef struct heap_s
|
||||
size_t *buffer;
|
||||
size_t capacity;
|
||||
size_t count;
|
||||
enum cmc_heap_order_e HO;
|
||||
enum cmc_heap_order HO;
|
||||
int (*cmp)(size_t, size_t);
|
||||
struct heap_iter_s (*it_start)(struct heap_s *);
|
||||
struct heap_iter_s (*it_end)(struct heap_s *);
|
||||
@@ -19,7 +19,7 @@ typedef struct heap_iter_s
|
||||
_Bool start;
|
||||
_Bool end;
|
||||
} heap_iter, *heap_iter_ptr;
|
||||
heap *h_new(size_t capacity, cmc_heap_order HO, int (*compare)(size_t, size_t));
|
||||
heap *h_new(size_t capacity, enum cmc_heap_order HO, int (*compare)(size_t, size_t));
|
||||
void h_clear(heap *_heap_, void (*deallocator)(size_t));
|
||||
void h_free(heap *_heap_, void (*deallocator)(size_t));
|
||||
_Bool h_insert(heap *_heap_, size_t element);
|
||||
@@ -33,7 +33,7 @@ size_t h_capacity(heap *_heap_);
|
||||
_Bool h_resize(heap *_heap_, size_t capacity);
|
||||
heap *h_copy_of(heap *_heap_, size_t (*copy_func)(size_t));
|
||||
_Bool h_equals(heap *_heap1_, heap *_heap2_);
|
||||
cmc_string h_to_string(heap *_heap_);
|
||||
struct cmc_string h_to_string(heap *_heap_);
|
||||
heap_iter *h_iter_new(heap *target);
|
||||
void h_iter_free(heap_iter *iter);
|
||||
void h_iter_init(heap_iter *iter, heap *target);
|
||||
@@ -52,7 +52,7 @@ static _Bool h_impl_float_up(heap *_heap_, size_t index);
|
||||
static _Bool h_impl_float_down(heap *_heap_, size_t index);
|
||||
static heap_iter h_impl_it_start(heap *_heap_);
|
||||
static heap_iter h_impl_it_end(heap *_heap_);
|
||||
heap *h_new(size_t capacity, cmc_heap_order HO, int (*compare)(size_t, size_t))
|
||||
heap *h_new(size_t capacity, enum cmc_heap_order HO, int (*compare)(size_t, size_t))
|
||||
{
|
||||
if (capacity < 1)
|
||||
return ((void *)0);
|
||||
@@ -187,9 +187,9 @@ _Bool h_equals(heap *_heap1_, heap *_heap2_)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string h_to_string(heap *_heap_)
|
||||
struct cmc_string h_to_string(heap *_heap_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
heap *h_ = _heap_;
|
||||
const char *name = "heap";
|
||||
const char *t = h_->HO == 1 ? "MaxHeap" : "MinHeap";
|
||||
|
||||
@@ -41,7 +41,7 @@ size_t ih_capacity(intervalheap *_heap_);
|
||||
_Bool ih_resize(intervalheap *_heap_, size_t capacity);
|
||||
intervalheap *ih_copy_of(intervalheap *_set_, size_t (*copy_func)(size_t));
|
||||
_Bool ih_equals(intervalheap *_heap1_, intervalheap *_heap2_);
|
||||
cmc_string ih_to_string(intervalheap *_heap_);
|
||||
struct cmc_string ih_to_string(intervalheap *_heap_);
|
||||
intervalheap_iter *ih_iter_new(intervalheap *target);
|
||||
void ih_iter_free(intervalheap_iter *iter);
|
||||
void ih_iter_init(intervalheap_iter *iter, intervalheap *target);
|
||||
@@ -323,9 +323,9 @@ _Bool ih_equals(intervalheap *_heap1_, intervalheap *_heap2_)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
cmc_string ih_to_string(intervalheap *_heap_)
|
||||
struct cmc_string ih_to_string(intervalheap *_heap_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
intervalheap *h_ = _heap_;
|
||||
const char *name = "intervalheap";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_intervalheap, name, h_, h_->buffer, h_->capacity, h_->size, h_->count, h_->cmp);
|
||||
|
||||
@@ -42,7 +42,7 @@ _Bool ll_empty(linkedlist *_list_);
|
||||
size_t ll_count(linkedlist *_list_);
|
||||
linkedlist *ll_copy_of(linkedlist *_list_, size_t (*copy_func)(size_t));
|
||||
_Bool ll_equals(linkedlist *_list1_, linkedlist *_list2_, int (*comparator)(size_t, size_t));
|
||||
cmc_string ll_to_string(linkedlist *_list_);
|
||||
struct cmc_string ll_to_string(linkedlist *_list_);
|
||||
linkedlist_node *ll_new_node(size_t element);
|
||||
void ll_free_node(linkedlist_node *_node_);
|
||||
linkedlist_node *ll_head(linkedlist *_list_);
|
||||
@@ -308,9 +308,9 @@ _Bool ll_equals(linkedlist *_list1_, linkedlist *_list2_, int (*comparator)(size
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string ll_to_string(linkedlist *_list_)
|
||||
struct cmc_string ll_to_string(linkedlist *_list_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
linkedlist *l_ = _list_;
|
||||
const char *name = "linkedlist";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_linkedlist, name, l_, l_->count, l_->head, l_->tail);
|
||||
|
||||
@@ -46,7 +46,7 @@ size_t l_capacity(list *_list_);
|
||||
_Bool l_resize(list *_list_, size_t capacity);
|
||||
list *l_copy_of(list *_list_, size_t (*copy_func)(size_t));
|
||||
_Bool l_equals(list *_list1_, list *_list2_, int (*comparator)(size_t, size_t));
|
||||
cmc_string l_to_string(list *_list_);
|
||||
struct cmc_string l_to_string(list *_list_);
|
||||
list_iter *l_iter_new(list *target);
|
||||
void l_iter_free(list_iter *iter);
|
||||
void l_iter_init(list_iter *iter, list *target);
|
||||
@@ -349,9 +349,9 @@ _Bool l_equals(list *_list1_, list *_list2_, int (*comparator)(size_t, size_t))
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
cmc_string l_to_string(list *_list_)
|
||||
struct cmc_string l_to_string(list *_list_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
list *l_ = _list_;
|
||||
const char *name = "list";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_list, name, l_, l_->buffer, l_->capacity, l_->count);
|
||||
|
||||
@@ -53,7 +53,7 @@ double mm_load(multimap *_map_);
|
||||
_Bool mm_resize(multimap *_map_, size_t capacity);
|
||||
multimap *mm_copy_of(multimap *_map_, size_t (*key_copy_func)(size_t), size_t (*value_copy_func)(size_t));
|
||||
_Bool mm_equals(multimap *_map1_, multimap *_map2_, _Bool ignore_key_count);
|
||||
cmc_string mm_to_string(multimap *_map_);
|
||||
struct cmc_string mm_to_string(multimap *_map_);
|
||||
multimap_iter *mm_iter_new(multimap *target);
|
||||
void mm_iter_free(multimap_iter *iter);
|
||||
void mm_iter_init(multimap_iter *iter, multimap *target);
|
||||
@@ -483,9 +483,9 @@ _Bool mm_equals(multimap *_map1_, multimap *_map2_, _Bool ignore_key_count)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string mm_to_string(multimap *_map_)
|
||||
struct cmc_string mm_to_string(multimap *_map_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
multimap *m_ = _map_;
|
||||
const char *name = "multimap";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_multimap, name, m_, m_->buffer, m_->capacity, m_->count, m_->load, m_->cmp, m_->hash);
|
||||
|
||||
@@ -19,7 +19,7 @@ typedef struct multiset_entry_s
|
||||
size_t value;
|
||||
size_t multiplicity;
|
||||
size_t dist;
|
||||
enum cmc_entry_state_e state;
|
||||
enum cmc_entry_state state;
|
||||
} multiset_entry, *multiset_entry_ptr;
|
||||
typedef struct multiset_iter_s
|
||||
{
|
||||
@@ -52,7 +52,7 @@ double ms_load(multiset *_set_);
|
||||
_Bool ms_resize(multiset *_set_, size_t capacity);
|
||||
multiset *ms_copy_of(multiset *_set_, size_t (*copy_func)(size_t));
|
||||
_Bool ms_equals(multiset *_set1_, multiset *_set2_, _Bool ignore_multiplicity);
|
||||
cmc_string ms_to_string(multiset *_set_);
|
||||
struct cmc_string ms_to_string(multiset *_set_);
|
||||
multiset *ms_union(multiset *_set1_, multiset *_set2_);
|
||||
multiset *ms_intersection(multiset *_set1_, multiset *_set2_);
|
||||
multiset *ms_difference(multiset *_set1_, multiset *_set2_);
|
||||
@@ -344,9 +344,9 @@ _Bool ms_equals(multiset *_set1_, multiset *_set2_, _Bool ignore_multiplicity)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string ms_to_string(multiset *_set_)
|
||||
struct cmc_string ms_to_string(multiset *_set_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
multiset *s_ = _set_;
|
||||
const char *name = "multiset";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_multiset, name, s_, s_->buffer, s_->capacity, s_->count, s_->cardinality, s_->load, s_->cmp, s_->hash);
|
||||
|
||||
@@ -34,7 +34,7 @@ size_t q_capacity(queue *_queue_);
|
||||
_Bool q_resize(queue *_queue_, size_t capacity);
|
||||
queue *q_copy_of(queue *_queue_, size_t (*copy_func)(size_t));
|
||||
_Bool q_equals(queue *_queue1_, queue *_queue2_, int (*comparator)(size_t, size_t));
|
||||
cmc_string q_to_string(queue *_queue_);
|
||||
struct cmc_string q_to_string(queue *_queue_);
|
||||
queue_iter *q_iter_new(queue *target);
|
||||
void q_iter_free(queue_iter *iter);
|
||||
void q_iter_init(queue_iter *iter, queue *target);
|
||||
@@ -202,9 +202,9 @@ _Bool q_equals(queue *_queue1_, queue *_queue2_, int (*comparator)(size_t, size_
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string q_to_string(queue *_queue_)
|
||||
struct cmc_string q_to_string(queue *_queue_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
queue *q_ = _queue_;
|
||||
const char *name = "queue";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_queue, name, q_, q_->buffer, q_->capacity, q_->count, q_->front, q_->back);
|
||||
|
||||
@@ -37,7 +37,7 @@ _Bool sl_resize(sortedlist *_list_, size_t capacity);
|
||||
void sl_sort(sortedlist *_list_);
|
||||
sortedlist *sl_copy_of(sortedlist *_list_, size_t (*copy_func)(size_t));
|
||||
_Bool sl_equals(sortedlist *_list1_, sortedlist *_list2_);
|
||||
cmc_string sl_to_string(sortedlist *_list_);
|
||||
struct cmc_string sl_to_string(sortedlist *_list_);
|
||||
sortedlist_iter *sl_iter_new(sortedlist *target);
|
||||
void sl_iter_free(sortedlist_iter *iter);
|
||||
void sl_iter_init(sortedlist_iter *iter, sortedlist *target);
|
||||
@@ -208,9 +208,9 @@ _Bool sl_equals(sortedlist *_list1_, sortedlist *_list2_)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
cmc_string sl_to_string(sortedlist *_list_)
|
||||
struct cmc_string sl_to_string(sortedlist *_list_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
sortedlist *l_ = _list_;
|
||||
const char *name = "sortedlist";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_sortedlist, name, l_, l_->buffer, l_->capacity, l_->count, l_->is_sorted ? "true" : "false", l_->cmp);
|
||||
|
||||
@@ -31,7 +31,7 @@ size_t s_capacity(stack *_stack_);
|
||||
_Bool s_resize(stack *_stack_, size_t capacity);
|
||||
stack *s_copy_of(stack *_stack_, size_t (*copy_func)(size_t));
|
||||
_Bool s_equals(stack *_stack1_, stack *_stack2_, int (*comparator)(size_t, size_t));
|
||||
cmc_string s_to_string(stack *_stack_);
|
||||
struct cmc_string s_to_string(stack *_stack_);
|
||||
stack_iter *s_iter_new(stack *target);
|
||||
void s_iter_free(stack_iter *iter);
|
||||
void s_iter_init(stack_iter *iter, stack *target);
|
||||
@@ -164,9 +164,9 @@ _Bool s_equals(stack *_stack1_, stack *_stack2_, int (*comparator)(size_t, size_
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string s_to_string(stack *_stack_)
|
||||
struct cmc_string s_to_string(stack *_stack_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
stack *s_ = _stack_;
|
||||
const char *name = "stack";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_stack, name, s_, s_->buffer, s_->capacity, s_->count);
|
||||
|
||||
@@ -44,7 +44,7 @@ _Bool tm_empty(treemap *_map_);
|
||||
size_t tm_count(treemap *_map_);
|
||||
treemap *tm_copy_of(treemap *_map_, size_t (*key_copy_func)(size_t), size_t (*value_copy_func)(size_t));
|
||||
_Bool tm_equals(treemap *_map1_, treemap *_map2_, int (*value_comparator)(size_t, size_t));
|
||||
cmc_string tm_to_string(treemap *_map_);
|
||||
struct cmc_string tm_to_string(treemap *_map_);
|
||||
treemap_iter *tm_iter_new(treemap *target);
|
||||
void tm_iter_free(treemap_iter *iter);
|
||||
void tm_iter_init(treemap_iter *iter, treemap *target);
|
||||
@@ -387,9 +387,9 @@ _Bool tm_equals(treemap *_map1_, treemap *_map2_, int (*value_comparator)(size_t
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string tm_to_string(treemap *_map_)
|
||||
struct cmc_string tm_to_string(treemap *_map_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
treemap *m_ = _map_;
|
||||
const char *name = "treemap";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_treemap, name, m_, m_->root, m_->count, m_->cmp);
|
||||
|
||||
@@ -40,7 +40,7 @@ _Bool ts_empty(treeset *_set_);
|
||||
size_t ts_count(treeset *_set_);
|
||||
treeset *ts_copy_of(treeset *_set_, size_t (*copy_func)(size_t));
|
||||
_Bool ts_equals(treeset *_set1_, treeset *_set2_);
|
||||
cmc_string ts_to_string(treeset *_set_);
|
||||
struct cmc_string ts_to_string(treeset *_set_);
|
||||
treeset *ts_union(treeset *_set1_, treeset *_set2_);
|
||||
treeset *ts_intersection(treeset *_set1_, treeset *_set2_);
|
||||
treeset *ts_difference(treeset *_set1_, treeset *_set2_);
|
||||
@@ -357,9 +357,9 @@ _Bool ts_equals(treeset *_set1_, treeset *_set2_)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
cmc_string ts_to_string(treeset *_set_)
|
||||
struct cmc_string ts_to_string(treeset *_set_)
|
||||
{
|
||||
cmc_string str;
|
||||
struct cmc_string str;
|
||||
treeset *s_ = _set_;
|
||||
const char *name = "treeset";
|
||||
snprintf(str.s, cmc_string_len, cmc_string_fmt_treeset, name, s_, s_->root, s_->count, s_->cmp);
|
||||
|
||||
Reference in new issue
Block a user