Generic list management library in C