finish C bindings implementation.