You may need to get control of the application program when the user presses the program abort key, so that you can do any necessary cleanup tasks before the program aborts. You can install an abort function that will be called automatically when an abort condition is detected by Vermont Views. An abort function is used to terminate your program cleanly.
The Vermont Views abort function is vv_abort(), which simply calls vv_exit() and exit(). Under PCDOS and OS\2, this default abort function is not installed. Under UNIX, POSIX and VMS, vv_abort() is installed as the abort function during system initialization. Thus, under VMS, if ki(), ki_chk() or evnt_get() detect an abort condition or under UNIX or POSIX, the operating system detects an abort condition, vv_abort() is called to terminate the program.
The following are interpreted as abort conditions:
| PCDOS | Ctrl-C (Note that Ctrl-Break is handled differently under PCDOS. To control Ctrl-Break processing, install a break processing function using se_breakfp(). |
| OS/2 | Ctrl-C and Ctrl-Break |
| UNIX | INTR signal (This is usually the result of the user pressing the DELETE key.) |
| VMS | Ctrl-C or Ctrl-Y |
For PCDOS and VMS systems, the abort condition can only be detected during a call to ki(), ki_chk() or evnt_get(). If your application reads the keyboard frequently, abort processing is prompt. However, if your keyboard input is rarely processed during the course of your program, abort processing will be delayed until the keyboard buffer is checked with a call to ki(), ki_chk(), or evnt_get(). Consequently, if a program does not read the keyboard, the user will be unable to terminate the program from the terminal.
Abort key processing is immediate under UNIX.