https://github.com/neil-edelman/boxes
Drag-and-drop data structure headers.
https://github.com/neil-edelman/boxes
b-tree c89 data-structures generics hash-table memory-pool metaprogramming paramterization templates testing traits trie type-safety
Last synced: 8 months ago
JSON representation
Drag-and-drop data structure headers.
- Host: GitHub
- URL: https://github.com/neil-edelman/boxes
- Owner: neil-edelman
- License: other
- Created: 2021-06-04T21:54:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-19T01:17:36.000Z (about 1 year ago)
- Last Synced: 2025-04-10T02:13:02.152Z (11 months ago)
- Topics: b-tree, c89, data-structures, generics, hash-table, memory-pool, metaprogramming, paramterization, templates, testing, traits, trie, type-safety
- Language: C
- Homepage:
- Size: 19.2 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
`C89` data structure headers that use compile-time polymorphism to
generate lightweight and statically type-safe containers.
## Downloading ##
This is not a library, just headers where needed. Pick and choose
from `src` and use them. The dependencies are edges in the following
diagram. Or just download the entire `src` directory and put it
where it's convenient to reference from one's code.

Dotted edges means it's an optional dependency. The dashed containers,
`deque` and `pool` are stable containers. A dotted box—`array`,
`heap`, `table`, `tree`, and `trie`, means unstable. Depending on
one's use case, it may be good to have one or more stable containers
as a backing for one or more unstable pointer containers.
## Documentation ##
Documented parameters in each project are pre-processor macros.
Examples are in [test/](test/) test_array.c _etc_.
documentation
design paper
memory pool
A slab-allocator for similar objects
hash table
Allocation-conscious chained hash-table
B-tree
Practical in-memory B-tree design
trie
Compact binary prefix trees
## Compatibility ##
Uses `C++17` feature `__has_include` in `box.h` to decide to include
optional features so that part of the header files work without the
full thing. If one's compiler is does not support `C++17` (especially)
and one needs these features, try uncommenting the appropriate
lines.
The testing framework in `test/` is much less multi-platform then
the headers in `src/`, requiring `C13` anonymous unions, assuming
a `union` is in the usual order. The `Makefile` provided assumes
the `gcc` suite and uses `clang`.
On a segmented memory model, `pool` probably won't work reliably,
especially when one compiles with `C90`.
(Especially) `trie` hasn't been tested when `CHAR_BIT ≠ 8`, as it
could be in `C90`.
`C90` requires identifiers to be a minimum of 31 significant initial
characters in an internal identifier or a macro name. If one's
compiler does the very minimum, it probably won't be enough to
differentiate all the private symbols. One may have to edit the
code to abbreviate.
Utf-8 everywhere. There are few places where this makes a difference,
but one may have to edit some files if working with ASCII-only
compilers. (Specifically, "…" in `to_string`.)
## License ##
2016 Neil Edelman, distributed under the terms of the [MIT
License](https://opensource.org/licenses/MIT).