Routines for handling errors in C or C++ components

These routines are useful for handling errors in C components.