home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / atari / st / tech / 4412 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.2 KB  |  30 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!ilepore
  3. From: ilepore@nyx.cs.du.edu (Ian Lepore)
  4. Subject: Trapping ^C
  5. Message-ID: <1992Aug14.071027.24659@mnemosyne.cs.du.edu>
  6. Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
  7. Organization: Nyx, Public Access Unix @ U. of Denver Math/CS dept.
  8. Date: Fri, 14 Aug 92 07:10:27 GMT
  9. Lines: 19
  10.  
  11.  What's a good method of trapping a ^C from within a program and ignoring
  12. it?  I've tried using the terminate handler (vector 0x0102) but that gets
  13. control on *any* type of program exit (ie, even if you called exit()).  I
  14. can't find anything in the atari docs that says how to tell if the terminate
  15. handler was invoked by a detection of ^C in DOS, but (oddly enough) they
  16. call that vector the ^C handler in the docs.
  17.  
  18.  (Actually, leave out the "and ignoring it" part of that question.  I can
  19. handle that part of it with a longjmp, I just need to be sure it's a ^C
  20. termination and not a normal program exit.)
  21.  
  22.  (Also, suggestions like "uninstall your 0x0102 handler in the exit() 
  23. routine" are Not An Option for me -- the program could have done a Pterm()
  24. or a gemdos(0) or something else that I can't catch at all.)
  25.  
  26. --
  27. - Ian
  28. (void *) where prohibited by law
  29.  
  30.