home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / comms / comprgs / term232.lha / Source_Code / termSource / xem.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-18  |  4.5 KB  |  151 lines

  1. /**
  2.  *
  3.  *   Include file for External Emulator Handling
  4.  *
  5.  **/
  6.  
  7. /*
  8.  *   The structure
  9.  */
  10.  
  11. struct XEM_IO
  12. {
  13.     struct Window    *xem_window;
  14.     struct TextFont    *xem_font;
  15.     APTR         xem_console;
  16.     UBYTE        *xem_string;
  17.     ULONG        *xem_signal;
  18.     UWORD         xem_screendepth;
  19.     UWORD         xem_pad;
  20.  
  21.     ULONG        (*xem_sread)();
  22.     LONG        (*xem_swrite)();
  23.     BOOL        (*xem_sflush)();
  24.     BOOL        (*xem_sbreak)();
  25.     ULONG        (*xem_squery)();
  26.     VOID        (*xem_sstart)();
  27.     BOOL        (*xem_sstop)();
  28.  
  29.     VOID        (*xem_tbeep)();
  30.     LONG        (*xem_tgets)();
  31.     ULONG        (*xem_toptions)();
  32.  
  33.     LONG        (*xem_process_macrokeys)();
  34. };
  35.  
  36.  
  37. /*
  38.  *   The xem_option structure
  39.  */
  40.  
  41. struct xem_option
  42. {
  43.     UBYTE    *xemo_description;    /* description of the option                  */
  44.     ULONG     xemo_type;        /* type of option                             */
  45.     UBYTE    *xemo_value;        /* pointer to a buffer with the current value */
  46.     ULONG     xemo_length;        /* buffer size                                */
  47. };
  48.  
  49. /*
  50.  *   Valid values for xemo_type are:
  51.  */
  52.  
  53. #define XEMO_BOOLEAN 1L         /* xemo_value is "yes", "no", "on" or "off"   */
  54. #define XEMO_LONG    2L         /* xemo_value is string representing a number */
  55. #define XEMO_STRING  3L         /* xemo_value is a string                     */
  56. #define XEMO_HEADER  4L         /* xemo_value is ignored                      */
  57. #define XEMO_COMMAND 5L         /* xemo_value is ignored                      */
  58. #define XEMO_COMMPAR 6L         /* xemo_value contains command parameters     */
  59.  
  60. struct XEmulatorMacroKey
  61. {
  62.     struct MinNode    xmk_Node;
  63.     UWORD        xmk_Qualifier;
  64.     UBYTE        xmk_Type;
  65.     UBYTE        xmk_Code;
  66.     APTR        xmk_UserData;
  67. };
  68.  
  69. /*----- Qualifiers for XMK_QUALIFIER -----*/
  70.  
  71. #define XMKQ_NONE      0
  72. #define XMKQ_SHIFT     1
  73. #define XMKQ_ALTERNATE 2
  74. #define XMKQ_CONTROL   3
  75.  
  76. /*----- Types for XMK_TYPE -----*/
  77.  
  78. #define XMKT_IGNORE 1
  79. #define XMKT_RAWKEY 2
  80. #define XMKT_COOKED 3
  81.  
  82.  
  83. /*----- Types for XEmulatorInfo -----*/
  84.  
  85. #define XEMI_CURSOR_POSITION    1    /* home = 1,1 */
  86. #define XEMI_CONSOLE_DIMENSIONS    2
  87.  
  88. /*----- Macros for XEmulatorInfo -----*/
  89.  
  90. #define XEMI_EXTRACT_Y_POSITION(result)    (result >> 16)
  91. #define XEMI_EXTRACT_X_POSITION(result)    (result & 0xffff)
  92.  
  93. #define XEMI_EXTRACT_COLUMNS(result)    (result >> 16)
  94. #define XEMI_EXTRACT_LINES(result)    (result & 0xffff)
  95.  
  96. /*----- Modes for XEmulatorPreferences -----*/
  97.  
  98. #define XEM_PREFS_RESET    0    /* Reset to builtin defaults    */
  99. #define XEM_PREFS_LOAD    1    /* Load preferences from file    */
  100. #define XEM_PREFS_SAVE    2    /* Save preferences to file    */
  101.  
  102.  
  103. struct XEmulatorHostData
  104. {
  105.     UBYTE    *Source;
  106.     UBYTE    *Destination;
  107.     BOOL     InESC;        /* INTER-EMULATOR PRIVATE DATA..  DO NOT TOUCH 'EM..!! */
  108.     BOOL     InCSI;        /* INTER-EMULATOR PRIVATE DATA..  DO NOT TOUCH 'EM..!! */
  109. };
  110.  
  111. BOOL    XEmulatorSetup(struct XEM_IO *io);
  112. BOOL    XEmulatorOpenConsole(struct XEM_IO *io);
  113. VOID    XEmulatorCloseConsole(struct XEM_IO *io);
  114. VOID    XEmulatorCleanup(struct XEM_IO *io);
  115. VOID    XEmulatorWrite(struct XEM_IO *io, UBYTE *string, ULONG len);
  116. BOOL    XEmulatorSignal(struct XEM_IO *io, ULONG sig);
  117. ULONG    XEmulatorHostMon(struct XEM_IO *io, struct HostData *hd, ULONG actual);
  118. ULONG    XEmulatorUserMon(struct XEM_IO *io, UBYTE *retstr, ULONG maxlen, struct IntuiMessage *imsg);
  119. BOOL    XEmulatorOptions(struct XEM_IO *io);
  120. BOOL    XEmulatorClearConsole(struct XEM_IO *io);
  121. BOOL    XEmulatorResetConsole(struct XEM_IO *io);
  122. BOOL    XEmulatorResetTextStyles(struct XEM_IO *io);
  123. BOOL    XEmulatorResetCharset(struct XEM_IO *io);
  124. ULONG    XEmulatorGetFreeMacroKeys(struct XEM_IO *io, ULONG qualifier);
  125. BOOL    XEmulatorMacroKeyFilter(struct XEM_IO *io, struct List *keys);
  126. ULONG    XEmulatorInfo(struct XEM_IO *xem_io, ULONG type);
  127. BOOL    XEmulatorPreferences(struct XEM_IO *xem_io, STRPTR fileName, ULONG mode);
  128.  
  129. #ifdef LATTICE
  130.  
  131. /* Pragmas for SAS/Lattice-C V5.0 */
  132.  
  133. #pragma libcall XEmulatorBase XEmulatorSetup 1E 801
  134. #pragma libcall XEmulatorBase XEmulatorOpenConsole 24 801
  135. #pragma libcall XEmulatorBase XEmulatorCloseConsole 2A 801
  136. #pragma libcall XEmulatorBase XEmulatorCleanup 30 801
  137. #pragma libcall XEmulatorBase XEmulatorWrite 36 9803
  138. #pragma libcall XEmulatorBase XEmulatorSignal 3C 802
  139. #pragma libcall XEmulatorBase XEmulatorHostMon 42 9803
  140. #pragma libcall XEmulatorBase XEmulatorUserMon 48 A09804
  141. #pragma libcall XEmulatorBase XEmulatorOptions 4E 801
  142. #pragma libcall XEmulatorBase XEmulatorClearConsole 54 801
  143. #pragma libcall XEmulatorBase XEmulatorResetConsole 5A 801
  144. #pragma libcall XEmulatorBase XEmulatorResetTextStyles 60 801
  145. #pragma libcall XEmulatorBase XEmulatorResetCharset 66 801
  146. #pragma libcall XEmulatorBase XEmulatorGetFreeMacroKeys 6c 802
  147. #pragma libcall XEmulatorBase XEmulatorMacroKeyFilter 72 9802
  148. #pragma libcall XEmulatorBase XEmulatorInfo 78 802
  149. #pragma libcall XEmulatorBase XEmulatorPreferences 7E 9803
  150. #endif
  151.