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 / emap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  2.5 KB  |  91 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. #ident    "@(#)head.sys:emap.h    1.3"
  15.  
  16. /* Channel mapping ioctl's */
  17. /*    LDIOC  ('D'<< 8) */    /* defined in termio.h */
  18.  
  19. /* Channel Mapping ioctl command definitions */
  20. #define LDSMAP (LDIOC|10)
  21. #define LDGMAP (LDIOC|11)
  22. #define LDNMAP (LDIOC|12)
  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. #define    E_TABSZ        1024        /* size of an emtab */
  83. #if BSIZE < E_TABSZ
  84. ERROR ****)))))                /* a buf must hold an emtab */
  85. #endif
  86.  
  87. #define    STRUCTOFF(structure, field)    (int) &(((struct structure *)0)->field)
  88. #define    E_DIND        (STRUCTOFF(emtab, e_dind[0]))
  89. #define    E_ESC        '\0'        /* key maps to dead/compose/string */
  90.  
  91.