implement the public C interface