src/gcode.c
void begin_print(FILE * f)
{
    int i;
    char op[16];
    
    /* Move header to beginning of file */
    fseek(f, 0, SEEK_SET);

    while (fscanf(f,"%s",op) == 1) {
	/* TODO: Checks for comments on file */
	if (strcmp(op,"(") == 0) {
	    /* TODO: Is comment */
	    fscanf(f,"%s%*[^\n]",op);
	    
	    /* printf("COMMENT\n"); */
	} else {
	    /* Not comment */
	
	    /* Identifies operation and calls its respective routine */
	    for (i=0;i<total_operators;i++) {
		if (strcmp(operators[i],op) == 0) {
		    printf("Calling %s... \n",operators[i]);
		   
		    begin_operation(f, op);
		}	
	    }
	}
    }
    
    return;
}
/*
 * Print contents of open file using the CNC machine
 *
 * NEVER call it before check_instructions, you 
 * may or may not encounter mechanichal problems
 */
Print contents of open file using the CNC machine
NEVER call it before check_instructions, you
may or may not encounter mechanichal problems
Print contents of open file using the CNC machine NEVER call it before check_instructions you may or may not encounter mechanichal problems
void begin_print(FILE * f)
{
    int i;
    char op[16];
    fseek(f, 0, SEEK_SET);
    while (fscanf(f,"%s",op) == 1) {
	if (strcmp(op,"(") == 0) {
	    fscanf(f,"%s%*[^\n]",op);
	} else {
	    for (i=0;i<total_operators;i++) {
		if (strcmp(operators[i],op) == 0) {
		    printf("Calling %s... \n",operators[i]);
		    begin_operation(f, op);
		}	
	    }
	}
    }
    return;
}
void begin_print ( FILE * f ) { int i ; char op [ 16 ] ; fseek ( f , 0 , SEEK_SET ) ; while ( fscanf ( f , " " , op ) == 1 ) { if ( strcmp ( op , " " ) == 0 ) { fscanf ( f , " \n " , op ) ; } else { for ( i = 0 ; i < total_operators ; i ++ ) { if ( strcmp ( operators [ i ] , op ) == 0 ) { printf ( " \n " , operators [ i ] ) ; begin_operation ( f , op ) ; } } } } return ; }
Print contents of open file using the CNC machine
 NEVER call it before check_instructions, you
 may or may not encounter mechanichal problems
Print contents of open file using the CNC machine NEVER call it before check_instructions you may or may not encounter mechanichal problems
/* Move header to beginning of file */ /* TODO: Checks for comments on file */ /* TODO: Is comment */ /* printf("COMMENT\n"); */ /* Not comment */ /* Identifies operation and calls its respective routine */