Commit Graph

44 Commits

Author SHA1 Message Date
Danila Fedorin 9d8f79521d Use const where applicable to allow for const data structures. 2018-03-24 17:14:09 -07:00
Danila Fedorin aae676c70c Rename get_filter to find. 2018-03-24 16:53:12 -07:00
Danila Fedorin 320c747c2d Add a get function that can help handle duplicate key entries. 2018-03-17 16:53:46 -07:00
Danila Fedorin c318aae32c Implement a growing insertion. 2018-02-05 13:54:47 -08:00
Danila Fedorin 316d2daf89 Check put for duplicate pieces of data. 2018-02-05 13:11:59 -08:00
Danila Fedorin 276d38a292 Make sure cmake uses C90 for this project. 2018-02-04 00:11:20 -08:00
Danila Fedorin 32de4e478f Switch sparse set to use unsigned size_t. 2017-07-21 17:45:04 -07:00
Danila Fedorin 1d037dd31e Make as many variables const as possible. 2017-07-20 21:53:25 -07:00
Danila Fedorin cd822fedfc Fix several issues with includes and redundant comparisons. 2017-07-20 21:39:26 -07:00
Danila Fedorin 1b57ebb027 Switch vector to use size_t for its array sizes and indices. 2017-07-20 21:34:33 -07:00
Danila Fedorin c97538265d Switch all sizing types to size_t. 2017-07-20 21:32:36 -07:00
Danila Fedorin 2bf3f32bed Simplify put code and make free leave table in clean state. 2017-07-20 21:24:27 -07:00
Danila Fedorin b1a7c21caa Add a clear function for the vector. 2017-06-11 21:08:39 -07:00
Danila Fedorin 20507f73bb Rewrite vectors to move elements on removal. 2017-06-09 22:58:26 -07:00
Danila Fedorin a04490cbdd Fix bug that would cause a double free if setup files and free is called 2017-05-05 19:48:23 -07:00
Danila Fedorin 1a7ba8e393 Exit CMakeLists if the library has already been defined.
This is to prevent the re-use of this library in multiple projects.
2017-03-18 17:30:51 -07:00
Danila Fedorin c8d733e410 Switch hash tables to longs, as longs guarantee 32 bits.
The default FNV hash requires 32 bits at least.
2017-01-27 21:29:28 -08:00
Danila Fedorin 0271248472 Add two extra checks to ensure there are no negative array indices. 2017-01-21 20:30:01 -08:00
Danila Fedorin 5247394d35 Add unit tests for sparse array functions. 2017-01-21 16:43:47 -08:00
Danila Fedorin 3aedc61da4 Implement a sparse array / set. 2017-01-21 01:20:00 -08:00
Danila Fedorin 4003fa1b78 Add README.md 2017-01-09 18:49:59 -08:00
Danila Fedorin 936b2835b2 Add more comments and a new comparison function. 2016-12-28 19:29:51 -08:00
Danila Fedorin a4d41361dd Fix bug causing the program to probably go off and free NULL. 2016-12-26 00:32:51 -08:00
Danila Fedorin 75ff581de3 Add clear function that clears the linked list. 2016-12-25 15:55:48 -08:00
Danila Fedorin 4c7f0ee0e5 Fix infinite loop bug in linked list find function. 2016-12-25 00:28:29 -08:00
Danila Fedorin 4fa9ab13ee Implement linked list data structure. 2016-12-23 22:39:10 -08:00
Danila Fedorin 27ea69e125 Add documentation to data structure code. 2016-12-22 18:43:59 -08:00
Danila Fedorin c74f05eaf5 Rename error enumerator to prevent naming conflicts. 2016-12-21 16:58:00 -08:00
Danila Fedorin 8ac71dc021 Make includes per-target. 2016-12-21 16:45:35 -08:00
Danila Fedorin 52640ed8f9 Format code. 2016-12-21 15:07:01 -08:00
Danila Fedorin d41a085bcd Add check if all tests passed. 2016-12-21 14:49:07 -08:00
Danila Fedorin 281f49d5e5 Write hash table tests. 2016-12-21 14:37:21 -08:00
Danila Fedorin 5f58ae8a39 Add compiler settings like C standard and warning level. 2016-12-21 13:26:26 -08:00
Danila Fedorin 440120f1da Remove const to silence warnings.
This should be optimized out anyway.
2016-12-21 13:23:14 -08:00
Danila Fedorin 00eeb01299 Convert main.c into tests for libds, and write tests for vec.h. 2016-12-21 01:33:37 -08:00
Danila Fedorin 8447522dc2 Add and implement a hash table. 2016-12-21 01:07:47 -08:00
Danila Fedorin c83a8f5b00 Add main.c file required by the CMake build. 2016-12-20 23:30:15 -08:00
Danila Fedorin 79683c63c6 Add CMakeLists file - set up CMake. 2016-12-20 23:28:18 -08:00
Danila Fedorin 37adcb1365 Add function to access element by index. 2016-12-20 23:28:07 -08:00
Danila Fedorin c4ee4853d5 Implement the vector functions specified in the header. 2016-12-20 21:22:22 -08:00
Danila Fedorin 6003b00e36 Implement compare_always function. 2016-12-20 21:22:10 -08:00
Danila Fedorin 22c73d5a0e Fix naming issue. 2016-12-20 21:21:53 -08:00
Danila Fedorin 043562aacf Add two headers, one for the general libds stuff and one for vectors. 2016-12-20 00:32:34 -08:00
Danila Fedorin 5ac2e368a2 Initial commit. Add .gitignore file. 2016-12-20 00:30:34 -08:00