mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
29 lines
1.3 KiB
Plaintext
29 lines
1.3 KiB
Plaintext
Interrupts
|
|
|
|
While a calculation is in progress, you can generate the SIGINT
|
|
signal, and the calculator will catch it. At appropriate points
|
|
within a calculation, the calculator will check that the signal
|
|
has been given, and will abort the calculation cleanly. If the
|
|
calculator is in the middle of a large calculation, it might be
|
|
a while before the interrupt has an effect.
|
|
|
|
You can generate the SIGINT signal multiple times if necessary,
|
|
and each time the calculator will abort the calculation at a more
|
|
risky place within the calculation. Each new interrupt prints a
|
|
message of the form:
|
|
|
|
[Abort level n]
|
|
|
|
where n ranges from 1 to 3. For n equal to 1, the calculator will
|
|
abort calculations at the next statement boundary. For n equal to 2,
|
|
the calculator will abort calculations at the next opcode boundary.
|
|
For n equal to 3, the calculator will abort calculations at the next
|
|
lowest level arithmetic operation boundary.
|
|
|
|
If a final interrupt is given when n is 3, the calculator will
|
|
immediately abort the current calculation and longjmp back to the
|
|
top level command level. Doing this may result in corrupted data
|
|
structures and unpredictable future behavior, and so should only
|
|
be done as a last resort. You are advised to quit the calculator
|
|
after this has been done.
|