First attempt at a C API.