home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 202.img / SCO386N2.TD0 / usr / include / sys / emap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-18  |  2.3 KB  |  85 lines

  1. /*
  2.  *    @(#) emap.h 2.2 88/05/18 
  3.  *
  4.  *    Copyright (C) The Santa Cruz Operation, 1984, 1985, 1986, 1987, 1988.
  5.  *    Copyright (C) Microsoft Corporation, 1984, 1985, 1986, 1987, 1988.
  6.  *    This Module contains Proprietary Information of
  7.  *    The Santa Cruz Operation, Microsoft Corporation
  8.  *    and AT&T, and should be treated as Confidential.
  9.  */
  10.  
  11. /* Channel mapping ioctl's */
  12. /*    LDIOC  ('D'<< 8) */    /* defined in termio.h */
  13. #define LDSMAP (LDIOC|10)
  14. #define LDGMAP (LDIOC|11)
  15. #define LDNMAP (LDIOC|12)
  16.  
  17. /* Emapping state (t_mstate) */
  18. #define    ES_NULL        0    /* Mapping not enabled */
  19. #define    ES_START    1    /* Base mapping state */
  20. #define    ES_DEAD        2    /* Dead key received */
  21. #define    ES_COMP1    3    /* Compose key received */
  22. #define    ES_COMP2    4    /* Compose and 1st following keys received */
  23.  
  24. #define    NEMBUFS    10        /* Max number of buffers for mapping table */
  25.  
  26. #ifdef M_I386
  27. typedef    struct emtab    *emp_t;
  28. typedef    struct emind    *emip_t;
  29. typedef    struct emout    *emop_t;
  30. typedef    unsigned char    *emcp_t;
  31. #else
  32. typedef    struct emtab    far *emp_t;
  33. typedef    struct emind    far *emip_t;
  34. typedef    struct emout    far *emop_t;
  35. typedef    unsigned char    far *emcp_t;
  36. #endif
  37.  
  38. extern    emcp_t    emmapout();
  39.  
  40. /* Emap control structure */
  41. struct emap {
  42.     emp_t    e_tp[NEMBUFS];        /* table of ptrs to mapping tables */
  43.     struct    buf *e_bp;        /* buf hdr for mapping tables */
  44.     short    e_count;        /* use count */
  45.     short    e_ndind;        /* number of dead indexes */
  46.     short    e_ncind;        /* number of compose indexes */
  47.     short    e_nsind;        /* number of string indexes */
  48. };
  49.  
  50. extern struct emap emap[];        /* allocated in space.h */
  51.  
  52.  
  53. /* Emapping tables structures */
  54.  
  55. struct emind {
  56.     unsigned char    e_key;
  57.     unsigned char    e_ind;
  58. };
  59.  
  60. struct emout {
  61.     unsigned char    e_key;
  62.     unsigned char    e_out;
  63. };
  64.  
  65. struct emtab {
  66.     unsigned char    e_imap[256];    /* 8-bit  input map */
  67.     unsigned char    e_omap[256];    /* 8-bit output map */
  68.     unsigned char    e_comp;        /* compose key */
  69.     unsigned char    e_beep;        /* beep on error flag */
  70.     short        e_cind;        /* offset of compose indexes */
  71.     short        e_dctab;    /* offset of dead/compose table */
  72.     short        e_sind;        /* offset of string indexes */
  73.     short        e_stab;        /* offset of string table */
  74.     struct emind    e_dind[1];    /* start of dead key indexes */
  75. };
  76.  
  77. #define    E_TABSZ        1024        /* size of an emtab */
  78. #if BSIZE < E_TABSZ
  79. ERROR ****)))))                /* a buf must hold an emtab */
  80. #endif
  81.  
  82. #define    E_DIND        (STRUCTOFF(emtab, e_dind[0]))
  83. #define    E_ESC        '\0'        /* key maps to dead/compose/string */
  84.  
  85.