C-Lib

No free anywhere: AUTOFREE is __attribute__((cleanup)), so a list releases itself and everything it owns. LIST and STR come from the same create() call, and append, print and sort dispatch on a type id rather than a C type. From libc: malloc and free, nothing else.

src/main.c
#include "project.h"
#include <time.h>

int main(void)
{
    AUTOFREE list_t * list = LIST(15);

    srand(time(NULL));

    for (int i = 0; i < 15; i++) {
        append(&list, STR(TOSTR(97 + (rand() % 26))));
    }
    print("%o\n", list);

    sort(list, (int)(list->len), NULL, NULL);

    print("%o\n", list);
}
output
make && ./my_lib["t", "q", "m", "k", "q", "o", "j", "x", "e", "m", "v", "v", "y", "i", "h"]["e", "h", "i", "j", "k", "m", "m", "o", "q", "q", "t", "v", "v", "x", "y"]

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.

Under the hood

CMemory managementVariadic functionsDynamic dispatch