Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site amiga.amiga.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!nsc!pyramid!amiga!bruceb
From: bruceb@amiga.UUCP (Bruce Barrett)
Newsgroups: net.micro.amiga
Subject: Re: Trapping Control-C in C Programs (Question)
Message-ID: <150@amiga.amiga.UUCP>
Date: Wed, 30-Oct-85 14:34:25 EST
Article-I.D.: amiga.150
Posted: Wed Oct 30 14:34:25 1985
Date-Received: Sat, 2-Nov-85 04:23:56 EST
References: <331@muddcs.UUCP>
Reply-To: bruceb@hunter.UUCP (Bruce Barrett)
Distribution: net
Organization: Commodore-Amiga Inc., 983 University Ave #D, Los Gatos CA 95030
Lines: 23

In response to the question about detecting program interruption
from Lattice C I am including the following text from the next
READ.ME file.

""- TASK INTERRUPTION -

Detection of Ctrl-C and Ctrl-D is provided in the I/O library. If the external
integer location Enable_Abort is set to non-zero a check for these conditions
is performed every time a level-1 I/O call is made. If either of these keys
were pressed, the appropriate character is echoed to stdout, all level-1
files are closed, and the program terminates. Programs that do not use
level-1 I/O or that wish to check more frequently may call the function
Chk_Abort(), which will return zero if neither of the keys were pressed, or
the signal value if either key was pressed. Note that if Enable_Abort is non-
zero a successful call to Chk_Abort (either key had been pressed) will result
in program termination as described above.""

CAUTION:  The closing of files and freeing of memory that is done "for you"
by C is limited to the files and memory allocation that the C runtime
system knows about (documented in the C manual).  If you use any ROM or
AmigaDOS routines (documented else where) C will NOT clean those up.

(Good /Amiga/ programmers clean up after themselves)