implement minimal C extention