generator template for c code