Adds a C implementation of sp_from_c