/* El main solo define las variables necesarias para la funcion * PrintToken, crea el archivo de errores y por medio del loop * se toma cada token y su salida es por el stdout si no hay errores * o por stderr si los hay. */ int main() { TokenType token; OpenErrorFile(); while ((token = (TokenType)yylex()) != 0) PrintToken(token, yytext, yylval); CloseErrorFile(); return 0; }
/* * FiniApp: * Cleans up the application, frees memory. */ void FiniApp(void) { WriteError("\n ====== KILL ======"); // Kill the game stuff KillStuff(); // Blacken the surfaces of the flipping chain // prevents residue gfx showing up after closing WriteError("\n Clearing Display Surfaces..."); DDFillSurface(lpDDSPrimary, 0); // Fill the primary surface with black DDFillSurface(lpDDSBack, 0); // Fill the back surface with black // shutdown directdraw WriteError("\n Shutting down DirectDraw..."); DDShutdown(); WriteError("\n DirectDraw shut down..."); // shutdown DigitalFX WriteError("\n Shutting down DigitalFX..."); digifxDone(); WriteError("\n DigitalFX shut down..."); // shutdown directsound WriteError("\n Shutting down DirectSound..."); DSShutdown(); WriteError("\n DirectSound shut down..."); // release all input devices WriteError("\n Releasing Control of Input Devices..."); DIReleaseKeyboard(); DIReleaseJoystick(); WriteError("\n Input Devices released..."); // shutdown directinput WriteError("\n Shutting down DirectInput..."); DIShutdown(); WriteError("\n DirectInput shut down..."); WriteError("\n ====== END KILL ======"); // close the error file CloseErrorFile(); }