home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d534 / term.lha / Term / Source.LZH / termData.c < prev    next >
C/C++ Source or Header  |  1991-07-20  |  15KB  |  617 lines

  1. /* $Revision Header * Header built automatically - do not edit! *************
  2.  *
  3.  *    (C) Copyright 1990 by Olaf 'Olsen' Barthel & MXM
  4.  *
  5.  *    Name .....: TermData.c
  6.  *    Created ..: Monday 21-Jan-91 20:12
  7.  *    Revision .: 0
  8.  *
  9.  *    Date            Author          Comment
  10.  *    =========       ========        ====================
  11.  *    21-Jan-91       Olsen           Created this file!
  12.  *
  13.  * $Revision Header ********************************************************/
  14.  
  15. #include "TermGlobal.h"
  16.  
  17.     /* Libraries. */
  18.  
  19. struct ExecBase        *SysBase;
  20. struct DosLibrary    *DOSBase;
  21.  
  22. struct IntuitionBase    *IntuitionBase;
  23. struct GfxBase        *GfxBase;
  24. struct Library        *GadToolsBase;
  25. struct Library        *DiskfontBase;
  26. struct Device        *TimerBase;
  27. struct Library        *AslBase;
  28. struct RxsLib        *RexxSysBase;
  29. struct Library        *IFFParseBase;
  30. struct Library        *CxBase;
  31. struct Library        *LayersBase;
  32.  
  33.     /* Timer device. */
  34.  
  35. struct timerequest    *TimeRequest;
  36.  
  37.     /* Console device. */
  38.  
  39. struct IOStdReq        *ConsoleRequest;
  40. struct Device        *ConsoleDevice;
  41.  
  42.     /* Screen & Windows. */
  43.  
  44. struct Screen        *Screen;
  45. struct Window        *Window;
  46. struct Window        *StatusWindow;
  47. APTR             OldWindowPtr;
  48.  
  49.     /* Graphics rendering. */
  50.  
  51. struct ViewPort        *VPort;
  52. struct RastPort        *RPort;
  53. struct TextFont        *Topaz;
  54. struct TextFont        *IBM;
  55. struct TextFont        *GFX;
  56. APTR             VisualInfo;
  57.  
  58. UWORD ANSIPens[numDrIPens + 1] =
  59. {
  60.     0,4,4,7,4,6,4,0,7,~0
  61. };
  62.  
  63. UWORD EGAPens[numDrIPens + 1] =
  64. {
  65.     0,8,8,15,8,7,8,0,15,~0
  66. };
  67.  
  68. UWORD AtomicColours[16] =
  69. {
  70.     0x000,
  71.     0xDDD,
  72.     0x000,
  73.     0x000,
  74.     0x000,
  75.     0x000,
  76.     0x000,
  77.     0x000,
  78.     0x000,
  79.     0x000,
  80.     0x000,
  81.     0x000,
  82.     0x000,
  83.     0x000,
  84.     0x000,
  85.     0x000
  86. };
  87.  
  88. UWORD EGAColours[16] =
  89. {
  90.     0x000,    /* Black. */
  91.     0xA00,    /* Dark red. */
  92.     0x0A0,    /* Dark green. */
  93.     0xA60,    /* Dark yellow (orange). */
  94.     0x00A,    /* Dark blue. */
  95.     0xA0A,    /* Dark magenta.*/
  96.     0x0AA,    /* Dark cyan. */
  97.     0xBBB,    /* Light grey. */
  98.     0x666,    /* Dark grey. */
  99.     0xF00,    /* Red. */
  100.     0x0F0,    /* Green. */
  101.     0xFF0,    /* Yellow. */
  102.     0x00F,    /* Blue. */
  103.     0xF0F,    /* Magenta. */
  104.     0x0FF,    /* Cyan. */
  105.     0xFFF    /* White. */
  106. };
  107.  
  108. UWORD ANSIColours[16] =
  109. {
  110.     0x000,    /* Black. */
  111.     0xF00,    /* Red. */
  112.     0x0F0,    /* Green. */
  113.     0xFF0,    /* Yellow. */
  114.     0x00F,    /* Blue. */
  115.     0xF0F,    /* Magenta. */
  116.     0x0FF,    /* Cyan. */
  117.     0xFFF,    /* White. */
  118.  
  119.     0x000,    /* Black. */
  120.     0xF00,    /* Red. */
  121.     0x0F0,    /* Green. */
  122.     0xFF0,    /* Yellow. */
  123.     0x00F,    /* Blue. */
  124.     0xF0F,    /* Magenta. */
  125.     0x0FF,    /* Cyan. */
  126.     0xFFF    /* White. */
  127. };
  128.  
  129. UWORD             DefaultColours[16],BlinkColours[16],StandardColours[16];
  130.  
  131.     /* DOS data. */
  132.  
  133. struct Process        *ThisProcess;
  134. struct Task        *StatusTask;
  135. struct Process        *BufferProcess;
  136. struct Process        *RexxProcess;
  137. struct MsgPort        *TermRexxPort;
  138. struct WBStartup    *WBenchMsg;
  139. struct TermPort        *TermPort;
  140. BPTR             RemoteCurrentDir;
  141.  
  142.     /* Character conversion. */
  143.  
  144. struct InputEvent    *FakeInputEvent;
  145.  
  146.     /* Serial I/O. */
  147.  
  148. struct IOExtSer        *ReadRequest;
  149. struct IOExtSer        *WriteRequest;
  150. struct MsgPort        *ReadPort;
  151. APTR             ReadBuffer;
  152.  
  153.     /* Hotkeys. */
  154.  
  155. struct Hotkeys         Hotkeys;
  156.  
  157. struct NewBroker NewTermBroker =
  158. {
  159.     NB_VERSION,
  160.     "term",
  161.     "term © 1990,91 by MXM",
  162.     "Terminal program",
  163.     0,0,0,NULL,0
  164. };
  165.  
  166.     /* Static default fonts. */
  167.  
  168. struct TextAttr DefaultFont =
  169. {
  170.     (UBYTE *)"topaz.font",
  171.     8,
  172.     FS_NORMAL,
  173.     FPF_ROMFONT
  174. };
  175.  
  176. struct TextAttr IBMFont =
  177. {
  178.     (UBYTE *)"IBM.font",
  179.     8,
  180.     FS_NORMAL,
  181.     FPF_DISKFONT
  182. };
  183.  
  184. struct TextAttr GFXFont =
  185. {
  186.     (UBYTE *)"GFX.font",
  187.     8,
  188.     FS_NORMAL,
  189.     FPF_DISKFONT
  190. };
  191.  
  192.     /* Audio data. */
  193.  
  194. UBYTE AnyChannel[4] =
  195. {
  196.     LEFT0F,
  197.     LEFT1F,
  198.     RIGHT0F,
  199.     RIGHT1F,
  200. };
  201.  
  202. UBYTE __chip SineWave[8] =
  203. {
  204.     90,
  205.     127,
  206.     90,
  207.     0,
  208.     -90,
  209.     -127,
  210.     -90,
  211.     0
  212. };
  213.  
  214. struct IOAudio    *AudioBlock;
  215.  
  216.     /* Character lookup tables. */
  217.  
  218. BYTE ValidTab[256] =
  219. {
  220.     0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,
  221.     0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,
  222.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  223.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  224.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  225.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  226.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  227.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  228.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  229.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  230.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  231.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  232.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  233.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  234.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  235.     1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
  236. };
  237.  
  238.     /* IBM <-> Amiga/DEC font conversion. */
  239.  
  240. UBYTE IBMConversion[256] =
  241. {
  242.     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x00,0x00,
  243.     0x00,0x11,0x00,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1B,0x00,0x00,0x00,0x00,
  244.     0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  245.     0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  246.     0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
  247.     0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
  248.     0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
  249.     0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
  250.     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  251.     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  252.     0x00,0xAD,0x9B,0x9C,0x00,0x9D,0x00,0x15,0x00,0x00,0xA6,0x00,0x00,0x00,0xAE,0x00,
  253.     0xF8,0xF1,0xFD,0x00,0x00,0xE6,0x14,0xF9,0x00,0x00,0xA7,0xAF,0xAC,0xAB,0x00,0xA8,
  254.     0x00,0x00,0x00,0x00,0x8E,0x8F,0x92,0x80,0x00,0x90,0x00,0x00,0x00,0x00,0x00,0x00,
  255.     0x00,0xA5,0x00,0x00,0x00,0x00,0x99,0x00,0x00,0x00,0x00,0x00,0x9A,0x00,0x00,0xE1,
  256.     0x85,0xA0,0x83,0x00,0x84,0x86,0x91,0x87,0x8A,0x82,0x88,0x89,0x8D,0xA1,0x8C,0x00,
  257.     0x00,0xA4,0x95,0xA2,0x93,0x00,0x94,0x00,0x00,0x97,0xA3,0x96,0x81,0x00,0x00,0x98
  258. };
  259.  
  260.     /* Special character treatment. */
  261.  
  262. struct SpecialKey SpecialKeys[SPECIALKEYS] =
  263. {
  264.     BEL,    DoSomeBeep,    /* Ring the bell. */
  265.     XON,    XOn,        /* Flow control - stop output. */
  266.     BKS,    DoBackspace,    /* Erase a character. */
  267.     ENT,    DoLF_FF_VT,    /* Enter key. */
  268.     FFD,    DoFF,        /* Form feed. */
  269.     VTB,    DoLF_FF_VT,    /* Vertical tab (huh?). */
  270.     RET,    DoCR,        /* Return key. */
  271.     TAB,    DoTab,        /* Move to next tab stop. */
  272.     '\16',    DoIgnore,    /* ^N shift in (trapped). */
  273.     '\17',    DoIgnore,    /* ^O shift out (trapped). */
  274.     '\30',    DoCancel,    /* Cancel ESC sequence. */
  275.     '\32',    DoCancel    /* Cancel ESC sequence. */
  276. };
  277.  
  278. UBYTE SpecialMap[256];
  279.  
  280.     /* Shared global string formatting buffer. */
  281.  
  282. UBYTE SharedBuffer[512];
  283.  
  284.     /* Screen pull-down-menu. */
  285.  
  286. struct NewMenu TermMenu[] =
  287. {
  288.     { NM_TITLE, "Project",                 0 , 0, 0, (APTR)0},
  289.     {  NM_ITEM, "Open Preferences...",        "O", 0, 0, (APTR)MEN_OPEN},
  290.     {  NM_ITEM, "Save Preferences",             0 , 0, 0, (APTR)MEN_SAVE},
  291.     {  NM_ITEM, "Save Preferences As...",        "S", 0, 0, (APTR)MEN_SAVEAS},
  292.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  293.     {  NM_ITEM, "Print Screen",            "P", 0, 0, (APTR)MEN_PRINTSCREEN},
  294.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  295.     {  NM_ITEM, "About...",                "?", 0, 0, (APTR)MEN_ABOUT},
  296.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  297.     {  NM_ITEM, "Quit...",                "Q", 0, 0, (APTR)MEN_QUIT},
  298.  
  299.     { NM_TITLE, "Utilities",             0 , 0, 0, (APTR)0},
  300.     {  NM_ITEM, "Set Console Window...",        "W", 0, 0, (APTR)MEN_SETCONSOLE},
  301.     {  NM_ITEM, "Execute AmigaDOS Command...",    "A", 0, 0, (APTR)MEN_DOSCOMMAND},
  302.     {  NM_ITEM, "Execute ARexx Command...",        "R", 0, 0, (APTR)MEN_REXXCOMMAND},
  303.     {  NM_ITEM, "Edit File...",            ".", 0, 0, (APTR)MEN_EDIT},
  304.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  305.     {  NM_ITEM, "Paste Clipboard Contents",        "V", 0, 0, (APTR)MEN_PASTE},
  306.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  307.     {  NM_ITEM, "Packet Window...",            "-", 0, 0, (APTR)MEN_PACKET},
  308.  
  309.     { NM_TITLE, "Capture & Buffer",             0 , 0, 0, (APTR)0},
  310.     {  NM_ITEM, "Clear Buffer",            "K", 0, 0, (APTR)MEN_CLEARBUFFER},
  311.     {  NM_ITEM, "Display Buffer...",        "B", 0, 0, (APTR)MEN_DISPLAYBUFFER},
  312.     {  NM_ITEM, "Close Buffer",            "J", 0, 0, (APTR)MEN_CLOSEBUFFER},
  313.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  314.     {  NM_ITEM, "Load Buffer...",            "(", 0, 0, (APTR)MEN_LOADBUFFER},
  315.     {  NM_ITEM, "Save Buffer...",            ")", 0, 0, (APTR)MEN_SAVEBUFFER},
  316.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  317.     {  NM_ITEM, "Capture To Disk...",        "[", CHECKIT|MENUTOGGLE, 0, (APTR)MEN_CAPTUREDISK},
  318.     {  NM_ITEM, "Capture To Printer",        "]", CHECKIT|MENUTOGGLE, 0, (APTR)MEN_CAPTUREPRINTER},
  319.  
  320.     { NM_TITLE, "Transfer",                 0 , 0, 0, (APTR)0},
  321.     {  NM_ITEM, "Upload Text...",            "T", 0, 0, (APTR)MEN_UPLOADTEXT},
  322.     {  NM_ITEM, "Download Text...",            "G", 0, 0, (APTR)MEN_DOWNLOADTEXT},
  323.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  324.     {  NM_ITEM, "Send ASCII...",            ">", 0, 0, (APTR)MEN_SEND},
  325.     {  NM_ITEM, "Receive ASCII...",            "<", 0, 0, (APTR)MEN_RECEIVE},
  326.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  327.     {  NM_ITEM, "Upload Files(s)...",        "U", 0, 0, (APTR)MEN_UPLOAD},
  328.     {  NM_ITEM, "Download File(s)...",        "D", 0, 0, (APTR)MEN_DOWNLOAD},
  329.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  330.     {  NM_ITEM, "Transfer Options...",        "7", 0, 0, (APTR)MEN_XFERPROTOCOL},
  331.     {  NM_ITEM, "Select Transfer Protocol...",    "8", 0, 0, (APTR)MEN_SELECTXFER},
  332.  
  333.     { NM_TITLE, "Modem",                 0 , 0, 0, (APTR)0},
  334.     {  NM_ITEM, "Phonebook...",            "F", 0, 0, (APTR)MEN_PHONEBOOK},
  335.     {  NM_ITEM, "Dial...",                "L", 0, 0, (APTR)MEN_DIAL},
  336.     {  NM_ITEM, "Redial...",            "E", 0, 0, (APTR)MEN_REDIAL},
  337.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  338.     {  NM_ITEM, "Play Number...",            "!", 0, 0, (APTR)MEN_PLAY},
  339.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  340.     {  NM_ITEM, "Send Break",            "X", 0, 0, (APTR)MEN_SENDBREAK},
  341.     {  NM_ITEM, "Hang Up",                "H", 0, 0, (APTR)MEN_HANGUP},
  342.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  343.     {  NM_ITEM, "Release Serial Device...",        "Z", 0, 0, (APTR)MEN_RELEASE},
  344.  
  345.     { NM_TITLE, "Display",                 0 , 0, 0, (APTR)0},
  346.     {  NM_ITEM, "Reset Styles",            "Y", 0, 0, (APTR)MEN_RESETSTYLES},
  347.     {  NM_ITEM, "Clear Screen",            "C", 0, 0, (APTR)MEN_CLEARSCREEN},
  348.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  349.     {  NM_ITEM, "Save Screen (IFF-ILBM)...",     0 , 0, 0, (APTR)MEN_SAVEILBM},
  350.     {  NM_ITEM, "Save Screen (ASCII)...",         0 , 0, 0, (APTR)MEN_SAVEASCII},
  351.  
  352.     { NM_TITLE, "Preferences",             0 , 0, 0, (APTR)0},
  353.     {  NM_ITEM, "Serial...",            "1", 0, 0, (APTR)MEN_SERIAL},
  354.     {  NM_ITEM, "Modem...",                "2", 0, 0, (APTR)MEN_MODEM},
  355.     {  NM_ITEM, "Screen...",            "3", 0, 0, (APTR)MEN_SCREEN},
  356.     {  NM_ITEM, "Terminal...",            "4", 0, 0, (APTR)MEN_TERMINAL},
  357.     {  NM_ITEM, "Startup...",            "5", 0, 0, (APTR)MEN_STARTUP},
  358.     {  NM_ITEM, "Paths...",                "6", 0, 0, (APTR)MEN_PATH},
  359.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  360.     {  NM_ITEM, "Macros...",            "M", 0, 0, (APTR)MEN_MACROS},
  361.     {  NM_ITEM, "Hotkeys...",            "+", 0, 0, (APTR)MEN_HOTKEYS},
  362.     {  NM_ITEM, "Speech...",            "*", 0, 0, (APTR)MEN_SPEECH},
  363.     {  NM_ITEM, NM_BARLABEL,             0 , 0, 0, (APTR)0},
  364.     {  NM_ITEM, "Emulation...",            "9", 0, 0, (APTR)MEN_EMULATION},
  365.     {   NM_END, 0,                     0 , 0, 0, (APTR)0},
  366. };
  367.  
  368. struct Menu        *Menu;
  369.  
  370.     /* Pointer. */
  371.  
  372. USHORT __chip Stopwatch[(2 + 16) * 2] =
  373. {
  374.     0x0000,0x0000,
  375.  
  376.     0x0400,0x07C0,
  377.     0x0000,0x07C0,
  378.     0x0100,0x0380,
  379.     0x0000,0x07E0,
  380.     0x07C0,0x1FF8,
  381.     0x1FF0,0x3FEC,
  382.     0x3FF8,0x7FDE,
  383.     0x3FF8,0x7FBE,
  384.     0x7FFC,0xFF7F,
  385.     0x7EFC,0xFFFF,
  386.     0x7FFC,0xFFFF,
  387.     0x3FF8,0x7FFE,
  388.     0x3FF8,0x7FFE,
  389.     0x1FF0,0x3FFC,
  390.     0x07C0,0x1FF8,
  391.     0x0000,0x07E0,
  392.  
  393.     0x0000,0x0000
  394. };
  395.  
  396.     /* Configuration. */
  397.  
  398. struct Configuration     Config;
  399. struct Configuration     PrivateConfig;
  400. struct SpeechConfig     SpeechConfig;
  401. BYTE             Status;
  402. BYTE             Online;
  403. UWORD             PublicModes;
  404.  
  405. UBYTE             LastConfig[256];
  406. UBYTE             DefaultPubScreen[MAXPUBSCREENNAME];
  407.  
  408.     /* These are the sixteen more or less different display modes the
  409.      * term main and buffer display screens will be opened in.
  410.      */
  411.  
  412. ULONG ModeID[16] =
  413. {
  414.     DEFAULT_MONITOR_ID|HIRES_KEY,
  415.     DEFAULT_MONITOR_ID|HIRESLACE_KEY,
  416.     DEFAULT_MONITOR_ID|SUPER_KEY,
  417.     DEFAULT_MONITOR_ID|SUPERLACE_KEY,
  418.     DEFAULT_MONITOR_ID|VGAPRODUCT_KEY,
  419.     DEFAULT_MONITOR_ID|VGAPRODUCTLACE_KEY,
  420.  
  421.     PAL_MONITOR_ID|HIRES_KEY,
  422.     PAL_MONITOR_ID|HIRESLACE_KEY,
  423.     PAL_MONITOR_ID|SUPER_KEY,
  424.     PAL_MONITOR_ID|SUPERLACE_KEY,
  425.  
  426.     NTSC_MONITOR_ID|HIRES_KEY,
  427.     NTSC_MONITOR_ID|HIRESLACE_KEY,
  428.     NTSC_MONITOR_ID|SUPER_KEY,
  429.     NTSC_MONITOR_ID|SUPERLACE_KEY,
  430.  
  431.     A2024TENHERTZ_KEY,
  432.     A2024FIFTEENHERTZ_KEY
  433. };
  434.  
  435.     /* Capture file. */
  436.  
  437. BPTR             FileCapture;
  438. BPTR             PrinterCapture;
  439. UBYTE             CaptureName[256];
  440.  
  441.     /* Buffer. */
  442.  
  443. UBYTE            **BufferLines;
  444. LONG             Lines;
  445. struct SignalSemaphore    *BufferSemaphore;
  446. LONG             MaxLines = 100;
  447. LONG             BufferSpace;
  448.  
  449.     /* Phonebook. */
  450.  
  451. struct PhoneEntry    **Phonebook;
  452. LONG             PhoneSize;
  453.  
  454. LONG             NumPhoneEntries;
  455.  
  456. UBYTE             LastPhone[256];
  457. UBYTE             LastKeys[256];
  458. UBYTE             LastMacros[256];
  459. UBYTE             LastSpeech[256];
  460.  
  461. struct MacroKeys    *MacroKeys;
  462.  
  463. struct List         EmptyList;
  464.  
  465.     /* Console stuff. */
  466.  
  467. UWORD             LastLine,LastColumn;
  468. BYTE             Charset,Attributes,FgPen,BgPen;
  469. SHORT             CursorX,CursorY,Top,Bottom;
  470. BYTE             UseRegion,InSequence,Quiet;
  471. BYTE             TabStops[1024];
  472.  
  473. struct CursorData     CursorBackup;
  474.  
  475. BYTE             ResetDisplay = FALSE,Escape = FALSE;
  476.  
  477.     /* Flow filter. */
  478.  
  479. UBYTE            *AttentionBuffers[7],AttentionCount[7],FlowCount;
  480. BYTE             BaudPending,FullCheck;
  481. UBYTE             BaudBuffer[20],BaudCount;
  482.  
  483. struct FlowInfo         FlowInfo;
  484.  
  485.     /* Transfer data. */
  486.  
  487. LONG             FileCount,FileCountMax;
  488. struct WBArg        *FileArg;
  489. BYTE             MultipleFiles,FileMatch,BinaryTransfer;
  490. struct AnchorPath    *FileAnchor;
  491. LONG             TransferBits;
  492.  
  493. struct Window        *TransferWindow;
  494. struct Menu        *TransferMenu;
  495.  
  496. struct Library        *XProtocolBase;
  497. struct XPR_IO        *XprIO;
  498.  
  499. UBYTE             ProtocolOptsBuffer[256];
  500. BYTE             NewLibrary,NewOptions;
  501. UBYTE             LastXprLibrary[60];
  502. BYTE             UsesZModem;
  503.  
  504.     /* Pay per minute. */
  505.  
  506. LONG             CurrentPay;
  507. LONG             PayPerUnit[2];
  508. LONG             SecPerUnit[2];
  509. LONG             TimeOfDay[2];
  510. SHORT             PreferredTime;
  511. UBYTE             Password[40];
  512.  
  513.     /* Execute a command/script. */
  514.  
  515. UBYTE             WindowName[256];
  516.  
  517.     /* Rexx server info. */
  518.  
  519. BYTE             WeAreBlocking;
  520.  
  521.     /* "Sub" Dial panel. */
  522.  
  523. struct List        *SubList;
  524. LONG             SubItemNum;
  525. struct Window        *SubWindow;
  526. LONG             SubListNum;
  527.  
  528. BYTE             SendStartup;
  529.  
  530.     /* TermMain data. */
  531.  
  532. BYTE             ReleaseSerial;
  533. BYTE             ResetSerial;
  534. BYTE             BatchMode;
  535.  
  536.     /* Upload/Download paths. */
  537.  
  538. UBYTE             LastDownload[256];
  539. UBYTE             LastUpload[256];
  540.  
  541.     /* String gadgets hooks. */
  542.  
  543. struct Hook         CommandHook;
  544. BYTE             DontActivate;
  545. UBYTE             CommandWorkBuffer[256];
  546.  
  547. struct StringExtend CommandExtend =
  548. {
  549.     (struct TextFont *)NULL,
  550.     1,0,
  551.     1,0,
  552.     SGM_NOFILTER,
  553.     &CommandHook,
  554.     CommandWorkBuffer
  555. };
  556.  
  557. struct Window        *CommandWindow;
  558. struct Gadget        *CommandGadget;
  559. struct Gadget        *ActiveGadget;
  560.  
  561.     /* Packet window. */
  562.  
  563. struct Window        *PacketWindow;
  564. struct Gadget        *PacketGadgetArray[1];
  565. struct Menu        *PacketMenu;
  566. struct Gadget        *PacketGadgetList;
  567. struct List         PacketHistoryList;
  568.  
  569.     /* Some more colour control flags. */
  570.  
  571. BYTE             Initializing,LoadColours;
  572.  
  573.     /* The character raster. */
  574.  
  575. UBYTE            *Raster;
  576. SHORT             RasterWidth,RasterHeight;
  577.  
  578.     /* File download tracking. */
  579.  
  580. struct SignalSemaphore    *DownloadSemaphore;
  581. struct List         DownloadList;
  582. LONG             DownloadLineCount;
  583. struct Node        *DownloadNode;
  584.  
  585.     /* Rexx scanning sequences. */
  586.  
  587. struct List         SequenceList;
  588. LONG             SequenceCount;
  589.  
  590.     /* File version test. */
  591.  
  592. ULONG VersionProps[2] =
  593. {
  594.     'TERM',
  595.     'VERS'
  596. };
  597.  
  598.     /* Cause a rexx command to terminate without waiting. */
  599.  
  600. BYTE             ExitQuietly;
  601.  
  602.     /* The ARexx output window. */
  603.  
  604. struct Window        *RexxWindow;
  605.  
  606.     /* Window stack. */
  607.  
  608. struct Window        *TopWindow;
  609.  
  610. struct Window        *WindowStack[5];
  611. SHORT             WindowStackPtr;
  612.  
  613.     /* Global term ID. */
  614.  
  615. LONG             TermID;
  616. UBYTE             TermIDString[20];
  617.