From 616327f054b5f42b1b01f1db062db329bc37a374 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Tue, 22 Oct 2019 23:51:39 -0300 Subject: [PATCH] Moved all collections from ext to cmc ext no longer exists --- README.md | 7 +++--- src/{ext => cmc}/bidimap.h | 0 src/{ext => cmc}/intervalheap.h | 0 src/{ext => cmc}/multimap.h | 0 src/{ext => cmc}/multiset.h | 0 src/{ext => cmc}/sortedlist.h | 3 ++- src/macro_collections.h | 39 +++++++++++++++++---------------- src/utl/foreach.h | 2 +- src/utl/log.h | 1 - tests/main/unt/bidimap.c | 2 +- tests/main/unt/intervalheap.c | 2 +- tests/main/unt/multimap.c | 2 +- tests/main/unt/multiset.c | 2 +- tests/main/unt/sortedlist.c | 2 +- 14 files changed, 31 insertions(+), 31 deletions(-) rename src/{ext => cmc}/bidimap.h (100%) rename src/{ext => cmc}/intervalheap.h (100%) rename src/{ext => cmc}/multimap.h (100%) rename src/{ext => cmc}/multiset.h (100%) rename src/{ext => cmc}/sortedlist.h (99%) diff --git a/README.md b/README.md index c77917e..d8fc2eb 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ * __src__ - All headers part of the C Macro Collections Library * __cmc__ - The main C Macro Collections Library * __dev__ - The main C Macro Collections Library for development (containing logging) - * __ext__ - Extra collections * __sac__ - Statically Allocated Collections * __utl__ - Utility like ForEach macros, logging, etc * __macro\_collections.h__ - Master header containing all collections and utilities @@ -75,8 +74,8 @@ In the long term, these are the steps left for the completion of this library: -* Complete the implementation of all the functions in the scope of the TODO file for the main collections (all those included in `cmc` and `ext`); -* Reorganize and complete all tests for `cmc` and `ext`; +* Complete the implementation of all the functions in the scope of the TODO file for the main collections; +* Reorganize and complete all tests for the `cmc` collections; * Make an exact copy of all collections to `dev` with many logging utility, for them to be used under development; * Port all of these collections to be statically allocated and be part of the `sac` library; * Complete all tests for `sac`. @@ -176,7 +175,7 @@ Check out some code reviews that covers some parts the project: | About | Link | |-------|--------| | Unit Test *./utl/test.h* | [![Code Review](http://www.zomis.net/codereview/shield/?qid=222954)](http://codereview.stackexchange.com/q/222954/178948) | -| Interval Heap *./ext/intervalheap.h* | [![Code Review](http://www.zomis.net/codereview/shield/?qid=223595)](http://codereview.stackexchange.com/q/223595/178948) | +| Interval Heap *./cmc/intervalheap.h* | [![Code Review](http://www.zomis.net/codereview/shield/?qid=223595)](http://codereview.stackexchange.com/q/223595/178948) | | Hash Set *./cmc/hashset.h* | [![Code Review](http://www.zomis.net/codereview/shield/?qid=217333)](http://codereview.stackexchange.com/q/217333/178948) | | Linked List *./cmc/linkedlist.h* | [![Code Review](http://www.zomis.net/codereview/shield/?qid=216737)](http://codereview.stackexchange.com/q/216737/178948) | | Others | [![Code Review](http://www.zomis.net/codereview/shield/?qid=213553)](http://codereview.stackexchange.com/q/213553/178948) | diff --git a/src/ext/bidimap.h b/src/cmc/bidimap.h similarity index 100% rename from src/ext/bidimap.h rename to src/cmc/bidimap.h diff --git a/src/ext/intervalheap.h b/src/cmc/intervalheap.h similarity index 100% rename from src/ext/intervalheap.h rename to src/cmc/intervalheap.h diff --git a/src/ext/multimap.h b/src/cmc/multimap.h similarity index 100% rename from src/ext/multimap.h rename to src/cmc/multimap.h diff --git a/src/ext/multiset.h b/src/cmc/multiset.h similarity index 100% rename from src/ext/multiset.h rename to src/cmc/multiset.h diff --git a/src/ext/sortedlist.h b/src/cmc/sortedlist.h similarity index 99% rename from src/ext/sortedlist.h rename to src/cmc/sortedlist.h index 3dc4491..a63efcc 100644 --- a/src/ext/sortedlist.h +++ b/src/cmc/sortedlist.h @@ -17,7 +17,8 @@ * as you like and when its capacity is full, the buffer is reallocated. The * elements are only sorted when a certain action requires that the array is * sorted like accessing min() or max(). This prevents the array from being - * sorted after every insertion or removal of elements. + * sorted after every insertion or removal. The array is sorted using a + * variation of quick sort that uses insertion sort for small partitions. */ #ifndef CMC_SORTEDLIST_H diff --git a/src/macro_collections.h b/src/macro_collections.h index 2607d9b..40a408c 100644 --- a/src/macro_collections.h +++ b/src/macro_collections.h @@ -27,28 +27,29 @@ #define CMC_COLLECTION_GENERATE_SOURCE(C, PFX, SNAME, K, V) \ CMC_CONCATC(C)(PFX, SNAME, K, V) -#include "cmc/deque.h" -#include "cmc/hashmap.h" -#include "cmc/hashset.h" -#include "cmc/heap.h" -#include "cmc/linkedlist.h" -#include "cmc/list.h" -#include "cmc/queue.h" -#include "cmc/stack.h" -#include "cmc/treemap.h" -#include "cmc/treeset.h" - -#include "ext/intervalheap.h" -#include "ext/multimap.h" -#include "ext/multiset.h" +#include "cmc/bidimap.h" /* Added in 26/09/2019 */ +#include "cmc/deque.h" /* Added in 20/03/2019 */ +#include "cmc/hashmap.h" /* Added in 03/04/2019 */ +#include "cmc/hashset.h" /* Added in 01/04/2019 */ +#include "cmc/heap.h" /* Added in 25/03/2019 */ +#include "cmc/intervalheap.h" /* Added in 06/07/2019 */ +#include "cmc/linkedlist.h" /* Added in 22/03/2019 */ +#include "cmc/list.h" /* Added in 12/02/2019 */ +#include "cmc/multimap.h" /* Added in 26/04/2019 */ +#include "cmc/multiset.h" /* Added in 10/04/2019 */ +#include "cmc/queue.h" /* Added in 15/02/2019 */ +#include "cmc/sortedlist.h" /* Added in 17/09/2019 */ +#include "cmc/stack.h" /* Added in 14/02/2019 */ +#include "cmc/treemap.h" /* Added in 28/03/2019 */ +#include "cmc/treeset.h" /* Added in 27/03/2019 */ #include "sac/queue.h" #include "sac/stack.h" -#include "utl/assert.h" -#include "utl/foreach.h" -#include "utl/log.h" -#include "utl/test.h" -#include "utl/timer.h" +#include "utl/assert.h" /* Added in 27/06/2019 */ +#include "utl/foreach.h" /* Added in 25/02/2019 */ +#include "utl/log.h" /* Added in 21/06/2109 */ +#include "utl/test.h" /* Added in 26/06/2019 */ +#include "utl/timer.h" /* Added in 12/04/2019 */ #endif /* CMC_MACRO_COLLECTIONS_H */ diff --git a/src/utl/foreach.h b/src/utl/foreach.h index 5a8cd21..450fd4a 100644 --- a/src/utl/foreach.h +++ b/src/utl/foreach.h @@ -1,5 +1,5 @@ /** - * for_each.h + * foreach.h * * Creation Date: 25/02/2019 * diff --git a/src/utl/log.h b/src/utl/log.h index 55231d4..c636307 100644 --- a/src/utl/log.h +++ b/src/utl/log.h @@ -91,7 +91,6 @@ enum cmc_log_type CMC_LOG_WARN = 4, CMC_LOG_ERROR = 5, CMC_LOG_FATAL = 6 - }; #define cmc_log_trace(fmt, ...) cmc_log(CMC_LOG_TRACE, __FILE__, __func__, __LINE__, fmt, __VA_ARGS__) diff --git a/tests/main/unt/bidimap.c b/tests/main/unt/bidimap.c index 3ba2558..d201794 100644 --- a/tests/main/unt/bidimap.c +++ b/tests/main/unt/bidimap.c @@ -3,7 +3,7 @@ #include #include -#include +#include CMC_GENERATE_BIDIMAP(bm, bidimap, size_t, size_t) diff --git a/tests/main/unt/intervalheap.c b/tests/main/unt/intervalheap.c index 3ee4dd2..c64cc10 100644 --- a/tests/main/unt/intervalheap.c +++ b/tests/main/unt/intervalheap.c @@ -3,7 +3,7 @@ #include #include -#include +#include CMC_GENERATE_INTERVALHEAP(ih, intervalheap, size_t) diff --git a/tests/main/unt/multimap.c b/tests/main/unt/multimap.c index 45661dd..b7f771b 100644 --- a/tests/main/unt/multimap.c +++ b/tests/main/unt/multimap.c @@ -3,7 +3,7 @@ #include #include -#include +#include CMC_GENERATE_MULTIMAP(mm, multimap, size_t, size_t) diff --git a/tests/main/unt/multiset.c b/tests/main/unt/multiset.c index e0cdd52..9ce2a69 100644 --- a/tests/main/unt/multiset.c +++ b/tests/main/unt/multiset.c @@ -3,7 +3,7 @@ #include #include -#include +#include CMC_GENERATE_MULTISET(ms, multiset, size_t) diff --git a/tests/main/unt/sortedlist.c b/tests/main/unt/sortedlist.c index d9a9897..8a9476a 100644 --- a/tests/main/unt/sortedlist.c +++ b/tests/main/unt/sortedlist.c @@ -3,7 +3,7 @@ #include #include -#include +#include CMC_GENERATE_SORTEDLIST(sl, sortedlist, size_t)