home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / emap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  3.0 KB  |  106 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_EMAP_H
  11. #define _SYS_EMAP_H
  12.  
  13. #ident    "@(#)/usr/include/sys/emap.h.sl 1.1 4.0 12/08/90 34506 AT&T-USL"
  14.  
  15. /* Channel mapping ioctl's */
  16. /*    LDIOC  ('D'<< 8) */
  17.  
  18. /* Channel Mapping ioctl command definitions
  19.  * #define LDSMAP (LDIOC|10)
  20.  * #define LDGMAP (LDIOC|11)
  21.  * #define LDNMAP (LDIOC|12)
  22.  *     Above are now defined in termios.h */
  23.  
  24. /* Emapping state (t_mstate) */
  25. #define    ES_NULL        0    /* Mapping not enabled */
  26. #define    ES_START    1    /* Base mapping state */
  27. #define    ES_DEAD        2    /* Dead key received */
  28. #define    ES_COMP1    3    /* Compose key received */
  29. #define    ES_COMP2    4    /* Compose and 1st following keys received */
  30.  
  31. #ifdef i386
  32. typedef    struct emtab    *emp_t;
  33. typedef    struct emind    *emip_t;
  34. typedef    struct emout    *emop_t;
  35. typedef    unsigned char    *emcp_t;
  36. #else
  37. typedef    struct emtab    far *emp_t;
  38. typedef    struct emind    far *emip_t;
  39. typedef    struct emout    far *emop_t;
  40. typedef    unsigned char    far *emcp_t;
  41. #endif
  42.  
  43. extern    emcp_t    emmapout();
  44.  
  45. /* Emap control structure */
  46. struct emap {
  47.     emp_t    e_p;            /* ptr to mapping tables struct */
  48.     struct    buf *e_bp;        /* buf hdr for mapping tables */
  49.     short    e_count;        /* use count */
  50.     short    e_ndind;        /* number of dead indexes */
  51.     short    e_ncind;        /* number of compose indexes */
  52.     short    e_nsind;        /* number of string indexes */
  53. };
  54.  
  55. extern struct emap emap[];        /* allocated in space.h */
  56.  
  57.  
  58. /* Emapping tables structures */
  59.  
  60. struct emind {
  61.     unsigned char    e_key;
  62.     unsigned char    e_ind;
  63. };
  64.  
  65. struct emout {
  66.     unsigned char    e_key;
  67.     unsigned char    e_out;
  68. };
  69.  
  70. struct emtab {
  71.     unsigned char    e_imap[256];    /* 8-bit  input map */
  72.     unsigned char    e_omap[256];    /* 8-bit output map */
  73.     unsigned char    e_comp;        /* compose key */
  74.     unsigned char    e_beep;        /* beep on error flag */
  75.     short        e_cind;        /* offset of compose indexes */
  76.     short        e_dctab;    /* offset of dead/compose table */
  77.     short        e_sind;        /* offset of string indexes */
  78.     short        e_stab;        /* offset of string table */
  79.     struct emind    e_dind[1];    /* start of dead key indexes */
  80. };
  81.  
  82. struct emp_tty {
  83.     char    t_mstate;    /* emapping state */
  84.     unsigned char    t_mchar;/* saved emapping char */
  85.     char    t_merr;        /* emapping error flag */
  86.     char    t_xstate;    /* extended state */
  87.     struct emap    *t_mp;    /* emapping table */
  88.     unsigned char    t_schar;/* save timeout char instead of using lflag */
  89.     char    t_yyy[3];    /* reserved */
  90. };
  91.  
  92. #define    E_TABSZ        2048        /* size of an emtab */
  93. #if BSIZE < E_TABSZ
  94. /* ERROR ****)))))    */        /* a buf must hold an emtab */
  95. #endif
  96.  
  97. #ifndef _STRUCTOFF_    /* Also defined in x.out.h */
  98. #define _STRUCTOFF_
  99. #define    STRUCTOFF(structure, field)    (int) &(((struct structure *)0)->field)
  100. #endif    /* _STRUCTOFF_ */
  101.  
  102. #define    E_DIND        (STRUCTOFF(emtab, e_dind[0]))
  103. #define    E_ESC        '\0'        /* key maps to dead/compose/string */
  104.  
  105. #endif    /* _SYS_EMAP_H */
  106.