C Container Collection (CCC)
Loading...
Searching...
No Matches
sort.h
Go to the documentation of this file.
1
27#ifndef CCC_SORT_H
28#define CCC_SORT_H
29
30#include "doubly_linked_list.h"
31#include "flat_buffer.h"
32#include "singly_linked_list.h"
33#include "types.h"
34
65 CCC_Flat_buffer const *buffer,
66 void *temp,
67 CCC_Order order,
68 CCC_Comparator const *comparator
69);
70
86 CCC_Order order,
87 CCC_Comparator const *comparator
88);
89
105 CCC_Order order,
106 CCC_Comparator const *comparator
107);
108
122#define CCC_sort_mergesort(list_pointer, order, comparator_pointer) \
123 _Generic((list_pointer), CCC_Singly_linked_list *: CCC_sort_singly_linked_list_mergesort, CCC_Doubly_linked_list *: CCC_sort_doubly_linked_list_mergesort)( \
124 list_pointer, order, comparator_pointer \
125 )
126
131#ifdef SORT_USING_NAMESPACE_CCC
132/* NOLINTBEGIN(readability-identifier-naming) */
133# define sort_heapsort(args...) CCC_sort_heapsort(args)
134# define sort_singly_linked_list_mergesort(args...) \
135 CCC_sort_singly_linked_list_mergesort(args)
136# define sort_doubly_linked_list_mergesort(args...) \
137 CCC_sort_doubly_linked_list_mergesort(args)
138# define sort_mergesort(args...) CCC_sort_mergesort(args)
139/* NOLINTEND(readability-identifier-naming) */
140#endif /* SORT_USING_NAMESPACE_CCC */
141
142#endif /* CCC_SORT_H */
The Doubly Linked List Interface.
The Flat_buffer Interface.
The Singly Linked List Interface.
CCC_Result CCC_sort_doubly_linked_list_mergesort(CCC_Doubly_linked_list *list, CCC_Order order, CCC_Comparator const *comparator)
Sorts the doubly linked list in user specified order as defined by the provided order and comparator....
CCC_Result CCC_sort_heapsort(CCC_Flat_buffer const *buffer, void *temp, CCC_Order order, CCC_Comparator const *comparator)
Sorts the input buffer in O(N * log(N)) time and O(1) space according to the desired input order.
CCC_Result CCC_sort_singly_linked_list_mergesort(CCC_Singly_linked_list *list, CCC_Order order, CCC_Comparator const *comparator)
Sorts the singly linked list in user specified order as defined by the provided order and comparator....
The type passed by reference to any container function that may need to compare elements....
Definition: types.h:409
Definition: private_doubly_linked_list.h:66
Definition: private_flat_buffer.h:32
Definition: private_singly_linked_list.h:63
The C Container Collection Fundamental Types.
CCC_Order
A three-way comparison for comparison functions.
Definition: types.h:213
CCC_Result
A result of actions on containers.
Definition: types.h:192