Compute the gravitational acceleration and potential exterior to an arbitrary polyhedron, based on the formulation by Werner & Scheeres 1996.
This is designed mainly to be compiled as a shared library and then called from a python script. There are no working examples written entirely in c, but it wouldn't be difficult to adapt this code to fit other needs.