working on C glue code