Add README
This commit is contained in:
parent
2f50db1858
commit
de4421a4d7
9
LICENSE.txt
Normal file
9
LICENSE.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Copyright 2025 ~fruit
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
cf. https://opensource.org/license/mit (last-retrieved 2025-12-21)
|
||||||
55
README.txt
Normal file
55
README.txt
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
libguf - typesafe C99 containers
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
1. Intro
|
||||||
|
----------
|
||||||
|
"Look mom, no void pointers!"
|
||||||
|
|
||||||
|
This is a work in progress of my personal header only datastructure and
|
||||||
|
algorithm utility library which (ab)uses the C pre-processor to achieve
|
||||||
|
typesafety.
|
||||||
|
|
||||||
|
There is no reason this exists apart from "this is kind of fun and silly",
|
||||||
|
you should just use C++ :)
|
||||||
|
|
||||||
|
It uses a similar approach of "include parametrisation" to achieve strongly
|
||||||
|
typed data structures as used in https://github.com/ludocode/pottery
|
||||||
|
|
||||||
|
Look at "src/test/example.c" for an example.
|
||||||
|
|
||||||
|
|
||||||
|
2. How to build
|
||||||
|
-----------------
|
||||||
|
Setup CMake with
|
||||||
|
$ cmake -DCMAKE_BUILD_TYPE=Debug -S . -B build/debug
|
||||||
|
|
||||||
|
And build the example with
|
||||||
|
$ cmake --build build/debug/ --target libguf_example
|
||||||
|
|
||||||
|
|
||||||
|
3. Tests
|
||||||
|
----------
|
||||||
|
The tests in src/test are written in C++20, which made it easy to just use the
|
||||||
|
STL types in order to check their behaviour against the custom libguf C types.
|
||||||
|
|
||||||
|
|
||||||
|
4. What it includes
|
||||||
|
--------------------
|
||||||
|
- guf_dbuf.h: a dynamic array (like std::vector)
|
||||||
|
- guf_dict.h: a hashtable (elements are stored contiguously, like python3's
|
||||||
|
compact dicts)
|
||||||
|
- guf_str.h: a string-buffer with short-string-optimisation (guf_str) and
|
||||||
|
a string-view (guf_str_view) type
|
||||||
|
- guf_rand.h: random number algorithms
|
||||||
|
- guf_sort.h: sort algorithms
|
||||||
|
- guf_math.h: math I guess?
|
||||||
|
- guf_linalg.h: linear algebra types and algorithms for computer graphics etc.
|
||||||
|
- ... and more
|
||||||
|
|
||||||
|
|
||||||
|
5. License
|
||||||
|
-----------
|
||||||
|
MIT (cf. LICENSE.txt).
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
~fruit
|
||||||
Loading…
x
Reference in New Issue
Block a user