Next Previous Contents

120. SLang_set_abort_signal

Synopsis

Set the signal to trap SIGINT

Usage

void SLang_set_abort_signal (void (*f)(int));

Description

SLang_set_abort_signal sets the function that gets triggered when the user presses the interrupt key (SIGINT) to the function f. If f is NULL the default handler will get installed.

Example

The default interrupt handler on a Unix system is:

     static void default_sigint (int sig)
     {
        SLKeyBoard_Quit = 1;
        if (SLang_Ignore_User_Abort == 0) SLang_Error = SL_USER_BREAK;
        SLsignal_intr (SIGINT, default_sigint);
   }
Notes

For Unix programmers, the name of this function may appear misleading since it is associated with SIGINT and not SIGABRT. The origin of the name stems from the original intent of the function: to allow the user to abort the running of a S-lang interpreter function.

See Also

SLang_init_tty, SLsignal_intr


Next Previous Contents