home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / vt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  3.6 KB  |  103 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_VT_H
  11. #define _SYS_VT_H
  12.  
  13. #ident    "@(#)/usr/include/sys/vt.h.sl 1.1 4.0 12/08/90 23144 AT&T-USL"
  14.  
  15. /*
  16.  * definitions for PC AT virtual terminal driver
  17.  */
  18.  
  19. #define    VTINDEX(dev)    ((dev & 0xff) % 15)
  20. #define    VTMAX    0x0f
  21.  
  22. #define    VT_FORCE    1    /* flag to force a vt switch */
  23. #define    VT_NOFORCE    0    /* dont force a vt switch */
  24. #define    VT_NOSAVE    2    /* On close - don't save screen */
  25.  
  26. /*
  27.  * Bits in vtty flags word.
  28.  */
  29. #define    VT_ACTIVE    0x0001    /* set if this is the active vt */
  30. #define    VT_PROCMOD    0x0002    /* set if vt has process control mode set */
  31. #define    VT_WAIT        0x0004    /* set if writes to hang if not active vt */
  32. #define    VT_HIDDEN    0x0008    /* set if vt on ring is to be skipped */
  33. #define VT_WAITACT    0x0010    /* set if vt needs wakeup when switched to */
  34.  
  35. /*
  36.  * all vttys for a device should be circularly linked via the
  37.  * link field of the structure, active vttys are doubly circularly
  38.  * linked via the next and prev fields.
  39.  */
  40. struct vtty {    /* virtual terminal structure */
  41.     struct vtty    *link;    /* next vtty on device */
  42.     struct vtty    *prev;    /* previous vtty in ring */
  43.     struct vtty    *next;    /* next vtty in ring */
  44.     struct vtty    *switchto;    /* vtty to be activated */
  45.     struct    tty    *tp;    /* tty associated with this vtty */
  46.     caddr_t        dsp;    /* device specific info for this vtty */
  47.     struct proc    *procp;    /* ptr to process controlling this vtty */
  48.     short    pid;        /* pid of process controlling this vtty */
  49.     ushort    flags;        /* flags for this vtty */
  50.     char    opencnt;    /* number of opens on this vtty */
  51.     char    vtno;        /* vt index number of this vtty */
  52.     short    relsig;        /* signal to send to request release */
  53.     short    acqsig;        /* signal to send to signal acquisition */
  54.     short    frsig;        /* signal to send on forced removal */
  55.     int    timeid;        /* timeout id for this vtty */
  56.     int    (*dsactivate)(); /* device specific activation routine */
  57.     int    (*dsrefuse)();    /* device specific release refused routine */
  58.     int    (*dsautomode)(); /* device specific switch to auto mode */
  59. };
  60.  
  61. /*
  62.  * IOCTLs supported by the VT
  63.  */
  64. #define VTIOC        ('v'<<8)
  65. #define VT_OPENQRY    (VTIOC|1)    /* inquires if this vt already open */
  66. #define    VT_SETMODE    (VTIOC|2)    /* set vt into auto or process mode */
  67. #define    VT_GETMODE    (VTIOC|3)    /* returns mode vt is currently in */
  68. #define    VT_RELDISP    (VTIOC|4)    /* tells vt when display released */
  69. #define    VT_ACTIVATE    (VTIOC|5)    /* activates specified vt */
  70. #define VT_WAITACTIVE    (VTIOC|6)    /* wait for vt to be activated */
  71. #define VT_GETSTATE    (VTIOC|100)    /* return active and open vts */
  72. #define VT_SENDSIG    (VTIOC|101)    /* send signal to specified vts */
  73.  
  74. struct vt_mode {
  75.     char    mode;    /* mode to set vt into */
  76.     char    waitv;    /* if != 0, vt hangs on writes when not active */
  77.     short    relsig;    /* signal to use for release request */
  78.     short    acqsig;    /* signal to use for display acquired */
  79.     short    frsig;    /* signal to use for forced release */
  80. };
  81.  
  82. #define    VT_AUTO        0    /* this vt's switching is automatic */
  83. #define    VT_PROCESS    1    /* this vt's switching controlled by process */
  84. #define VT_ACKACQ    2    /* ack form v86 acquire routine */
  85.  
  86. /*
  87.  * IOCTL supported by xterm to get vt name
  88.  */
  89. #define TIOCVTNAME    (('T' << 8) | 250)
  90. #define VTNAMESZ    32
  91.  
  92. /*
  93.  * structure used by VT_GETSTATE and VT_SENDSIG ioctls
  94.  */
  95.  
  96. struct vt_stat {
  97.     ushort    v_active,
  98.         v_signal,
  99.         v_state;
  100. } ;
  101.  
  102. #endif    /* _SYS_VT_H */
  103.