Libretto's main aim is to provide easy-to-use, flexible, generic reusable container types (and their associated access functions) for C programs. It also has a few miscellaneous functions to perform other actions that are frequently required in programs.
Specifically, the following are supplied:
mem_alloc()
msg_write()
Autostr
Autobuf
Darray
Chain
Bstree
The memory allocation routines (see Memory allocation) are in some sense the cornerstone of the library: almost all of the other modules use those functions. They implement `allocate-or-die' semantics by default: if there is insufficient memory to allocate the desired block, the library causes the program to exit. Programs can select at runtime that error conditions should be returned on out-of-memory.
[1] The Darray module is to be deprecated soon; similar but more powerful functionality will be made available with different interfaces. See Dynamic arrays for full details.