home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / atari / st / tech / 4416 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  1.7 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!ukma!usenet.ins.cwru.edu!news.ysu.edu!psuvm!frmop11!dearn!dmswwu1a!reschke
  2. From: RESCHKE@DMSWWU1A.UNI-MUENSTER.DE (Julian F. Reschke)
  3. Newsgroups: comp.sys.atari.st.tech
  4. Subject: Re: Trapping ^C
  5. Message-ID: <92227.122551RESCHKE@DMSWWU1A.UNI-MUENSTER.DE>
  6. Date: 14 Aug 92 11:40:33 GMT
  7. References: <1992Aug14.071027.24659@mnemosyne.cs.du.edu>
  8. Lines: 26
  9. Organisation: Westfaelische Wilhelms-Universitaet, Muenster, Germany
  10.  
  11. In article <1992Aug14.071027.24659@mnemosyne.cs.du.edu>, ilepore@nyx.cs.du.edu
  12. (Ian Lepore) says:
  13. >
  14. > What's a good method of trapping a ^C from within a program and ignoring
  15. >it?  I've tried using the terminate handler (vector 0x0102) but that gets
  16. >control on *any* type of program exit (ie, even if you called exit()).  I
  17. >can't find anything in the atari docs that says how to tell if the terminate
  18. >handler was invoked by a detection of ^C in DOS, but (oddly enough) they
  19. >call that vector the ^C handler in the docs.
  20. >
  21. > (Actually, leave out the "and ignoring it" part of that question.  I can
  22. >handle that part of it with a longjmp, I just need to be sure it's a ^C
  23. >termination and not a normal program exit.)
  24.  
  25. According to the official documentation, you are not allowed to to
  26. further GEMDOS calls from within the terminate handler. This means, that
  27. all current 'solutions' that *do* catch CTRL-C this way are doing
  28. something unofficial (note that it's easy when you are using MiNT...).
  29.  
  30. >
  31. > (Also, suggestions like "uninstall your 0x0102 handler in the exit()
  32. >routine" are Not An Option for me -- the program could have done a Pterm()
  33. >or a gemdos(0) or something else that I can't catch at all.)
  34.  
  35. The terminate handler is called *BY* the Pterm*() functions -- you can rely
  36. on that to remove your handler.
  37.