Resets the display and exitsvoid sm_cancel(int arg);
- A dummy argument that always has a value of 0. This argument lets the C function
sm_cancelas a signal handler.
sm_initcrt installs this function to handle keyboard interrupts.
sm_cancelcalls sm_resetcrt to restore the display to the operating system's default state, and exits to the operating system.
Depending on your operating system, you can also install this function to handle conditions that normally cause a program to abort. If a program aborts with
sm_cancelinstalled, its call to
sm_resetcrtensures that your terminal is restored to its normal state.
/* the following program segment could be found in
* some error routines */
sm_fquiet_err(0, "fatal error -- can't continue!\n");
/* The following code can be used on a UNIX system to
* install sm_cancel() as a signal handler. */