Sglib is a generic library for C that was inspired by the Standard Template Library from C++. It consists of a single header file and no binary code. It defines useful macros for sorting arrays and manipulating lists, sorted lists, double linked lists, hashed containers, and red-black trees. Macros are parametrized by the type of the data structure. The library does not enforce its own data representation, but acts on user-defined types. It does not enforce any particular memory management system.