"The libxcpc library implements an automatic resource cleanup." BS Editor: The libxcpc library implements an automatic resource cleanup and exception handling in C. Error handling and cleanup code (at least for code that does error handling) can take quite some space in terms of lines of code to be written. This not only increases the binary size, but makes the code more difficult to read. Furthermore, error handling code typically lies in untested code paths (because they get exercised only when abnormal conditions happens) that are very much error prone. Effective and complete code coverage tests to exercise all error paths, are not trivial to implement, and very often many of such paths are simply left untested. C++ has native exception handling, and this solves part of the problem, while keeping exposed the resource cleanup one. The libxcpc offers C++ like exception handling, plus automatic resource cleanup, to be used in software written in C. The libxcpc introduces three Abstractions, that are Resource, Container and Exception. The Resource is every object (or action) that needs cleanup. This can be a block of allocated memory, an open file, a mapped memory region, etc... Every allocated Resource is owned by a Container. A Resource can be moved from a Container to another. A Container is a bucket inside which Resource are allocated. A Container can be the parent of other Containers, by hence introducing a parent/child relationship Between Containers. A Container can be reassigned to be child of a new Container. By freeing a Container all the Resources allocated inside the Container will be freed, and all the child Containers will be recursively freed too. Resource Containers greatly simplify the resource cleanup code, by being able to issue a single call to free a Container and having automatically all the Resources contained by it, freed as well. Resources are added/removed in a LIFO (Last In First Out) way, and the libxcpc library offers APIs to re-arrange the order of the Resources inside their Contexts.