I'd like to experiment with the codegen feature (currently experimental) and need a public C API for this. This PR addresses this.