A c implementation of the vm api