[mem] Added extern "C" so routines now can be called from C++ code.