Rewrite of a c++ library in C.