home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / emacs / src / os2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-23  |  1.8 KB  |  77 lines

  1. /* OS/2 specific functions for GNU Emacs for OS/2
  2.    Copyright (C) 1992 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU Emacs.
  5.  
  6. GNU Emacs is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GNU Emacs is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU Emacs; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. #include <signal.h>
  22. #include "lisp.h"
  23.  
  24.  
  25.  
  26. /* Look at ctrl-break-action for explanation. */
  27. int Vctrl_break_action;
  28.  
  29.  
  30. void ctrl_break_signal()
  31. {
  32.  
  33.   signal(SIGBREAK, SIG_ACK);
  34.  
  35.   switch (Vctrl_break_action)
  36.     {
  37.     case 0:
  38.       break;
  39.       
  40.     case 1:
  41.       Vquit_flag = Qt;
  42.       raise(SIGINT);
  43.       break;
  44.  
  45.     case 2:
  46.       exit(1); break;
  47.  
  48.     case 3:
  49.       abort(); break;
  50.  
  51.     default:
  52.       break;
  53.       
  54.     }
  55.   
  56. }
  57.  
  58.  
  59. syms_of_os2()
  60. {
  61.   
  62.   DEFVAR_INT("ctrl-break-action", &Vctrl_break_action,
  63.      "Determines the behavior of Emacs after Ctrl-Break has been pressed.\n\
  64. Available only under OS/2.\n\
  65. 0 : Do nothing, just return C-@.\n\
  66. 1 : Like C-g C-g, termination with request.\n\
  67. 2 : Terminate program immediatly without request.\n\
  68. 3 : Force an abnormal program termination (dump core) without request.\n\
  69. The default value is 1.
  70. It is strongly recommended not to use a value of 2 or higher
  71. since you may loose data after hitting Ctrl-Break !");
  72.   Vctrl_break_action = 1;
  73.  
  74. }
  75.  
  76.      
  77.