wrapper for C code