tighten return type declarations of some C-API functions
changelog
merge