Added a couple of functions to the C API