home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / sys / ws / ws.h < prev   
Encoding:
C/C++ Source or Header  |  1990-12-08  |  7.0 KB  |  251 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. #ident    "@(#)/usr/include/sys/ws/ws.h.sl 1.1 4.0 12/08/90 4221 AT&T-USL"
  11.  
  12. #ifndef    _SYS_WS_WS_H
  13. #define    _SYS_WS_WS_H
  14.  
  15. /*
  16.  * Definitions for the IWE.
  17.  */
  18.  
  19. #ifdef _KERNEL
  20. struct map_info {
  21.     int    m_cnt;    /* count of the number of memory locations mapped */
  22.     struct proc    *m_procp;    /* process with display mapped */
  23.     pid_t    m_pid;
  24.     int m_chan; /* channel that owns the map currently */
  25.     struct kd_memloc    m_addr[10]; /* display mapping info */
  26. };
  27.  
  28. #define    T_ANSIMVBASE    0x00001
  29. #define    T_BACKBRITE    0x00002
  30.  
  31. typedef struct {
  32.     int    t_flags;    /* terminal state flags -- see above */
  33.     unchar    t_font,        /* selected font */
  34.         t_curattr,    /* current attribute */
  35.         t_normattr,    /* normal character attribute */
  36.         t_undstate;    /* underline state */
  37.     ushort    t_rows,        /* number of characters vertically */
  38.         t_cols,        /* number of characters horizontally */
  39.         t_scrsz,    /* number of characters (ch_cols * ch_rows) */
  40.         t_origin,    /* upper left corner of screen in buffer */
  41.         t_cursor,    /* cursor position (0-based) */
  42.         t_curtyp,    /* cursor type 1 == block, 0 == underline */
  43.         t_row,        /* current row */
  44.         t_col,        /* current column */
  45.         t_sending,    /* sending screen */
  46.         t_sentrows,    /* rows sent */
  47.         t_sentcols;    /* cols sent */
  48.     unchar    t_pstate,    /* parameter parsing state */
  49.         t_ppres;    /* does output ESC sequence have a param */
  50.     ushort    t_pcurr,    /* value of current param */
  51.         t_pnum,        /* current param # of ESC sequence */
  52.         t_ppar[5];    /* parameters of ESC sequence */
  53.     struct attrmask
  54.         *t_attrmskp;    /* pointer to attribute mask array */
  55.     unchar    t_nattrmsk,    /* size of attribute mask array */
  56.         t_ntabs,    /* number of tab stops set */
  57.         *t_tabsp;    /* list of tab stops */
  58. } termstate_t;
  59.  
  60. typedef struct {
  61.     unchar    v_cmos,        /* cmos video controller value */
  62.         v_type,        /* video controller type */
  63.         v_cvmode,    /* current video mode */
  64.         v_dvmode,    /* default video mode */
  65.         v_font,        /* current font loaded */
  66.         v_colsel,    /* color select register byte */
  67.         v_modesel,    /* mode register byte */
  68.         v_undattr,    /* underline attribute */
  69.         v_uline,    /* underline status (on or off) */
  70.         v_nfonts,    /* number of fonts */
  71.         v_border;    /* border attribute */
  72.     ushort    v_scrmsk,    /* mask for placing text in screen memory */
  73.         v_regaddr;    /* address of corresponding M6845 or EGA */
  74.     unchar    **v_parampp;    /* pointer to video parameters table */
  75.     struct font_info
  76.         *v_fontp;    /* pointer to font information */
  77.     caddr_t    v_rscr;        /* "real" address of screen memory */
  78.     ushort    *v_scrp;    /* pointer to video memory */
  79.     int    v_modecnt;    /* number of modes supported */
  80.     struct modeinfo
  81.         *v_modesp;    /* pointer to video mode information table */
  82.     ushort    v_ioaddrs[MKDIOADDR];    /* valid I/O addresses */
  83. } vidstate_t;
  84.  
  85. typedef struct {
  86.     unchar    kb_sysrq,    /* true if last character was K_SRQ */
  87.         kb_srqscan,    /* scan code of K_SRQ */
  88.         kb_lasthot,    /* last hot-key character */
  89.         kb_prevscan;    /* previous scancode */
  90.     ushort    kb_state,    /* keyboard shift/ctrl/alt state */
  91.         kb_sstate,    /* saved keyboard shift/ctrl/alt state */
  92.         kb_togls;    /* caps/num/scroll lock toggles state */
  93.     int    kb_extkey,    /* extended key enable state */
  94.         kb_altseq;    /* used to build extended codes */
  95. } kbstate_t;
  96.  
  97. typedef unchar    extkeys_t[NUM_KEYS+1][NUMEXTSTATES];
  98. typedef unchar    esctbl_t[ESCTBLSIZ][2];
  99.  
  100. struct pfxstate {
  101.     unchar val;
  102.     unchar type;
  103. };
  104.  
  105. typedef struct pfxstate pfxstate_t[K_PFXL - K_PFXF + 1];
  106.  
  107. typedef struct charmap {
  108.     keymap_t
  109.         *cr_keymap_p;    /* scancode to character set mapping */
  110.     extkeys_t
  111.         *cr_extkeyp;    /* extended code mapping */
  112.     esctbl_t
  113.         *cr_esctblp;    /* 0xe0 prefixed scan code mapping */
  114.     strmap_t
  115.         *cr_strbufp;    /* function key mapping */
  116.     srqtab_t
  117.         *cr_srqtabp;    /* sysrq key mapping */
  118.     stridx_t
  119.         *cr_strmap_p;    /* string buffer */
  120.     pfxstate_t
  121.         *cr_pfxstrp;
  122.     struct charmap
  123.         *cr_defltp;    /* pointer to default information for ws */
  124. } charmap_t;
  125.  
  126.  
  127. typedef struct scrn {
  128.     scrnmap_t    *scr_map_p;
  129.     struct scrn    *scr_defltp;
  130. } scrn_t;
  131.  
  132.  
  133. struct channel_info {
  134.     queue_t    *ch_qp;        /* channel read queue pointer */
  135.     int    ch_opencnt,    /* number of opens */
  136.         ch_closing,    /* indicates the channel is closing */
  137.         ch_id,        /* channel id number */
  138.         ch_slpaddr,    /* address to sleep on */
  139.         ch_flags;    /* channel flags */
  140.     struct proc
  141.         *ch_procp;
  142.     int    ch_pid,
  143.         ch_timeid;    /* timeout id for channel switching */
  144.     short    ch_relsig,    /* release signal */
  145.         ch_acqsig,    /* acquire signal */
  146.         ch_frsig;    /* free signal */
  147.     unchar    ch_dmode;    /* current display mode */
  148.     struct wstation 
  149.         *ch_wsp;
  150.     kbstate_t
  151.         ch_kbstate;    /* keyboard state information */
  152.     charmap_t
  153.         *ch_charmap_p;    /* character mapping tables */
  154.     scrn_t
  155.         ch_scrn;
  156.     vidstate_t
  157.         ch_vstate;    /* channel video state information */
  158.     termstate_t
  159.         ch_tstate;    /* terminal state structure for this channel */
  160.     struct strtty
  161.         ch_strtty;
  162.     xqInfo    ch_xque;
  163.     struct channel_info
  164.         *ch_nextp,    /* next channel in linked list */
  165.         *ch_prevp;    /* previous channel in linked list */
  166. #ifdef MERGE386
  167.     struct mcon *ch_merge;    /* pointer to merge console structure */
  168. #endif
  169. };
  170.  
  171. typedef struct channel_info    channel_t;
  172.  
  173. typedef struct wstation {
  174.     int    w_init,        /* workstation has been initialized */
  175.         w_intr,        /* indicates interrupt processing */
  176.         w_active,    /* active channel */
  177.         w_nchan,    /* number of channels */
  178.         w_ticks,    /* used for BELL functionality */
  179.         w_tone,
  180.         w_flags,
  181.         w_noacquire,
  182.         w_wsid,
  183.         w_forcechan,
  184.         w_forcetimeid,
  185.         w_lkstate,
  186.         w_clkstate;
  187.     unchar    w_kbtype,
  188.         w_dmode;
  189.     queue_t    *w_qp;        /* pointer to queue for this minor device */
  190.     mblk_t    *w_mp;        /* pointer to current message block */
  191.     int    w_timeid;    /* id for pending timeouts */
  192.     caddr_t    w_private;    /* used for any workstation specific info */
  193.     channel_t
  194.         **w_chanpp,
  195.         *w_switchto;
  196.     ushort    **w_scrbufpp;
  197.     scrn_t    w_scrn;
  198.     vidstate_t
  199.         w_vstate;    /* workstation video state information */
  200.     termstate_t
  201.         w_tstate;
  202.     struct map_info
  203.         w_map;
  204.     charmap_t
  205.         w_charmap;    /* default charmap for workstation */
  206.     int    (*w_stchar)(),
  207.         (*w_clrscr)(),
  208.         (*w_setbase)(),
  209.         (*w_activate)(),
  210.         (*w_setcursor)(),
  211.         (*w_bell)(),
  212.         (*w_shiftset)(),
  213.         (*w_mvword)(),
  214.         (*w_undattr)(), 
  215.         (*w_rel_refuse)(),
  216.         (*w_acq_refuse)(),
  217.         (*w_scrllck)(),
  218.         (*w_cursortype)(),
  219.         (*w_unmapdisp)();
  220. } wstation_t;
  221.  
  222. #define    WSCMODE(x)    ((struct modeinfo *)x->v_modesp + x->v_cvmode)
  223. #define WSMODE(x, n)    ((struct modeinfo *)x->v_modesp + n)
  224. #define WSNTIM    -1
  225.  
  226. #define HOTKEY    0x10000
  227.  
  228. #define    WS_NOMODESW    0x01
  229. #define WS_NOCHANSW    0x02
  230. #define WS_LOCKED    0x04
  231. #define WS_KEYCLICK    0x08
  232.  
  233. #define CHN_UMAP    0x001
  234. #define CHN_XMAP    0x002
  235. #define CHN_QRSV    0x004
  236. #define CHN_ACTV    0x008
  237. #define CHN_PROC    0x010
  238. #define CHN_WAIT    0x020
  239. #define CHN_HIDN    0x040
  240. #define CHN_WACT    0x080
  241. #define CHN_KILLED    0x100
  242.  
  243. #define CHN_MAPPED    (CHN_UMAP | CHN_XMAP)
  244.  
  245. #define CHNFLAG(x, y)    (x->ch_flags & y)
  246. #endif /* _KERNEL */
  247.  
  248. #define    WS_MAXCHAN    15
  249.  
  250. #endif    /* _SYS_WS_WS_H */
  251.