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 / os2tty.c < prev    next >
C/C++ Source or Header  |  1999-01-02  |  2KB  |  84 lines

  1. /* -*-C-*-
  2.  
  3. $Id: os2tty.c,v 1.2 1999/01/02 06:11:34 cph Exp $
  4.  
  5. Copyright (c) 1994, 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 "os2.h"
  23. #include "ostty.h"
  24. #ifdef USE_PMIO
  25. #include <pmio.h>
  26. #endif
  27.  
  28. static Tchannel input_channel;
  29. static Tchannel output_channel;
  30.  
  31. void
  32. OS2_initialize_tty (void)
  33. {
  34.   extern Tchannel EXFUN (OS_open_fd, (int fd));
  35.   input_channel = (OS2_make_channel (0, CHANNEL_READ));
  36.   (CHANNEL_INTERNAL (input_channel)) = 1;
  37.   output_channel = (OS2_make_channel (1, CHANNEL_WRITE));
  38.   (CHANNEL_INTERNAL (output_channel)) = 1;
  39. }
  40.  
  41. Tchannel
  42. OS_tty_input_channel (void)
  43. {
  44.   return (input_channel);
  45. }
  46.  
  47. Tchannel
  48. OS_tty_output_channel (void)
  49. {
  50.   return (output_channel);
  51. }
  52.  
  53. unsigned int
  54. OS_tty_x_size (void)
  55. {
  56. #ifdef USE_PMIO
  57.   return (get_screen_width ());
  58. #else
  59.   return (80);
  60. #endif
  61. }
  62.  
  63. unsigned int
  64. OS_tty_y_size (void)
  65. {
  66. #ifdef USE_PMIO
  67.   return (get_screen_height ());
  68. #else
  69.   return (24);
  70. #endif
  71. }
  72.  
  73. const char *
  74. OS_tty_command_beep (void)
  75. {
  76.   return ("\a");
  77. }
  78.  
  79. const char *
  80. OS_tty_command_clear (void)
  81. {
  82.   return ("\f");
  83. }
  84.