home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / strtty.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  3.2 KB  |  110 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_STRTTY_H
  11. #define _SYS_STRTTY_H
  12.  
  13. #ident    "@(#)/usr/include/sys/strtty.h.sl 1.1 4.0 12/08/90 20635 AT&T-USL"
  14. /*
  15.  * header file for STREAMS TTY subsystem
  16.  */
  17.  
  18.  
  19. /*
  20.  * The t_buf data structure holds information about a message
  21.  * block and its associated data buffer.  One is used for received
  22.  * blocks, and another is used for blocks to be transmitted to
  23.  * a user terminal or a printer.
  24.  */
  25.  
  26. struct t_buf
  27. {
  28.     mblk_t *bu_bp;    /* message block pointer */
  29.     unsigned char *bu_ptr;    /* data buffer pointer */
  30.     ushort bu_cnt;    /* data buffer character count */
  31. };
  32.  
  33. /*
  34.  * A tty structure is needed for each character device used for normal
  35.  * tty I/O.  Each PORTS board supports 4 user terminals and 1 CENTRONICS-
  36.  * TYPE printer.
  37.  */
  38.  
  39. struct strtty
  40. {
  41.     struct t_buf t_in;    /* input buffer info */
  42.     struct t_buf t_out;    /* output buffer info */
  43.     queue_t *t_rdqp;    /* pointer to tty read queue */
  44.     mblk_t  *t_ioctlp;    /* ioctl block pointer */
  45.     mblk_t  *t_lbuf;    /* pointer to a large data buffer */
  46.     int    t_dev;        /* tty minor device number */
  47.     long    t_iflag;    /* input setting  flags */
  48.     long    t_oflag;    /* output setting flags */
  49.     long    t_cflag;    /* physical setting flags */
  50.     long    t_lflag;    /* "line discipline" flags */
  51.     short    t_state;    /* internal state */
  52.     char    t_line;        /* active line discipline */
  53.     char    t_dstat;    /* more internal state flags */
  54.     unsigned char t_cc[NCCS];/* settable control chars */
  55. };
  56.  
  57. /*
  58.  * Size of internal ports data buffer, one per port
  59.  */
  60. #define LARGEBUFSZ    512
  61.  
  62. #define    TTIPRI    28
  63. #define    TTOPRI    29
  64.  
  65. /* Internal state */
  66. #define    TIMEOUT    01        /* Delay timeout in progress */
  67. #define    WOPEN    02        /* Waiting for open to complete */
  68. #define    ISOPEN    04        /* Device is open */
  69. #define    TBLOCK    010
  70. #define    CARR_ON    020        /* Software copy of carrier-present */
  71. #define    BUSY    040        /* Output in progress */
  72. #define    WIOC    0100        /* Wait for ioctl to complete */
  73. #define    WGETTY    0200        /* opened by supergetty, waiting for getty */
  74. #define    TTSTOP    0400        /* Output stopped by ctl-s */
  75. #define    EXTPROC    01000        /* External processing */
  76. #define    TACT    02000
  77. #define    CLESC    04000        /* Last char escape */
  78. #define    RTO    010000        /* Raw Timeout */
  79. #define    TTIOW    020000
  80. #define    TTXON    040000
  81. #define    TTXOFF    0100000
  82.  
  83. /* l_output status */
  84. #define    CPRES    0100000
  85.  
  86. /* device commands */
  87. #define    T_OUTPUT    0
  88. #define    T_TIME        1
  89. #define    T_SUSPEND    2
  90. #define    T_RESUME    3
  91. #define    T_BLOCK        4
  92. #define    T_UNBLOCK    5
  93. #define    T_RFLUSH    6
  94. #define    T_WFLUSH    7
  95. #define    T_BREAK        8
  96. #define    T_INPUT        9
  97. #define T_DISCONNECT    10
  98. #define    T_PARM        11
  99. #define    T_SWTCH        12
  100. /*
  101.  * M_CTL message types.
  102.  */
  103. #define    MC_NO_CANON    0    /* module below saying it will canonicalize */
  104. #define    MC_DO_CANON    1    /* module below saying it won't canonicalize */
  105. #define    MC_CANONQUERY    2    /* module above asking whether module below canonicalizes */
  106. #define    MC_PART_CANON    3    /* tell line discipline to do some canonicalization */
  107. #define SXTSWTCH    'Z'    /* SXT switch character */
  108.  
  109. #endif    /* _SYS_STRTTY_H */
  110.