Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site riccb.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!ihopa!riccb!wrz
From: wrz@riccb.UUCP (William R. Zielinski )
Newsgroups: net.micro.amiga
Subject: Trapping ^C in C programs (Answer)
Message-ID: <573@riccb.UUCP>
Date: Thu, 31-Oct-85 10:09:24 EST
Article-I.D.: riccb.573
Posted: Thu Oct 31 10:09:24 1985
Date-Received: Sat, 2-Nov-85 03:43:29 EST
Distribution: net
Organization: Rockwell Telecommunications, Downers Grove,Il.
Lines: 25

(In response to the question about trapping control-C from C programs.)

I also had trouble finding information about this in the manuals; however,
in the file :examples/README on my Lattice V3.02 disk, I found the following:

...
- TASK INTERRUPTION -
Detection of the 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
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.
...


I hope this helps!  (haven't tried it myself)



					> Bill <