C interface implementation