home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 500-599 / ff589.lza / Term / TermSrc.lha / termData.c < prev    next >
C/C++ Source or Header  |  1991-12-01  |  16KB  |  654 lines

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