From http://tsemsb.blogspot.com.tr/2010/04/cgcc-gcode-with-c-constructs.html