Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

595 lines
21 KiB

  1. /* File: D:\WACKER\emu\emu.hh (Created: 08-Dec-1993)
  2. *
  3. * Copyright 1994-2001 by Hilgraeve Inc. -- Monroe, MI
  4. * All rights reserved
  5. *
  6. * $Revision: 13 $
  7. * $Date: 7/26/01 1:44p $
  8. */
  9. typedef struct stEmuInternal *HHEMU;
  10. // Maximum column definitions.
  11. // They're one more than zero base maximums. Lines won't
  12. // wrap until next char is displayed.
  13. //
  14. #define VT_MAXCOL_80MODE 79
  15. #define VT_MAXCOL_132MODE 131
  16. // Define terminal modes using ANSI terminology.
  17. //
  18. #define SET TRUE
  19. #define RESET FALSE
  20. // Character constants.
  21. //
  22. #define SOH 001
  23. #define STX 002
  24. #define ETX 003
  25. #define EOT 004
  26. #define ENQ 005
  27. #define ACK 006
  28. #define BELL 007
  29. #define BS 010
  30. #define LF 012
  31. #define FF 014
  32. #define RET 015
  33. #define DLE 020
  34. #define DC3 023
  35. #define NAK 025
  36. #define CAN 030
  37. #define ESC 033
  38. #define DEL 177
  39. #define IND 204
  40. #define SS3 217
  41. #define CSI 233
  42. // Definitions for double high, double wide character processing.
  43. //
  44. #define NO_LINE_ATTR 0
  45. #define DBL_WIDE_HI 1
  46. #define DBL_WIDE_LO 2
  47. #define DBL_WIDE_SINGLE_HEIGHT 3
  48. #define MAX_STATE 35 /* Maximum states in FSA */
  49. #define MAX_TRANSITION 200 /* Maximum state-to-state transitions */
  50. #define MAX_NUM_PARAM 10 /* Max # numeric parameters in one cmd */
  51. #define MAX_SELECTOR 10 /* Max # selectors in one terminal command */
  52. #define NEW_STATE 255 /* Special marker to indicate new state */
  53. #define CLEAR_CURSOR_TO_SCREEN_END 0
  54. #define CLEAR_SCREEN_START_TO_CURSOR 1
  55. #define CLEAR_ENTIRE_SCREEN 2
  56. #define CLEAR_CURSOR_TO_LINE_END 0
  57. #define CLEAR_LINE_START_TO_CURSOR 1
  58. #define CLEAR_ENTIRE_LINE 2
  59. #define CLEAR_TAB_AT_CURSOR 0
  60. #define CLEAR_TABS_IN_LINE 3
  61. #define CS_STATE 0
  62. #define CSCLEAR_STATE 1
  63. #define EMU_BLANK_LINE (-1)
  64. #define EMU_BLANK_CHAR TEXT('\x20')
  65. // Key table definitions.
  66. //
  67. #define VK_BACKSPACE (VK_BACK | VIRTUAL_KEY)
  68. #define DELETE_KEY (VK_DELETE | VIRTUAL_KEY)
  69. #define DELETE_KEY_EXT (VK_DELETE | VIRTUAL_KEY | EXTENDED_KEY)
  70. /* -------------- Key Table Transalation ------------- */
  71. typedef struct
  72. {
  73. int key;
  74. int fPointer; // TRUE means we use the CHAR * portion of the union.
  75. int uLen; // length of stored keystring.
  76. union
  77. {
  78. TCHAR achKeyStr[sizeof(LPTSTR)]; // want real chars here.
  79. TCHAR *pachKeyStr; // want real chars here.
  80. } u;
  81. } KEY;
  82. typedef KEY * PSTKEY;
  83. typedef struct
  84. {
  85. int iMaxKeys;
  86. PSTKEY pstKeys;
  87. } KEYTABLE;
  88. typedef KEYTABLE * PSTKEYTABLE;
  89. typedef struct KeyTblStorage
  90. {
  91. int KeyCode;
  92. TCHAR achKeyStr[15];
  93. } KEYTBLSTORAGE;
  94. typedef struct emuNameTable
  95. {
  96. TCHAR acName[EMU_MAX_NAMELEN];
  97. int nEmuId;
  98. } STEMUNAMETABLE;
  99. typedef STEMUNAMETABLE * PSTEMUNAMETABLE;
  100. /* Define the Finite State Automaton (FSA) which parses commands.
  101. * There is an array of states which points into an array of transitions
  102. * from that state.
  103. */
  104. struct state_entry
  105. {
  106. struct trans_entry *first_trans; /* Pointer into transition array */
  107. int number_trans; /* Number of paths out of state */
  108. };
  109. struct trans_entry
  110. {
  111. int next_state; /* Next state after match */
  112. ECHAR lochar, hichar; /* Match range of input chars */
  113. void (*funct_ptr)(const HHEMU hhEmu); /* Pointer to function */
  114. };
  115. // The internal Emulator Handle
  116. //
  117. struct stEmuInternal
  118. {
  119. CRITICAL_SECTION csEmu; // Used to synchronize access
  120. void *pvPrivate;
  121. HSESSION hSession; // Session hdl that created this.
  122. HPRINT hPrintEcho, // Print hdl for Printer Echo.
  123. hPrintHost; // Print hdl for Host directed printing.
  124. TCHAR acAnswerback[21];
  125. PSTEMUNAMETABLE pstNameTable;
  126. int nEmuLoaded, // Identifies the emulator that is
  127. // currently loaded. Use in emuLoad
  128. // to determine if requested emulator
  129. // is already loaded.
  130. iCurType, // cursor type
  131. fWasConnected; // used with auto attempts
  132. STEMUSET stUserSettings; // Contains all the settings made by the
  133. // user. They are initilaized from values
  134. // stored in the session file.
  135. // Variables for state table processing.
  136. //
  137. struct state_entry state_tbl[MAX_STATE];
  138. struct trans_entry trans_tbl[MAX_TRANSITION];
  139. int state, /* State table state */
  140. num_param[MAX_NUM_PARAM], /* Numeric valued parameters */
  141. num_param_cnt, /* Number of parameters */
  142. selector[MAX_SELECTOR], /* (Hex) option selectors */
  143. selector_cnt; /* Number of selectors */
  144. ECHAR emu_code, /* current character to process */
  145. emu_highchar; /* highest CHAR to bypass state table */
  146. // Keyboard processing tables and variables.
  147. //
  148. KEYTABLE stEmuKeyTbl, /* the dreaded keytable */
  149. stEmuKeyTbl2, /* modal keytable */
  150. stEmuKeyTbl3, /* modal keytable */
  151. stEmuKeyTbl4, /* modal keytable */
  152. stEmuKeyTbl5; /* modal keytable */
  153. // Character attribute state information.
  154. //
  155. int iCurAttrState;
  156. STATTR attrState[2];
  157. // Virtual image variables
  158. //
  159. int emu_maxrow, /* maximum virtual row of emulator */
  160. emu_maxcol, /* maximum virtual column of emualtor */
  161. emu_currow, /* emulator's cursor row */
  162. emu_curcol, /* emulator's cursor column */
  163. emu_imgtop, /* line in image array of screen row 0 */
  164. emu_imgrow, /* line in image array of cursor */
  165. top_margin,
  166. bottom_margin,
  167. scr_scrollcnt; /* Keeps track of screen scrolls */
  168. // Is the loaded emulator DBCS Enabled
  169. int fDBCSSupported; /* Emulator is DBCS Enabled True\False. */
  170. // JFH:2/22/95 TCHAR dspchar[256]; /* Character display map */
  171. ECHAR dspchar[256]; /* Character display map */
  172. int tab_stop[MAX_EMUCOLS + 1],
  173. print_echo;
  174. // Pointers to text, attribute and end of line arrays.
  175. //
  176. ECHAR *(*emu_apText);
  177. PSTATTR *emu_apAttr;
  178. int *emu_aiEnd;
  179. // Character attribute variables.
  180. //
  181. STATTR emu_clearattr, /* current CHAR attribute for clearing */
  182. emu_clearattr_sav, /* Used for HA/Win - mrw */
  183. emu_charattr; /* current physical character attribute */
  184. // Emulator mode variables
  185. //
  186. int mode_KAM, /* Keyboard Action Mode. RESET=enabled */
  187. mode_IRM, /* Insertion-Replacement. RESET=replace chars */
  188. mode_VEM, /* Vertical Editing. RESET=ins/del lines below cursor */
  189. mode_HEM, /* Horizontal Editing. RESET=ins/del chars after cursor */
  190. mode_SRM, /* Send-Receive. RESET=local character echo */
  191. mode_AWM, /* AutoWrap (not ANSI). RESET=wrap to next line */
  192. mode_LNM, /* Line feed New line. RESET=LF moves vertically only */
  193. mode_DECCKM, /* cursor key codes. RESET=cursor, SET=application */
  194. mode_DECKPAM, /* keypad key codeas. RESET=numeric, SET=application */
  195. mode_DECOM, /* DEC origin mode. RESET=cursor posn screen relative */
  196. mode_DECCOLM, /* DEC column mode. RESET=80 column display */
  197. mode_DECPFF, /* Print form feed. RESET=OFF */
  198. mode_DECPEX, /* Print extent. RESET=scroll rgn., SET=full screen */
  199. mode_DECSCNM, /* Screen mode. RESET=normal video, SET=reverse video */
  200. mode_DECTCEM, /* Cursor enable. RESET=hidden, SET=visible */
  201. mode_25enab, /* When true (SET), emulator can use 25th line */
  202. mode_protect, /* When true (SET), protected mode is on */
  203. mode_block, /* When true (SET), block mode is on */
  204. mode_local, /* When true (SET), local mode is on */
  205. mode_vt220,
  206. mode_vt280, /* Acts as a Kanji/Katakana terminal */
  207. mode_vt320,
  208. fUse8BitCodes, // Applies to the VT220/320 emulators.
  209. fAllowUserKeys, // Ditto.
  210. #if defined(INCL_PRINT_PASSTHROUGH)
  211. fPrintRaw,
  212. #endif // INCL_PRINT_PASSTHROUGH
  213. iZmodemState; // This variable is used by all of the emulators
  214. // for processing AutoStart Zmodem codes.
  215. int DEC_private; // Set when '?' is part of sequence
  216. // Function pointer definitions. These pointers get assigned to
  217. // emulator functions during the loading and initialization of a
  218. // specific emulator...emuLoad().
  219. //
  220. #if defined(EXTENDED_FEATURES)
  221. int (*emu_datain) (const HHEMU hhEmu, const ECHAR ccode);
  222. #else
  223. int (*emu_datain) (const HEMU hEmu, const ECHAR ccode);
  224. #endif
  225. int (*emu_kbdin) (const HHEMU hhEmu, int kcode, const int fTest);
  226. int (*emu_getscrollcnt) (const HHEMU hhEmu);
  227. int (*EmuScreenMode) (const HHEMU hhEmu, int d);
  228. int (*emuResetTerminal) (const HHEMU hhEmu, int n);
  229. void (*emu_graphic) (const HHEMU hhEmu);
  230. void (*emu_setcolors) (const HHEMU hhEmu, int fore, int back);
  231. void (*emu_getcolors) (const HHEMU hhEmu, int *fore, int *back);
  232. void (*emu_initcolors) (const HHEMU hhEmu);
  233. void (*emu_getscrsize) (const HHEMU hhEmu, int *rows, int *cols);
  234. #ifdef INCL_TERMINAL_SIZE_AND_COLORS
  235. void (*emu_setscrsize) (const HHEMU hhEmu); // Added 10 Jun 98 rde
  236. #endif
  237. void (*emu_getcurpos) (const HHEMU hhEmu, int *row, int *col);
  238. void (*emu_setcurpos) (const HHEMU hhEmu, int row, int col);
  239. void (*emu_clearscreen) (const HHEMU hhEmu, int selector);
  240. void (*emu_clearline) (const HHEMU hhEmu, int selector);
  241. void (*emu_setattr) (const HHEMU hhEmu, PSTATTR pstAttr);
  242. void (*emu_scroll) (const HHEMU hhEmu, int nlines, BOOL direction);
  243. void (*emu_deinstall) (const HHEMU hhEmu);
  244. void (*EmuSetCursorType)(const HHEMU hhEmu, int iCurType);
  245. void (*emu_ntfy) (const HHEMU hhEmu, const int nNtfy);
  246. void (*emu_clearrgn) (const HHEMU hhEmu,
  247. int toprow,
  248. int leftcol,
  249. int botmrow,
  250. int rightcol);
  251. ECHAR (*EmuGetPrnChar) (const HHEMU hhEmu, ECHAR uch);
  252. STATTR (*emu_getattr) (const HHEMU hhEmu);
  253. int (*emuHomeHostCursor)(const HHEMU hhEmu);
  254. };
  255. // These are a group of settings saved in the session file as a block. Later
  256. // settings were added to the session file individually rather than in a
  257. // structure. Do not add or remove any items from this structure!! rde 8 Jun 1998
  258. struct stEmuBaseSFSettings
  259. {
  260. int nEmuId, // 100 = EMU_AUTO
  261. // 101 = EMU_ANSI
  262. // 102 = EMU_MINI
  263. // 109 = EMU_VIEW
  264. // 110 = EMU_TTY
  265. // 111 = EMU_VT100
  266. // 112 = EMU_VT220
  267. // 113 = EMU_VT320
  268. // 115 = EMU_VT52
  269. // 116 = EMU_VT100J
  270. // 117 = EMU_ANSIW
  271. // 118 = EMU_VT100PLUS
  272. // 119 = EMU_VTUTF8
  273. //
  274. nTermKeys, // 0 = EMU_KEYS_ACCEL
  275. // 1 = EMU_KEYS_TERM
  276. // 2 = EMU_KEYS_SCAN
  277. //
  278. nCursorType, // 1 = EMU_CURSOR_BLOCK
  279. // 2 = EMU_CURSOR_LINE
  280. // 3 = EMU_CURSOR_NONE
  281. //
  282. nCharacterSet, // 0 = EMU_CHARSET_ASCII
  283. // 1 = EMU_CHARSET_UK
  284. // 2 = EMU_CHARSET_SPECIAL
  285. //
  286. nAutoAttempts, // Count of connections using the Auto
  287. // Detect Emulator. At
  288. // EMU_MAX_AUTODETECT_ATTEMPTS, we switch
  289. // to Ansi emulation. Note, this may
  290. // get moved into a Statictics Handle
  291. // if we ever develop one.
  292. //
  293. fCursorBlink, // Blinking cursor. True\False.
  294. fMapPFkeys, // PF1-PF4 to top row of keypad.True\False.
  295. fAltKeypadMode, // Alternate keypad mode. True\False.
  296. fKeypadAppMode, // Keypad application mode. True\False.
  297. fCursorKeypadMode, // Cursor keypad mode. True\Fales.
  298. fReverseDelBk, // Reverse Del and Backsp. True\False.
  299. f132Columns, // 132 column display. True\False.
  300. fDestructiveBk, // Destructive backspace. True\False.
  301. fWrapLines, // Wrap lines. True\False.
  302. fLbSymbolOnEnter, // Send # symbol on Enter. True\False.
  303. // Note: The following two variables were added for the VT220/320. rde:24 Jan 98
  304. fUse8BitCodes, // 8-bit control codes True\False.
  305. fAllowUserKeys; // User defined keys allowed True\False.
  306. // Note: The following two variables are only used if the "Include
  307. // User Defined Backspace and Telnet Terminal Id" feature is enabled.
  308. // There is no compile switch here because this entire structure gets
  309. // written to the session file in one large chunk. Using a compile
  310. // switch could potentially cause version problems later on down
  311. // the road. - cab:11/15/96
  312. //
  313. int nBackspaceKeys; // 1 = EMU_BKSPKEYS_CTRLH
  314. // 2 = EMU_BKSPKEYS_DEL
  315. // 3 = EMU_BKSPKEYS_CTRLHSPACE
  316. TCHAR acTelnetId[EMU_MAX_TELNETID]; // Telnet terminal ID
  317. };
  318. // This macro returns the virtual image row of the supplied row number. That is,
  319. // what appears as row 10 on the terminal image may actually be row 5 in the
  320. // virtual image.
  321. //
  322. #define row_index(h, r) (((r) + h->emu_imgtop + MAX_EMUROWS) % (MAX_EMUROWS))
  323. // The emualtor image is an array of characters. emu_aiEnd is an array that
  324. // contains the column number of the rightmost character in a given row.
  325. // This macro returns the a number representing the length of the image for
  326. // the supplied row, from location 0 to the rightmost column. It
  327. // simplifies accessing a row of the emulator as though it were a string.
  328. // Remember, the emualtor matrix is zero based, and EMU_BALNK_LINE indicates
  329. // that there are no characters in the row.
  330. //
  331. #define emuRowLen(h, r) ((h->emu_aiEnd[r] == EMU_BLANK_LINE) ? 0 : h->emu_aiEnd[r] + 1)
  332. // from emu_std.c
  333. //
  334. int std_kbdin(const HHEMU hhEmu, int kcode, const int fTest);
  335. int std_getscrollcnt(const HHEMU hhEmu);
  336. void std_getscrsize(const HHEMU hhEmu, int *rows, int *cols);
  337. #ifdef INCL_TERMINAL_SIZE_AND_COLORS
  338. void std_setscrsize(const HHEMU hhEmu);
  339. #endif
  340. void std_getcurpos(const HHEMU hhEmu, int *row, int *col);
  341. void std_setcurpos(const HHEMU hhEmu, const int iRow, const int iCol);
  342. STATTR std_getattr(const HHEMU hhEmu);
  343. void std_setattr(const HHEMU hhEmu, PSTATTR pstAttr);
  344. void std_setcolors(const HHEMU hhEmu, const int fore, const int back);
  345. void std_getcolors(const HHEMU hhEmu, int *fore, int *back);
  346. void std_initcolors(const HHEMU hhEmu);
  347. void std_restorescreen(const HHEMU hhEmu);
  348. void std_clearscreen(const HHEMU hhEmu, const int nClearSelect);
  349. void std_clearline(const HHEMU hhEmu, const int nClearSelect);
  350. void std_clearrgn(const HHEMU hhEmu, int toprow, int leftcol, int botmrow, int rightcol);
  351. void EmuStdSetCursorType(const HHEMU hhEmu, int iCurType);
  352. void EmuChkChar(const HHEMU hhEmu);
  353. void EmuStdChkZmdm(const HHEMU hhEmu);
  354. void std_dsptbl(const HHEMU hhEmu, int bit8);
  355. void std_scroll(const HHEMU hhEmu, const INT nlines, const BOOL direction);
  356. void std_deinstall(const HHEMU hhEmu);
  357. void vt_dsptbl(const HHEMU hhEmu, ECHAR left, ECHAR right);
  358. void vt_setdtbl(const HHEMU hhEmu, ECHAR tbl[], ECHAR cset);
  359. int stdResetTerminal(const HHEMU hhEmu, const int);
  360. void std_emu_ntfy(const HHEMU hhEmu, const int nNtfy);
  361. int std_HomeHostCursor(const HHEMU hhEmu);
  362. // from emu_scr.c
  363. //
  364. void backspace(const HHEMU hhEmu);
  365. void carriagereturn(const HHEMU hhEmu);
  366. void emuLineFeed(const HHEMU hhEmu);
  367. void emuPrintChars(const HHEMU hhEmu, ECHAR *bufr, int nLen);
  368. void scrolldown(const HHEMU hhEmu, int nlines);
  369. void scrollup(const HHEMU hhEmu, int nlines);
  370. void tab(const HHEMU hhEmu);
  371. void backtab(const HHEMU hhEmu);
  372. void tabn(const HHEMU hhEmu);
  373. void emu_bell(const HHEMU hhEmu);
  374. void emu_clearword(const HHEMU hhEmu, int fromcol, int tocol);
  375. void clear_imgrow(const HHEMU hhEmu, int iRow);
  376. // From autoinit.c
  377. //
  378. void emuAutoInit(const HHEMU hhEmu);
  379. // From emu_ansi.c
  380. //
  381. void ANSI_CBT(const HHEMU hhEmu);
  382. void ANSI_CNL(const HHEMU hhEmu, int nlines);
  383. void ANSI_CUB(const HHEMU hhEmu);
  384. void ANSI_CUD(const HHEMU hhEmu);
  385. void ANSI_CUF(const HHEMU hhEmu);
  386. void ANSI_CUP(const HHEMU hhEmu);
  387. void ANSI_CUU(const HHEMU hhEmu);
  388. void ANSI_DL(const HHEMU hhEmu);
  389. void ANSI_ED(const HHEMU hhEmu);
  390. void ANSI_EL(const HHEMU hhEmu);
  391. void ANSI_DCH(const HHEMU hhEmu);
  392. void AnsiFormFeed(const HHEMU hhEmu);
  393. void ANSI_HTS(const HHEMU hhEmu);
  394. void ANSI_ICH(const HHEMU hhEmu);
  395. void ANSI_IL(const HHEMU hhEmu);
  396. void ANSI_IND(const HHEMU hhEmu);
  397. void ANSI_NEL(const HHEMU hhEmu);
  398. void ANSI_Pn(const HHEMU hhEmu);
  399. void ANSI_Pn_Clr(const HHEMU hhEmu);
  400. void ANSI_Pn_End(const HHEMU hhEmu);
  401. void ANSI_RI(const HHEMU hhEmu);
  402. void ANSI_RIS(const HHEMU hhEmu);
  403. void ANSI_SGR(const HHEMU hhEmu);
  404. void ANSI_TBC(const HHEMU hhEmu);
  405. // From emu.c
  406. //
  407. void nothing(const HHEMU hhEmu);
  408. void char_pn(const HHEMU hhEmu);
  409. void commanderror(const HHEMU hhEmu);
  410. void emuStdGraphic(const HHEMU hhEmu);
  411. int emuCreateTextAttrBufs(const HEMU hEmu, const size_t nRows, size_t nCols);
  412. void emuDestroyTextAttrBufs(const HEMU hEmu);
  413. void emu_cleartabs(const HHEMU hhEmu, int selector);
  414. void emu_reverse_image(const HHEMU hhEmu);
  415. int emu_is25lines(const HHEMU hhEmu);
  416. int emuKbdKeyLookup(const HHEMU hhEmu, const int key, const PSTKEYTABLE pstKeyTbl);
  417. void emuInstallStateTable(const HHEMU hhEmu, struct trans_entry const *, int iSize);
  418. //int emuKeyTableLoad(const HHEMU hhEmu, const int nTableId, PSTKEYTABLE const pstKeyTbl);
  419. int emuKeyTableLoad(const HHEMU hhEmu, const KEYTBLSTORAGE pstKeySource[], const int nNumKeys, PSTKEYTABLE const pstKeyTbl);
  420. int emu_kbdlocked(const HHEMU hhEmu, int key, const int fTest);
  421. void emuSendKeyString(const HHEMU hhEmu, const int index, const PSTKEYTABLE pstKeyTbl);
  422. void emuSendString(const HHEMU hhEmu, ECHAR *str, int strln);
  423. void emuKeyTableFree(PSTKEYTABLE const pstKeyTbl);
  424. int emuSetEmuName(const HEMU hEmu, const int nEmuId);
  425. void emuAutoDetectLoad(const HHEMU hhEmu, const int nEmuID);
  426. // From vt_xtra.c
  427. //
  428. void emuSetDecColumns(const HHEMU hhEmu, const int nColumns, const int fClear);
  429. void ANSI_DSR(const HHEMU hhEmu);
  430. void vt_scrollrgn(const HHEMU hhEmu);
  431. void ANSI_RM(const HHEMU hhEmu);
  432. void ANSI_SM(const HHEMU hhEmu);
  433. void vt_alt_kpmode(const HHEMU hhEmu);
  434. void vt_screen_adjust(const HHEMU hhEmu);
  435. void DEC_STBM(const HHEMU hhEmu, int top, int bottom);
  436. void vt52_toANSI(const HHEMU hhEmu);
  437. void vt_DCH(const HHEMU hhEmu);
  438. void vt_IL(const HHEMU hhEmu);
  439. void vt_DL(const HHEMU hhEmu);
  440. void vt_clearline(const HHEMU hhEmu, const int nSelect);
  441. void vt_clearscreen(const HHEMU hhEmu, const int nSelect);
  442. void vt_backspace(const HHEMU hhEmu);
  443. void vt_CUB(const HHEMU hhEmu);
  444. int DEC_HHC(const HHEMU hhEmu);
  445. // From ansi.c
  446. //
  447. void ansi_setmode(const HHEMU hhEmu);
  448. void ansi_resetmode(const HHEMU hhEmu);
  449. int ansi_kbdin(const HHEMU hhEmu, int key, const int fTest);
  450. void ansi_savecursor(const HHEMU hhEmu);
  451. void DoorwayMode(const HHEMU hhEmu);
  452. void emuAnsiUnload(const HHEMU hhEmu);
  453. // From ansiinit.c
  454. //
  455. int emuAnsiReset(const HHEMU hhEmu, const int fHostRequest);
  456. void emuAnsiInit(const HHEMU hhEmu);
  457. void csrv_init(const HHEMU hhEmu, const int new_emu);
  458. // From vt100.c
  459. //
  460. int vt100_kbdin(const HHEMU hhEmu, int key, const int fTest);
  461. void ANSI_DA(const HHEMU hhEmu);
  462. void vt100_savecursor(const HHEMU hhEmu);
  463. void vt100_hostreset(const HHEMU hhEmu);
  464. int vt100_reset(const HHEMU hhEmu, const int host_request);
  465. int fakevt_kbdin(const HHEMU hhEmu, int key, const int fTest);
  466. void vt100_prnc(const HHEMU hhEmu);
  467. void vt100PrintCommands(const HHEMU hhEmu);
  468. void vt100_answerback(const HHEMU hhEmu);
  469. void vt100_report(const HHEMU hhEmu);
  470. void emuDecGraphic(const HHEMU hhEmu);
  471. void emuSetDoubleAttr(const HHEMU hhEmu);
  472. void emuSetSingleAttrRow(const HHEMU hhEmu);
  473. void emuSetDoubleAttrRow(const HHEMU hhEmu, const int iLineAttr);
  474. void emuFromDblToSingle(const HHEMU hhEmu);
  475. void emuDecTab(const HHEMU hhEmu);
  476. void emuDecCUF(const HHEMU hhEmu);
  477. void emuDecCUP(const HHEMU hhEmu);
  478. void emuDecCUB(const HHEMU hhEmu);
  479. void emuDecED(const HHEMU hhEmu);
  480. void emuVT100Unload(const HHEMU hhEmu);
  481. void emuDecIND(const HHEMU hhEmu);
  482. void emuDecRI(const HHEMU hhEmu);
  483. void emuDecCUU(const HHEMU hhEmu);
  484. void emuDecCUD(const HHEMU hhEmu);
  485. void emuDecSetCurPos(const HHEMU hhEmu, const int iRow, const int iCol);
  486. void emuDecClearScreen(const HHEMU hhEmu, const int iSelector);
  487. // From vt100ini.c
  488. //
  489. void vt100_init(const HHEMU hhEmu);
  490. // From vt_chars.c
  491. //
  492. void vt_charset_init(const HHEMU hhEmu);
  493. void vt_charset_save(const HHEMU hhEmu);
  494. void vt_charset_restore(const HHEMU hhEmu);
  495. void vt_charshift(const HHEMU hhEmu);
  496. void vt_scs1(const HHEMU hhEmu);
  497. void vt_scs2(const HHEMU hhEmu);
  498. #if defined(EXTENDED_FEATURES)
  499. int vt_char_emulatecmd(const HHEMU hhEmu, const ECHAR ccode);
  500. #else
  501. int vt_char_emulatecmd(const HEMU hEmu, const ECHAR ccode);
  502. #endif
  503. // From vt52.c
  504. //
  505. void vt52PrintCommands(const HHEMU hhEmu);
  506. void vt52Print(const HHEMU hhEmu);
  507. void vt52_id(const HHEMU hhEmu);
  508. void vt52_CUP(const HHEMU hhEmu);
  509. int vt52_kbdin(const HHEMU hhEmu, int key, const BOOL fTest);
  510. void emuVT52Unload(const HHEMU hhEmu);
  511. // From vt52init.c
  512. //
  513. void vt52_init(const HHEMU hhEmu);
  514. // From emuhdl.c
  515. int emuCreateNameTable(const HHEMU hhEmu);
  516. int emuStdDataIn(const HHEMU hhEmu, const ECHAR ccode);
  517. // From vtutf8ini.c
  518. //
  519. void vtutf8_init(const HHEMU hhEmu);
  520. int vtUTF8_kbdin(const HHEMU hhEmu, int key, const int fTest);
  521. void vtUTF8FirstDataByte(const HHEMU hhEmu);
  522. void vtUTF8MiddleDataByte(const HHEMU hhEmu);
  523. void vtUTF8LastDataByte(const HHEMU hhEmu);
  524. void emuVTUTF8Unload(const HHEMU hhEmu);