home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / microcode / ostty.c < prev    next >
C/C++ Source or Header  |  1999-01-02  |  2KB  |  53 lines

  1. /* -*-C-*-
  2.  
  3. $Id: ostty.c,v 1.4 1999/01/02 06:11:34 cph Exp $
  4.  
  5. Copyright (c) 1990, 1999 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21.  
  22. #include "ostty.h"
  23. #include "osscheme.h"
  24.  
  25. static cc_t next_interrupt_char;
  26.  
  27. void
  28. DEFUN (tty_set_next_interrupt_char, (c), cc_t c)
  29. {
  30.   if (next_interrupt_char == '\0')
  31.     {
  32.       next_interrupt_char = c;
  33.       request_character_interrupt ();
  34.     }
  35. }
  36.  
  37. cc_t
  38. DEFUN_VOID (OS_tty_next_interrupt_char)
  39. {
  40.   if (next_interrupt_char == '\0')
  41.     error_external_return ();
  42.   {
  43.     /* The interrupt character is mapped here. This provides a
  44.        chance for OS's which have only one interrupt character
  45.        and can't do I/O during an interrupt to request the
  46.        interrupt character in a safe place.
  47.      */
  48.     cc_t result = OS_tty_map_interrupt_char(next_interrupt_char);
  49.     next_interrupt_char = '\0';
  50.     return (result);
  51.   }
  52. }
  53.