C++ is proving to complex to wrap cleanly, just re-writing appropriate functions in C