home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / vt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  3.6 KB  |  103 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. /*    Copyright (c) 1987, 1988 Microsoft Corporation    */
  9. /*      All Rights Reserved    */
  10.  
  11. /*    This Module contains Proprietary Information of Microsoft  */
  12. /*    Corporation and should be treated as Confidential.       */
  13.  
  14.  
  15. #ident    "@(#)head.sys:vt.h    1.3.2.8"
  16.  
  17. /*
  18.  * definitions for PC AT virtual terminal driver
  19.  */
  20.  
  21. #define    VTINDEX(dev)    ((((dev) >> 5) & 0x07) | (((dev) >> 1) & 0x08))
  22. #define    VTMAX    0x0f
  23.  
  24. #define    VT_FORCE    1    /* flag to force a vt switch */
  25. #define    VT_NOFORCE    0    /* dont force a vt switch */
  26. #define    VT_NOSAVE    2    /* On close - don't save screen */
  27.  
  28. /*
  29.  * Bits in vtty flags word.
  30.  */
  31. #define    VT_ACTIVE    0x0001    /* set if this is the active vt */
  32. #define    VT_PROCMOD    0x0002    /* set if vt has process control mode set */
  33. #define    VT_WAIT        0x0004    /* set if writes to hang if not active vt */
  34. #define    VT_HIDDEN    0x0008    /* set if vt on ring is to be skipped */
  35. #define VT_WAITACT    0x0010    /* set if vt needs wakeup when switched to */
  36.  
  37. /*
  38.  * all vttys for a device should be circularly linked via the
  39.  * link field of the structure, active vttys are doubly circularly
  40.  * linked via the next and prev fields.
  41.  */
  42. struct vtty {    /* virtual terminal structure */
  43.     struct vtty    *link;    /* next vtty on device */
  44.     struct vtty    *prev;    /* previous vtty in ring */
  45.     struct vtty    *next;    /* next vtty in ring */
  46.     struct vtty    *switchto;    /* vtty to be activated */
  47.     struct    tty    *tp;    /* tty associated with this vtty */
  48.     caddr_t        dsp;    /* device specific info for this vtty */
  49.     struct proc    *procp;    /* ptr to process controlling this vtty */
  50.     short    pid;        /* pid of process controlling this vtty */
  51.     ushort    flags;        /* flags for this vtty */
  52.     char    opencnt;    /* number of opens on this vtty */
  53.     char    vtno;        /* vt index number of this vtty */
  54.     short    relsig;        /* signal to send to request release */
  55.     short    acqsig;        /* signal to send to signal acquisition */
  56.     short    frsig;        /* signal to send on forced removal */
  57.     int    timeid;        /* timeout id for this vtty */
  58.     int    (*dsactivate)(); /* device specific activation routine */
  59.     int    (*dsrefuse)();    /* device specific release refused routine */
  60.     int    (*dsautomode)(); /* device specific switch to auto mode */
  61. };
  62.  
  63. /*
  64.  * IOCTLs supported by the VT
  65.  */
  66. #define VTIOC        ('v'<<8)
  67. #define VT_OPENQRY    (VTIOC|1)    /* inquires if this vt already open */
  68. #define    VT_SETMODE    (VTIOC|2)    /* set vt into auto or process mode */
  69. #define    VT_GETMODE    (VTIOC|3)    /* returns mode vt is currently in */
  70. #define    VT_RELDISP    (VTIOC|4)    /* tells vt when display released */
  71. #define    VT_ACTIVATE    (VTIOC|5)    /* activates specified vt */
  72. #define VT_WAITACTIVE    (VTIOC|6)    /* wait for vt to be activated */
  73. #define VT_GETSTATE    (VTIOC|100)    /* return active and open vts */
  74. #define VT_SENDSIG    (VTIOC|101)    /* send signal to specified vts */
  75.  
  76. struct vt_mode {
  77.     char    mode;    /* mode to set vt into */
  78.     char    waitv;    /* if != 0, vt hangs on writes when not active */
  79.     short    relsig;    /* signal to use for release request */
  80.     short    acqsig;    /* signal to use for display acquired */
  81.     short    frsig;    /* signal to use for forced release */
  82. };
  83.  
  84. #define    VT_AUTO        0    /* this vt's switching is automatic */
  85. #define    VT_PROCESS    1    /* this vt's switching controlled by process */
  86. #define VT_ACKACQ    2    /* ack form v86 acquire routine */
  87.  
  88. /*
  89.  * IOCTL supported by xterm to get vt name
  90.  */
  91. #define TIOCVTNAME    (('T' << 8) | 250)
  92. #define VTNAMESZ    32
  93.  
  94. /*
  95.  * structure used by VT_GETSTATE and VT_SENDSIG ioctls
  96.  */
  97.  
  98. struct vt_stat {
  99.     ushort    v_active,
  100.         v_signal,
  101.         v_state;
  102. } ;
  103.