Various modules to bootstrap a C project.
Modules inspired by the document "Modular C: How to Write Reusable and Maintainable Code using the C Language" by Robert Strandh.
| Module | Abstract Data Type | Implementation |
|---|---|---|
| vec | Vector | Dynamic Array |
| list | List | Doubly Linked List |
| slist | Singly Linked List | Singly Linked List |
| map | Map | Hash Table |
| oset | Ordered Set | Skip List |
| pqueue | Priority Queue | Heap |
| stack | Stack | Singly Linked List |
| queue | Queue | Doubly Linked List |
| set | Set | 📐 planned ✏️ |
In order for everything to function smoothly you need the following software installed:
- valgrind
- gcc
- GNU Make
Clone the directory, cd into it, and run:
make setupFrom the root of the directory you have a birds eye view to quickly see that everything is working as expected.
Available recipes:
make setupis used to set up the directory for testing.make testsis used to compile all the tests of the modules.make run-testsis used to run all the tests.make valgrind-testsis used to check for memory leaks on all the tests.make cleanis used to clean up all the generated files.
From the tests/ directory you have a more fine-tuned control of each test.
# Change into the tests/ direcotry:
cd testsAvailable general recipes:
make allis used to compile all the tests.make runis used to execute all the tests.make valgrindis used to check all the tests for memory leaks.make cleanis used to remove all the generated files.
Available test recipes:
make <test>is used to compile<test>.make run-<test>is used to execute<test>.make valgrind-<test>is used to check<test>for memory leaks.
Note: Replace
<test>with the name of the desired test.
In order to use a module, you need to copy three things:
- The interface file (
.h) frominclude/directory. - The desired implementation (
.c) frommodules/directory. - Any dependencies of the module based on
tests/Makefile.
Note: Check an example for further information.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Data Structures and Programming Techniques course at the University of Athens, Greece.