wrap the C++ CTP API to C