int main ( int argc, char *argv[] ) { Param params; FlowCom *comPtr = NULL; char line [ LINE_LEN ]; while ( argc > 1 ) { if ( !strcmp( argv[1], "-D" ) ) { setDebugFlag(); } else if ( !strcmp( argv[1], "-V" ) ) { printf ( "%s\n", VERSION ); exit ( 0 ); } else { break; } argv++; argc--; } open_tempfile(); open_infile ( ( argc > 1 ) ? argv[ 1 ] : NULL ); tprintf ( "%% picture environment flowchart generated by flow " ); tprintf ( "%s\n", VERSION ); while ( readline_infile ( line, LINE_LEN ) != NULL ) { if ( ( comPtr = getCommand ( line, params ) ) != NULL ) { switch ( comPtr -> command ) { case MACRO: if ( doMacro ( params ) ) { errout ( E_NO_END_MACRO ); } break; case EXPAND: doExpand ( params ); break; default: if ( !doCommand ( comPtr, params ) ) { return 10; } } } else { break; } } close_infile(); close_tempfile(); apply_tempfile ( getPic(), ( argc > 2 ) ? argv[ 2 ] : NULL ); remove_tempfile(); // dumpFigure(); return 0; /* just to suppress the warning */ }
int main(int argc, char *argv[]) { struct Sm_TestClass thisContext; Sm_TestClass_Init(&thisContext); if (argc > 1) { setDebugFlag(&thisContext._fsm, 1); } Sm_TestClass_Evt_1(&thisContext); return EXIT_SUCCESS; }