del - interrupt handling package
Del is a small subroutine used as an interrupt trap routine. It is
used with the macro package <del.h> to provide a complete facility
for trapping interrupts (DEL or RUBOUT key on the terminal).
The macro file includes all the
definitions listed above, and uses
an external int (_del_) as an interrupt flag. When an interrupt
occurs, the del subroutine will increment _del_ (usually from 0 to
1), signal(2) itself for further interrupts, and return. The user
may then test this variable with the macros listed above.
These macros control overall interrupt handling:
clears _del_ and begins interrupt trapping.
clears _del_ and ignores interrupts.
clears _del_ and restores normal interrupt handling (kill
process on interrupt).
These macros allow you to see if
an interrupt has occurred (they do
nothing if none has occurred):
clears _del_ and acts like a break statement.
clears _del_ and acts like a return statement.
clears _del_ and acts like the statement return(value).
clears _del_ and prints "Break ignored".
In addition, you may perform a
simpler test for interrupts like
if (_del_) ...
This is useful in conjunction with the above macros when you wish,
for example, to exit from several layers of loops or procedures.
/usr/include/del.h -- macro package
printed by DELBREAK, DELRETURN, and DELRETURN(value) if an
interrupt has occurred.
printed by DELCLEAR if an interrupt has occurred.
It is possible, in any UNIX program which traps interrupts, for an
interrupt to be missed if it immediately follows a previous
interrupt of the same kind.