<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE> {The S-lang C Library Reference}: SLang_set_abort_signal</TITLE>
<LINK HREF="cref-118.html" REL=next>
<LINK HREF="cref-116.html" REL=previous>
<LINK HREF="cref.html#toc117" REL=contents>
</HEAD>
<BODY>
<A HREF="cref-118.html">Next</A>
<A HREF="cref-116.html">Previous</A>
<A HREF="cref.html#toc117">Contents</A>
<HR>
<H2><A NAME="SLang_set_abort_signal"></A> <A NAME="s117">117. <B>SLang_set_abort_signal</B></A></H2>

<P>
<DL>
<DT><B> Synopsis </B><DD><P>Set the signal to trap SIGINT
<DT><B> Usage </B><DD><P><CODE>void SLang_set_abort_signal (void (*f)(int));</CODE>
<DT><B> Description </B><DD><P><CODE>SLang_set_abort_signal</CODE> sets the function that gets
triggered when the user presses the interrupt key (<CODE>SIGINT</CODE>) to
the function <CODE>f</CODE>.  If <CODE>f</CODE> is <CODE>NULL</CODE> the default handler
will get installed.
<DT><B> Example </B><DD><P>The default interrupt handler on a Unix system is:
<BLOCKQUOTE><CODE>
<PRE>
     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);
   }
</PRE>
</CODE></BLOCKQUOTE>
<DT><B> Notes </B><DD><P>For Unix programmers, the name of this function may appear
misleading since it is associated with <CODE>SIGINT</CODE> and not
<CODE>SIGABRT</CODE>.  The origin of the name stems from the original intent
of the function: to allow the user to abort the running of a <B>S-lang</B>
interpreter function.
<DT><B> See Also </B><DD><P><CODE>SLang_init_tty, SLsignal_intr</CODE>
</DL>
<P>
<P>
<P>
<HR>
<A HREF="cref-118.html">Next</A>
<A HREF="cref-116.html">Previous</A>
<A HREF="cref.html#toc117">Contents</A>
</BODY>
</HTML>
