SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Handling asynchronous events (signals) in SPRAAK

Support for asynchronous events in SPRAAK is minimalistic. There is a central handler that will catch the most common signals and either act on them (e.g. aborting the program) or signal the event back by setting a bit in the global variable spr_signal_flag. A program in SPRAAK can control the behaviour (default action versus setting a bit in spr_signal_flag) by calling spr_signal_report(). Reacting on the value of spr_signal_flag is left to the main program. Most functions is the SPRAAK library will abort with an error condition if the SPR_SIGNAL_CTRLC or SPR_SIGNAL_QUIT bits in spr_signal_flag are set.

On error conditions (e.g. segmentation fault), the signal handler will also try to print an execution back trace (at least on platforms that support this feature), allowing easier debugging.

For a list of signal that are currently handled, and the corresponding bit mask in spr_signal_flag and default action, see spr_signal_report().