/////////////////////////////////////////////////////////////// // // curses_example.cpp // // Jeff Ondich, 6/1/03 // /////////////////////////////////////////////////////////////// #include #include "frontend.h" /////////////////////////////////////////////////////////////// // If you allow Ctrl-C to stop the program, the terminal // settings won't be restored properly. By catching SIGINT // signals from the operating system (and doing nothing with // them), you prevent Ctrl-C from killing the program. Thus, // you force users to quit your program in the normal way, // which guarantees proper clean-up. // // The function sigint_handler (that's my name, not a required // name) and the two calls to signal() in main take care of // handling Ctrl-C's in this way. /////////////////////////////////////////////////////////////// #include #include void sigint_handler( int sig ); int main() { signal( SIGINT, sigint_handler ); FrontEnd frontEnd; frontEnd.Run(); signal( SIGINT, SIG_IGN ); return 0; } void sigint_handler( int sig ) { system( "echo hi >> moose.txt" ); }