Generic containers in C: vectors, null-terminated strings, lists and key/value dictionaries. Written one month into Epitech, a month after my first line of C. Epitech allows almost nothing from the standard library: no strlen, no strcpy, no printf. Only malloc and free, and you write the rest. The aim was one library wide enough to carry any project the school could set.
- Epitech allows almost nothing from the C standard library — not strlen, not strcpy, not printf. Only malloc and free, and everything above them you write yourself. Rather than rewrite the same containers project after project, I wrote them once and made them generic: the point was reach, not elegance.
- Every object carries a type identifier, and each function dispatches on it: the same call adapts to whichever container it receives.
- Objects free themselves through the cleanup attribute when they leave scope, so no explicit call to free is ever needed.