Use C-compatible int retval == 0 test instead of C++ bool for API