home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / qterm / qterm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1987-07-29  |  2.5 KB  |  81 lines

  1. /*
  2.  * $Header: qterm.h,v 3.0 87/06/30 19:09:04 mcooper Release $
  3.  *------------------------------------------------------------------
  4.  *
  5.  * $Source: /big/src/usc/bin/qterm/RCS/qterm.h,v $
  6.  * $Revision: 3.0 $
  7.  * $Date: 87/06/30 19:09:04 $
  8.  * $State: Release $
  9.  * $Author: mcooper $
  10.  * $Locker:  $
  11.  *
  12.  *------------------------------------------------------------------
  13.  *
  14.  * Michael A. Cooper
  15.  * Research and Development Group
  16.  * University Computing Services 
  17.  * University of Southern California
  18.  * (mcooper@oberon.USC.EDU)
  19.  *
  20.  *------------------------------------------------------------------
  21.  * $Log:    qterm.h,v $
  22.  * Revision 3.0  87/06/30  19:09:04  mcooper
  23.  * Release of version 3.
  24.  * 
  25.  * Revision 2.4  87/06/30  19:02:28  mcooper
  26.  * WAIT changed to 2 for slow systems.
  27.  * 
  28.  *------------------------------------------------------------------
  29.  */
  30.  
  31.  
  32.  
  33. #ifndef TABFILE
  34. # define TABFILE   "/usr/local/lib/qtermtab"
  35. #endif
  36.  
  37. #define ALTSEND    "\033[c"            /* alternate string */
  38. #define STRFILE    ".qterm"            /* file containing terminal strings */
  39.  
  40. #define WAIT       2                   /* Number of seconds for alarms */
  41. #define MAXTERMS   50                  /* Maximum # of terminals for qterm */
  42.  
  43. #define SIZE      512
  44. #define CMASK     0377
  45. #define ESC       '\033'
  46.  
  47. #define TRUE       1
  48. #define FALSE      0
  49.  
  50. #ifdef USG5
  51. # define crmode()     (_ntty.c_lflag &= ~ICANON,\
  52.                _ntty.c_cc[VMIN] = 1, _ntty.c_cc[VTIME] = 0,\
  53.                ioctl(_tty_ch, TCSETAF, &_ntty))
  54. # define nocrmode()   (_ntty.c_lflag |= ICANON,\
  55.                _ntty.c_cc[VMIN] = _otty.c_cc[VMIN],\
  56.                _ntty.c_cc[VTIME] = _otty.c_cc[VTIME],\
  57.                ioctl(_tty_ch, TCSETAF, &_ntty))
  58. # define echo()       (_ntty.c_lflag |= ECHO,\
  59.                ioctl(_tty_ch, TCSETAF, &_ntty))
  60. # define noecho()     (_ntty.c_lflag &= ~ECHO,\
  61.                ioctl(_tty_ch, TCSETAF, &_ntty))
  62. #else
  63. # define crmode()     (_tty.sg_flags |= CBREAK,\
  64.                ioctl(_tty_ch, TIOCSETP, &_tty))
  65. # define nocrmode()   (_tty.sg_flags &= ~CBREAK,\
  66.                ioctl(_tty_ch, TIOCSETP, &_tty))
  67. # define echo()       (_tty.sg_flags |= ECHO,   \
  68.                ioctl(_tty_ch, TIOCSETP, &_tty))
  69. # define noecho()     (_tty.sg_flags &= ~ECHO,  \
  70.                ioctl(_tty_ch, TIOCSETP, &_tty))
  71. #endif
  72.  
  73. #define dprintf    if(debug)printf
  74.  
  75. struct qt {
  76.   char  qt_sendstr[BUFSIZ];     /* String to send to terminal */
  77.   char  qt_recvstr[BUFSIZ];     /* String expected in response */
  78.   char  qt_termname[BUFSIZ];    /* Terminal name */
  79.   char  qt_fullname[BUFSIZ];    /* Full terminal name & description */
  80. };
  81.