C Container Collection (CCC)
Loading...
Searching...
No Matches
sort.h
Go to the documentation of this file.
1
40#ifndef CCC_SORT_H
41#define CCC_SORT_H
42
43#include "doubly_linked_list.h"
44#include "flat_buffer.h"
45#include "singly_linked_list.h"
46#include "types.h" /* IWYU pragma: export */
47
78 CCC_Flat_buffer const *buffer,
79 void *temp,
80 CCC_Order order,
81 CCC_Comparator const *comparator
82);
83
100 CCC_Order order,
101 CCC_Comparator const *comparator
102);
103
120 CCC_Order order,
121 CCC_Comparator const *comparator
122);
123
137#define CCC_sort_merge(list_pointer, order, comparator_pointer) \
138 _Generic((list_pointer), CCC_Singly_linked_list *: CCC_sort_merge_singly_linked_list, CCC_Doubly_linked_list *: CCC_sort_merge_doubly_linked_list)( \
139 list_pointer, order, comparator_pointer \
140 )
141
146#ifdef SORT_USING_NAMESPACE_CCC
147/* NOLINTBEGIN(readability-identifier-naming) */
148# define sort_heap(args...) CCC_sort_heap(args)
149# define sort_merge_singly_linked_list(args...) \
150 CCC_sort_merge_singly_linked_list(args)
151# define sort_merge_doubly_linked_list(args...) \
152 CCC_sort_merge_doubly_linked_list(args)
153# define sort_merge(args...) CCC_sort_merge(args)
154/* NOLINTEND(readability-identifier-naming) */
155#endif /* SORT_USING_NAMESPACE_CCC */
156
157#endif /* CCC_SORT_H */
The Doubly Linked List Interface.
The Flat_buffer Interface.
The Singly Linked List Interface.
CCC_Result CCC_sort_merge_doubly_linked_list(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_merge_singly_linked_list(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....
CCC_Result CCC_sort_heap(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.
The type passed by reference to any container function that may need to compare elements....
Definition: types.h:424
Definition: private_doubly_linked_list.h:73
Definition: private_flat_buffer.h:40
Definition: private_singly_linked_list.h:72
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