home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / telecomm / terms / term-4.1-source.lha / Extras / Source / term-Source.lha / termGlobal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-26  |  36.6 KB  |  1,474 lines

  1. /*
  2. **    termGlobal.h
  3. **
  4. **    Global data structure definitions
  5. **
  6. **    Copyright © 1990-1994 by Olaf `Olsen' Barthel
  7. **        All Rights Reserved
  8. */
  9.  
  10.     /* Jump table entry. */
  11.  
  12. typedef BYTE (*  JUMP)(UBYTE Char);
  13.  
  14.     /* Pointer to function returning nothing. */
  15.  
  16. typedef VOID (* VPTR)();
  17.  
  18.     /* Capture output routine. */
  19.  
  20. typedef VOID (* __regargs COPTR)(register APTR Data,register LONG Size);
  21.  
  22.     /* Menu item codes. */
  23.  
  24. enum    {    MEN_SAVE_AS_PICTURE=1,MEN_SAVE_AS_TEXT,MEN_PRINT_SCREEN,MEN_PRINT_CLIP,MEN_CAPTURE_TO_FILE,
  25.         MEN_CAPTURE_TO_PRINTER,MEN_ICONIFY,MEN_ABOUT,MEN_QUIT,
  26.  
  27.         MEN_COPY,MEN_PASTE,MEN_CLEAR,
  28.  
  29.         MEN_EXECUTE_DOS_COMMAND,MEN_EXECUTE_REXX_COMMAND,MEN_RECORD,MEN_RECORD_LINE,
  30.         MEN_EDIT_TRAPS,MEN_DISABLE_TRAPS,
  31.  
  32.         MEN_PHONEBOOK,MEN_REDIAL,MEN_DIAL_NUMBER,MEN_SEND_BREAK,
  33.         MEN_HANG_UP,MEN_WAIT,MEN_FLUSH_BUFFER,MEN_RELEASE_DEVICE,
  34.  
  35.         MEN_UPLOAD_ASCII,MEN_DOWNLOAD_ASCII,MEN_UPLOAD_TEXT,MEN_DOWNLOAD_TEXT,MEN_EDIT_AND_UPLOAD_TEXT,
  36.         MEN_UPLOAD_BINARY,MEN_DOWNLOAD_BINARY,
  37.  
  38.         MEN_CLEAR_BUFFER,MEN_DISPLAY_BUFFER,MEN_CLOSE_BUFFER,MEN_FREEZE_BUFFER,MEN_OPEN_BUFFER,
  39.         MEN_SAVE_BUFFER_AS,
  40.  
  41.         MEN_CLEAR_SCREEN,MEN_RESET_FONT,MEN_RESET_STYLES,MEN_RESET_TERMINAL,
  42.  
  43.         MEN_SERIAL,MEN_MODEM,MEN_SCREEN,MEN_TERMINAL,MEN_SET_EMULATION,MEN_CLIPBOARD,MEN_CAPTURE,MEN_COMMANDS,
  44.         MEN_MISC,MEN_PATH,MEN_TRANSFER_PROTOCOL,MEN_TRANSFER,MEN_TRANSLATION,MEN_MACROS,
  45.         MEN_CURSORKEYS,MEN_FAST_MACROS,MEN_HOTKEYS,MEN_SPEECH,MEN_SOUND,MEN_RATES,MEN_SET_CONSOLE,MEN_OPEN_SETTINGS,MEN_SAVE_SETTINGS,
  46.         MEN_SAVE_SETTINGS_AS,
  47.  
  48.         MEN_STATUS_WINDOW,MEN_REVIEW_WINDOW,MEN_PACKET_WINDOW,MEN_FAST_MACROS_WINDOW,
  49.         MEN_UPLOAD_QUEUE_WINDOW,
  50.  
  51.         // Avoid recompilation
  52.  
  53.         MEN_PRINT_SCREEN_AS_GFX
  54.     };
  55.  
  56.     /* Menu item code limit, required by the quick dial menu. */
  57.  
  58. #define DIAL_MENU_LIMIT 1000
  59.  
  60.     /* How many phone book entries will be stored in
  61.      * the quick dial menu.
  62.      */
  63.  
  64. #define DIAL_MENU_MAX    50
  65.  
  66.     /* Undefine the following symbols, the preferences header file
  67.      * will use the same names and the same values.
  68.      */
  69.  
  70. #undef PARITY_NONE
  71. #undef PARITY_EVEN
  72. #undef PARITY_ODD
  73. #undef PARITY_MARK
  74. #undef PARITY_SPACE
  75.  
  76.     /* Serial settings. */
  77.  
  78. enum    {    PARITY_NONE,PARITY_EVEN,PARITY_ODD,PARITY_MARK,PARITY_SPACE };
  79.  
  80. enum    {    HANDSHAKING_NONE,HANDSHAKING_RTSCTS,HANDSHAKING_RTSCTS_DSR };
  81. enum    {    DUPLEX_FULL,DUPLEX_HALF };
  82. enum    {    FLOW_NONE,FLOW_XON_XOFF };
  83.  
  84.     /* Terminal settings. */
  85.  
  86. enum    {    EOL_IGNORE,EOL_CR,EOL_LF,EOL_CRLF,EOL_LFCR };
  87. enum    {    EMULATION_ANSIVT100,EMULATION_ATOMIC,EMULATION_TTY,EMULATION_EXTERNAL,EMULATION_HEX };
  88. enum    {    COLOUR_AMIGA,COLOUR_EIGHT,COLOUR_SIXTEEN,COLOUR_MONO };
  89.  
  90.     /* Protocol types. */
  91.  
  92. enum    {    PROTOCOL_XMODEM,PROTOCOL_XMODEMCRC,PROTOCOL_YMODEM,PROTOCOL_ZMODEM };
  93.  
  94.     /* Font types. */
  95.  
  96. enum    {    FONT_STANDARD,FONT_IBM,FONT_IBM_RAW };
  97.  
  98.     /* Bell modes. */
  99.  
  100. enum    {    BELL_NONE, BELL_VISIBLE, BELL_AUDIBLE, BELL_BOTH, BELL_SYSTEM };
  101.  
  102.     /* Data flow scanner indices. */
  103.  
  104. enum    {    SCAN_NOCARRIER, SCAN_ZMODEM, SCAN_CONNECT, SCAN_VOICE, SCAN_RING, SCAN_BUSY, SCAN_NODIALTONE,
  105.         SCAN_OK, SCAN_ERROR, SCAN_COUNT };
  106.  
  107.     /* Status types. */
  108.  
  109. enum    {    STATUS_READY,STATUS_HOLDING,STATUS_DIALING,STATUS_UPLOAD,
  110.         STATUS_DOWNLOAD,STATUS_BREAKING,STATUS_HANGUP,
  111.         STATUS_RECORDING,STATUS_RECORDING_LINE
  112.     };
  113.  
  114.     /* Sound types. */
  115.  
  116. enum    {    SOUND_BELL,SOUND_CONNECT,SOUND_DISCONNECT,SOUND_GOODTRANSFER,
  117.         SOUND_BADTRANSFER,SOUND_RING,SOUND_VOICE,SOUND_COUNT };
  118.  
  119.     /* Settings types. */
  120.  
  121. enum    {    PREF_ALL,PREF_SERIAL,PREF_MODEM,PREF_COMMAND,PREF_SCREEN,
  122.         PREF_TERMINAL,PREF_PATH,PREF_MISC,PREF_CLIP,PREF_CAPTURE,
  123.         PREF_FILE,PREF_EMULATION,PREF_TRANSFER };
  124.  
  125.     /* Status line modes. */
  126.  
  127. enum    {    STATUSLINE_DISABLED,STATUSLINE_STANDARD,STATUSLINE_COMPRESSED };
  128.  
  129.     /* Capture filter modes. */
  130.  
  131. enum    {    FILTER_NONE,FILTER_ESCAPE,FILTER_CONTROL,FILTER_BOTH };
  132.  
  133.     /* Scrolling modes. */
  134.  
  135. enum    {    SCROLL_JUMP,SCROLL_SMOOTH };
  136.  
  137.     /* Auto-capture file creation. */
  138.  
  139. enum    {    AUTOCAPTURE_DATE_NAME,AUTOCAPTURE_DATE_INCLUDE };
  140.  
  141.     /* Cursor and numeric keypad modes. */
  142.  
  143. enum    {    KEYMODE_STANDARD,KEYMODE_APPLICATION };
  144.  
  145.     /* Font scales. */
  146.  
  147. enum    {    SCALE_NORMAL,SCALE_HALF };
  148. enum    {    SCALE_ATTR_NORMAL,SCALE_ATTR_TOP2X,SCALE_ATTR_BOT2X,SCALE_ATTR_2X };
  149.  
  150.     /* Character tables. */
  151.  
  152. enum    {    TABLE_ASCII,TABLE_GFX };
  153.  
  154.     /* Transfer types. */
  155.  
  156. enum    {    TRANSFER_BINARY,TRANSFER_TEXT,TRANSFER_ASCII };
  157.  
  158.     /* Translation table entry types. */
  159.  
  160. enum    {    TRANSLATE_SINGLE,TRANSLATE_STRING };
  161.  
  162.     /* Upload panel actions. */
  163.  
  164. enum    {    UPLOAD_TEXT=1,UPLOAD_BINARY,UPLOAD_IGNORE,UPLOAD_ABORT,
  165.         UPLOAD_TEXT_FROM_LIST,UPLOAD_BINARY_FROM_LIST,UPLOAD_DUMMY
  166.     };
  167.  
  168.     /* Alert types. */
  169.  
  170. enum    {    ALERT_NONE,ALERT_BEEP,ALERT_SCREEN,ALERT_BEEP_SCREEN };
  171.  
  172.     /* Online time display modes. */
  173.  
  174. enum    {    ONLINETIME_TIME,ONLINETIME_COST,ONLINETIME_BOTH };
  175.  
  176.     /* Clipboard read errors. */
  177.  
  178. enum    {    CLIPERR_NONE,CLIPERR_NOTEXT,CLIPERR_IFF,CLIPERR_OPEN,CLIPERR_MEM };
  179.  
  180.     /* What to print. */
  181.  
  182. enum    {    PRINT_SCREEN,PRINT_CLIP };
  183.  
  184.     /* Dial command types. */
  185.  
  186. enum    {    DIAL_IGNORE,DIAL_LIST,DIAL_REDIAL };
  187.  
  188.     /* Errors returned by ReconfigureSerial(). */
  189.  
  190. enum    {    RECONFIGURE_FAILURE,RECONFIGURE_NOCHANGE,RECONFIGURE_SUCCESS };
  191.  
  192.     /* Operation codes for SetItem(). */
  193.  
  194. enum    {    SETITEM_SETCHECK,SETITEM_CLRCHECK,SETITEM_ON,SETITEM_OFF };
  195.  
  196.     /* File identification actions. */
  197.  
  198. enum    {    IDENTIFY_IGNORE,IDENTIFY_FILETYPE,IDENTIFY_SOURCE };
  199.  
  200.     /* Generic list types. */
  201.  
  202. enum    {    GLIST_UPLOAD,GLIST_DOWNLOAD,GLIST_DIAL,GLIST_WAIT,GLIST_TRAP,GLIST_COUNT };
  203.  
  204.     /* Generic list add operations. */
  205.  
  206. enum    {    ADD_GLIST_BOTTOM,ADD_GLIST_TOP,ADD_GLIST_BEHIND,ADD_GLIST_BEFORE };
  207.  
  208.     /* Transfer window gadgets. */
  209.  
  210. enum    {    GAD_TRANSFER_INFORMATION_LIST=1,
  211.         GAD_TRANSFER_PERCENT,GAD_TRANSFER_TIME,
  212.         GAD_TRANSFER_ABORT,GAD_TRANSFER_SKIP,
  213.         GAD_TRANSFER_PROTOCOL,GAD_TRANSFER_FILE,
  214.         GAD_TRANSFER_SIZE,GAD_TRANSFER_SECONDS,
  215.         GAD_TRANSFER_TOTALTIME,GAD_TRANSFER_ERRORS,
  216.         GAD_TRANSFER_ABORT_FILE
  217.     };
  218.  
  219.     /* XPR options setting. */
  220.  
  221. enum    {    GAD_XPROPTIONS_USE=42,GAD_XPROPTIONS_CANCEL };
  222.  
  223.     /* AmigaGuide help context. */
  224.  
  225. enum    {    CONTEXT_MAIN,CONTEXT_SERIAL,CONTEXT_MODEM,CONTEXT_SCREEN,
  226.         CONTEXT_TERMINAL,CONTEXT_CLIP,CONTEXT_CAPTURE,CONTEXT_COMMAND,
  227.         CONTEXT_MISC,CONTEXT_PATHS,CONTEXT_TRANSLATION,CONTEXT_MACROS,
  228.         CONTEXT_CURSOR,CONTEXT_FASTMACROS,CONTEXT_HOTKEYS,CONTEXT_SPEECH,
  229.         CONTEXT_EMULATION,CONTEXT_TRANSFER,CONTEXT_PHONEBOOK,CONTEXT_DATE,
  230.         CONTEXT_DAY,CONTEXT_IMPORT,CONTEXT_RATES,CONTEXT_TIME,
  231.         CONTEXT_COPY,CONTEXT_PASSWORDUSER,CONTEXT_DIAL,CONTEXT_PRINT,
  232.         CONTEXT_TEXTBUFFER,CONTEXT_PACKETWINDOW,CONTEXT_SOUND,
  233.         CONTEXT_LIBS,CONTEXT_ASCII,CONTEXT_PENS,CONTEXT_UPLOAD_QUEUE,
  234.         CONTEXT_TRAPS,CONTEXT_AREA_CODES,CONTEXT_MAIN_MENU,
  235.         CONTEXT_BUFFER_MENU,CONTEXT_PACKET_MENU,CONTEXT_PROJECT_MEN,
  236.         CONTEXT_EDIT_MEN,CONTEXT_CMDS_MEN,CONTEXT_PHONE_MEN,
  237.         CONTEXT_TRANSF_MEN,CONTEXT_BUFFER_MEN,CONTEXT_TERMINAL_MEN,
  238.         CONTEXT_SETTINGS_MEN,CONTEXT_WINDOWS_MEN,CONTEXT_DIAL_MEN
  239.  
  240.     };
  241.  
  242.     /* Character types. */
  243.  
  244. enum    {    CHAR_VANILLA,CHAR_CURSOR,CHAR_FUNCTION,CHAR_HELP,
  245.         CHAR_XON,CHAR_XOFF,CHAR_ENTER,CHAR_RETURN };
  246.  
  247.     /* Review window positioning codes. */
  248.  
  249. enum    {    REVIEW_MOVE_TOP,REVIEW_MOVE_BOTTOM,REVIEW_MOVE_UP,REVIEW_MOVE_DOWN };
  250.  
  251.     /* File type classes. */
  252.  
  253. enum    {    FILETYPE_NONE,FILETYPE_DIR,FILETYPE_FILE,FILETYPE_TEXT,FILETYPE_SOUND,
  254.         FILETYPE_PICTURE,FILETYPE_PREFS,FILETYPE_ARCHIVE,
  255.         FILETYPE_PROGRAM,
  256.  
  257.         FILETYPE_COUNT };
  258.  
  259.     /* Text pacing modes. */
  260.  
  261. enum    {    PACE_DIRECT,PACE_ECHO,PACE_ANYECHO,PACE_PROMPT,PACE_DELAY,PACE_KEYBOARD };
  262.  
  263.     /* Where to open the buffer text window. */
  264.  
  265. enum    {    BUFFER_TOP,BUFFER_END };
  266.  
  267.     /* Where to place the buffer screen horizontally. */
  268.  
  269. enum    {    SCREEN_LEFT,SCREEN_CENTRE,SCREEN_RIGHT };
  270.  
  271.     /* Some raw key codes. */
  272.  
  273. #define HELP_CODE        95
  274. #define RAMIGA_CODE        103
  275.  
  276. #define CURSOR_UP_CODE        76
  277. #define CURSOR_DOWN_CODE    77
  278. #define CURSOR_RIGHT_CODE    78
  279. #define CURSOR_LEFT_CODE    79
  280.  
  281. #define F01_CODE        80
  282. #define F02_CODE        81
  283. #define F03_CODE        82
  284. #define F04_CODE        83
  285. #define F05_CODE        84
  286. #define F06_CODE        85
  287. #define F07_CODE        86
  288. #define F08_CODE        87
  289. #define F09_CODE        88
  290. #define F10_CODE        89
  291.  
  292.     /* A couple of useful minterms. */
  293.  
  294. #define MINTERM_ZERO        0
  295. #define MINTERM_ONE        ABC | ABNC | ANBC | ANBNC | NABC | NABNC | NANBC | NANBNC
  296. #define MINTERM_COPY        ABC | ABNC | NABC | NABNC
  297. #define MINTERM_NOT_C        ABNC | ANBNC | NABNC | NANBNC
  298. #define MINTERM_B_AND_C        ABC | NABC
  299. #define MINTERM_NOT_B_AND_C    ANBC | NANBC
  300. #define MINTERM_B_OR_C        ABC | ABNC | NABC | NABNC | ANBC | NANBC
  301.  
  302.     /* Printer control bits. */
  303.  
  304. #define PRINT_SERIAL    (1L << 0)
  305. #define PRINT_MODEM    (1L << 1)
  306. #define PRINT_SCREEN    (1L << 2)
  307. #define PRINT_TERMINAL    (1L << 3)
  308. #define PRINT_USERNAME    (1L << 4)
  309. #define PRINT_COMMENT    (1L << 5)
  310. #define PRINT_SIZE    (1L << 6)
  311. #define PRINT_DATE    (1L << 7)
  312. #define PRINT_BITS    (1L << 8)
  313.  
  314.     /* Day of week flags. */
  315.  
  316. #define DAY_MONDAY    (1L << 0)
  317. #define DAY_TUESDAY    (1L << 1)
  318. #define DAY_WEDNESDAY    (1L << 2)
  319. #define DAY_THURSDAY    (1L << 3)
  320. #define DAY_FRIDAY    (1L << 4)
  321. #define DAY_SATURDAY    (1L << 5)
  322. #define DAY_SUNDAY    (1L << 6)
  323.  
  324.     /* These signal masks will make life a bit easier. */
  325.  
  326. #define SIG_WINDOW    (1L << Window -> UserPort -> mp_SigBit)
  327. #define SIG_SERIAL    (ReadPort ? 1L << ReadPort -> mp_SigBit : NULL)
  328. #define SIG_TIMER    (1L << TimePort -> mp_SigBit)
  329. #define SIG_QUEUE    (SpecialQueue -> SigMask)
  330. #define SIG_CHECK    (1L << CheckBit)
  331. #define SIG_WORKBENCH    (1L << WorkbenchPort -> mp_SigBit)
  332. #define SIG_REXX    (1L << TermRexxPort -> mp_SigBit)
  333.  
  334.     /* Task termination and handshake signal. Note: don't try this at
  335.      * home kids, we are all trained professionals here!
  336.      */
  337.  
  338. #define SIG_KILL    SIGBREAKF_CTRL_C
  339. #define SIG_HANDSHAKE    SIGF_SINGLE
  340.  
  341.     /* Double-buffered file server command. */
  342.  
  343. #define    SIG_COMMAND    SIGBREAKF_CTRL_D
  344.  
  345.     /* ARexx break signal. */
  346.  
  347. #define SIG_BREAK    SIGBREAKF_CTRL_D
  348.  
  349.     /* Hotkey reset command. */
  350.  
  351. #define SIG_RESET    SIGBREAKF_CTRL_D
  352.  
  353.     /* Skip dial entry. */
  354.  
  355. #define SIG_SKIP    SIGBREAKF_CTRL_D
  356.  
  357.     /* Status commands. */
  358.  
  359. #define SIG_BELL    SIGBREAKF_CTRL_D
  360. #define SIG_RESETTIME    SIGBREAKF_CTRL_E
  361.  
  362.     /* Buffer special signals. */
  363.  
  364. #define SIG_TOFRONT    SIGBREAKF_CTRL_D
  365. #define SIG_UPDATE    SIGBREAKF_CTRL_E
  366. #define SIG_MOVEUP    SIGBREAKF_CTRL_F
  367.  
  368.     /* Status display task. */
  369.  
  370. #define SIG_CLOSEWINDOW    SIGBREAKF_CTRL_F
  371.  
  372.     /* Upload queue. */
  373.  
  374. #define SIG_SHOW    SIGBREAKF_CTRL_D
  375. #define SIG_HIDE    SIGBREAKF_CTRL_E
  376. #define SIG_GOAWAY    SIGBREAKF_CTRL_F
  377.  
  378.     /* A port signal mask. */
  379.  
  380. #define PORTMASK(P)    (1L << (((struct MsgPort *)(P)) -> mp_SigBit))
  381.  
  382.     /* Replacements for CheckItem() and OnMenu()/OffMenu(). */
  383.  
  384. #define CheckItem(ID,Mode)    SetItem(ID,Mode ? SETITEM_SETCHECK : SETITEM_CLRCHECK)
  385. #define OnItem(ID)        SetItem(ID,SETITEM_ON)
  386. #define OffItem(ID)        SetItem(ID,SETITEM_OFF)
  387.  
  388.     /* A handy signal macro. */
  389.  
  390. #define ClrSignal(Signals)    SetSignal(0,Signals)
  391.  
  392.     /* Another neat macro. */
  393.  
  394. #define NumElements(s)        (sizeof(s) / sizeof((s)[0]))
  395. #define NEW(t)            t = AllocVecPooled(sizeof(* ## t),MEMF_ANY | MEMF_CLEAR)
  396. #define DISPOSE(x)        { FreeVecPooled(x); x = NULL; }
  397.  
  398.     /* Definitions to access the line signal setting functions supported by
  399.      * some IO serial boards (namely the ASDG board).
  400.      */
  401.  
  402. #define SIOCMD_SETCTRLLINES    (CMD_NONSTD + 7)
  403. #define SIOB_RTSB        0
  404. #define SIOB_DTRB        1
  405. #define SIOB_RTSF        (1L << SIOB_RTSB)
  406. #define SIOB_DTRF        (1L << SIOB_DTRB)
  407.  
  408.     /* Turn time of day into `compressed' format. */
  409.  
  410. #define DT_GET_TIME(Hour,Minute) ((Minute) / 10 + (Hour) * 6)
  411.  
  412.     /* Vector offsets for the TimeDate structure. */
  413.  
  414. enum    { DT_FIRST_UNIT,DT_NEXT_UNIT };
  415.  
  416.     /* Multiply lines and columns with the current font size. */
  417.  
  418. #define MUL_X(x)        OffsetXTable[x]
  419. #define MUL_Y(y)        OffsetYTable[y]
  420.  
  421.     /* A handy and short alias. */
  422.  
  423. #define TICK            (CHECKIT | MENUTOGGLE)
  424.  
  425.     /* For now the maximum length of a path/file name. */
  426.  
  427. #define MAX_FILENAME_LENGTH    256
  428.  
  429.     /* The maximum width of a line to be stored in the text buffer. */
  430.  
  431. #define BUFFER_LINE_MAX        255
  432.  
  433.     /* User interface definitions. */
  434.  
  435. #define SZ_AutoWidth    TAG_USER+2    /* Use default width? */
  436. #define SZ_NewColumn    TAG_USER+4    /* Start new column */
  437. #define SZ_Lines    TAG_USER+5    /* Number of lines in object */
  438.  
  439.     /* Box information types. */
  440.  
  441. enum    {    BOX_LEFT,BOX_TOP,BOX_WIDTH,BOX_HEIGHT };
  442.  
  443.     /* Status gadget properties. */
  444.  
  445. #define SGA_FullWidth    (TAG_USER+42)
  446. #define SGA_Mode    (TAG_USER+43)
  447.  
  448.     /* Sizing gadget sizes. */
  449.  
  450. #define SIZE_GADGET_WIDTH_HIGH    18
  451. #define SIZE_GADGET_WIDTH_LOW    13
  452.  
  453.     /* Some windows to be opened on the main screen. */
  454.  
  455. enum    {    WINDOW_PACKET,WINDOW_STATUS,WINDOW_FILE,
  456.         WINDOW_REVIEW,WINDOW_FAST,WINDOW_FONT,
  457.         WINDOW_SCREEN,WINDOW_PERF,
  458.  
  459.         WINDOW_COUNT };
  460.  
  461.     /* Window alignment information. */
  462.  
  463. #define WC_ALIGNLEFT    (1<<0)
  464. #define WC_ALIGNRIGHT    (1<<1)
  465. #define WC_ALIGNTOP    (1<<2)
  466. #define WC_ALIGNBOTTOM    (1<<3)
  467. #define WC_EXPANDWIDTH    (1<<4)
  468. #define WC_EXPANDHEIGHT    (1<<5)
  469. #define WC_ALIGNSIDE    (1<<6)
  470. #define WC_ALIGNBELOW    (1<<7)
  471.  
  472.     /* Screen mode list entry. */
  473.  
  474. struct ModeNode
  475. {
  476.     struct Node    VanillaNode;
  477.     ULONG        DisplayID;
  478. };
  479.  
  480.     /* Trap management. */
  481.  
  482. struct TrapNode
  483. {
  484.     struct Node    Node;
  485.     LONG        Count,
  486.             SequenceLen;
  487.     STRPTR        Sequence,
  488.             Command;
  489. };
  490.  
  491.     /* Trap preferences, not much. */
  492.  
  493. struct TrapSettings
  494. {
  495.     BYTE        Enabled,
  496.             Pad;
  497. };
  498.  
  499.     /* Window alignment data. */
  500.  
  501. struct WindowInfo
  502. {
  503.     UWORD    ID;
  504.     UWORD    WindowFlags;
  505.  
  506.     LONG    Left,
  507.         Top,
  508.         Width,
  509.         Height;
  510. };
  511.  
  512.     /* Special character treatment. */
  513.  
  514. struct SpecialKey
  515. {
  516.     UBYTE    Key;
  517.     BYTE    (*  Routine)(VOID);
  518. };
  519.  
  520.     /* Cursor backup data. */
  521.  
  522. struct CursorData
  523. {
  524.     struct TextFont        *CurrentFont;
  525.     WORD             CursorX,
  526.                  CursorY;
  527.     BYTE             Charset;
  528.     BYTE             CharMode[2];
  529.     BYTE             Attributes;
  530.     BYTE             FgPen,
  531.                  BgPen;
  532.     UBYTE             Style;
  533. };
  534.  
  535.     /* File transfer information. */
  536.  
  537. struct FileTransferNode
  538. {
  539.     struct MinNode         Node;
  540.     ULONG             Size;
  541.     STRPTR             Name;
  542. };
  543.  
  544. struct FileTransferInfo
  545. {
  546.     struct MinList         FileList;
  547.     ULONG             TotalSize;
  548.     LONG             TotalFiles;
  549.  
  550.     ULONG             DoneSize;
  551.     LONG             DoneFiles;
  552.  
  553.     struct FileTransferNode    *CurrentFile;
  554.     ULONG             CurrentSize;
  555. };
  556.  
  557.     /* Global data link. */
  558.  
  559. struct TermPort
  560. {
  561.     struct MsgPort         ExecNode;
  562.  
  563.     struct Window        *TopWindow;
  564.  
  565.     struct SignalSemaphore     OpenSemaphore;
  566.  
  567.     LONG             ID,OpenCount,HoldIt;
  568.     LONG             Reserved[5];
  569. };
  570.  
  571.     /* Buffer search support. */
  572.  
  573. struct SearchInfo
  574. {
  575.     UBYTE    Distance[256],
  576.         Pattern[256];
  577.     LONG    FoundX,
  578.         FoundY;
  579.     WORD    PatternWidth;
  580.     WORD    Index;
  581.     BOOLEAN    Forward,
  582.         IgnoreCase,
  583.         WholeWords;
  584. };
  585.  
  586. struct SearchContext
  587. {
  588.     struct Window        *SearchWindow;
  589.     struct LayoutHandle    *SearchHandle;
  590.  
  591.     UBYTE             LocalBuffer[256];
  592.     STRPTR             Buffer;
  593.  
  594.     BOOLEAN             Ok;
  595. };
  596.  
  597.     /* Support for optimized scrolling routines. */
  598.  
  599. struct ScrollLineInfo
  600. {
  601.     UWORD             Left,Right,Width,
  602.                  ColourMask;
  603. };
  604.  
  605.     /* A dial list entry. */
  606.  
  607. struct PhoneNode
  608. {
  609.     struct Node         VanillaNode;
  610.  
  611.     UBYTE             LocalName[50];
  612.  
  613.     struct PhoneEntry    *Entry;
  614. };
  615.  
  616.     /* A Fast! macro list entry. */
  617.  
  618. struct MacroNode
  619. {
  620.     struct MacroNode    *mn_Succ;    /* Modeled after the default Node. */
  621.     struct MacroNode    *mn_Pred;
  622.  
  623.     WORD             mn_Pad;    /* Included only for Node compatibility. */
  624.  
  625.     UBYTE            *mn_Macro;    /* = ln_Name, title */
  626.     UBYTE            *mn_Code;    /* The execution code. */
  627. };
  628.  
  629.     /* Speech preferences. */
  630.  
  631. struct SpeechConfig
  632. {
  633.     WORD            Rate,
  634.                 Pitch;
  635.     LONG            Frequency;
  636.     BYTE            Sex,
  637.                 Volume,
  638.                 Enabled,
  639.                 Pad;
  640. };
  641.  
  642.     /* Sound preferences */
  643.  
  644. struct SoundConfig
  645. {
  646.     UBYTE            BellFile[MAX_FILENAME_LENGTH],
  647.  
  648.                 ConnectFile[MAX_FILENAME_LENGTH],
  649.                 DisconnectFile[MAX_FILENAME_LENGTH],
  650.  
  651.                 GoodTransferFile[MAX_FILENAME_LENGTH],
  652.                 BadTransferFile[MAX_FILENAME_LENGTH],
  653.  
  654.                 RingFile[MAX_FILENAME_LENGTH],
  655.                 VoiceFile[MAX_FILENAME_LENGTH];
  656.  
  657.     BYTE            Preload,
  658.                 Pad;
  659.     BYTE            Volume,
  660.                 Pad2;
  661. };
  662.  
  663.     /* Macro Preferences. */
  664.  
  665. struct MacroKeys
  666. {
  667.     UBYTE            Keys[4][10][256];
  668. };
  669.  
  670.     /* Cursor key preferences. */
  671.  
  672. struct CursorKeys
  673. {
  674.     UBYTE            Keys[4][4][256];
  675. };
  676.  
  677.     /* Translation table entry. */
  678.  
  679. struct TranslationEntry
  680. {
  681.     STRPTR            String;        /* Corresponding code string. */
  682.     UBYTE            Type;        /* Table entry type. */
  683.     UBYTE            Len;        /* String length if any. */
  684.     UBYTE            Extra;        /* Saves space, don't need to allocate memory for this one. */
  685.     UBYTE            Null;        /* Terminating null. */
  686. };
  687.  
  688. struct TranslationHeader
  689. {
  690.     UBYTE            Type;        /* Table entry type. */
  691.     UBYTE            Code;        /* Table offset. */
  692.     UBYTE            Len;        /* Entry length. */
  693.     UBYTE            Pad;
  694. };
  695.  
  696.     /* Buffer translation handle. */
  697.  
  698. struct TranslationHandle
  699. {
  700.     STRPTR            LocalBuffer;
  701.     LONG            LocalLen;
  702.  
  703.     STRPTR            SourceBuffer;
  704.     LONG            SourceLen;
  705.  
  706.     STRPTR            DestinationBuffer;
  707.     LONG            DestinationLen;
  708.  
  709.     struct TranslationEntry    **Table;
  710. };
  711.  
  712.     /* term hotkey configuration. */
  713.  
  714. struct HotkeysOld
  715. {
  716.     UBYTE            termScreenToFront[256];
  717.     UBYTE            BufferScreenToFront[256];
  718.     UBYTE            SkipDialEntry[256];
  719.     BYTE            CommodityPriority;
  720.     BYTE            HotkeysEnabled;
  721.  
  722.     ULONG            Reserved[25];
  723. };
  724.  
  725. struct Hotkeys
  726. {
  727.     UBYTE            termScreenToFront[256];
  728.     UBYTE            BufferScreenToFront[256];
  729.     UBYTE            SkipDialEntry[256];
  730.     BYTE            CommodityPriority;
  731.     BYTE            HotkeysEnabled;
  732.  
  733.     ULONG            Reserved[25];
  734.  
  735.     UBYTE            AbortARexx[256];
  736. };
  737.  
  738.     /* Time/date structure. */
  739.  
  740. struct TimeDate
  741. {
  742.     LONG             Count;        /* Table size. */
  743.     WORD             PayPerUnit[2],    /* Pay for each unit. */
  744.                  SecPerUnit[2];    /* Number of seconds each unit lasts. */
  745.     UBYTE             Time,        /* The time associated with this entry. */
  746.                  Pad;
  747. };
  748.  
  749.     /* Time date header information. */
  750.  
  751. struct TimeDateHeader
  752. {
  753.     UBYTE             Comment[22];    /* Comment for this entry. */
  754.  
  755.     BYTE             Month,        /* Month of year or -1 -> Day = bitmapped days of week. */
  756.                  Day;        /* Day of month or -1 -> standard settings. */
  757. };
  758.  
  759. struct TimeDateNode
  760. {
  761.     struct Node         VanillaNode;    /* Default node entry. */
  762.     UBYTE             Buffer[30];    /* Name buffer. */
  763.  
  764.     struct TimeDate        *Table;        /* Table of time/date entries. */
  765.  
  766.     struct TimeDateHeader     Header;    /* Header information. */
  767. };
  768.  
  769. struct TimeNode
  770. {
  771.     struct Node         VanillaNode;    /* Default node entry. */
  772.     UBYTE             Name[20];    /* Name string. */
  773.     UBYTE             Time;        /* The time for this entry. */
  774. };
  775.  
  776.     /* This node type links phone number patterns
  777.      * and date/time lists.
  778.      */
  779.  
  780. struct PatternNode
  781. {
  782.     struct Node        Node;
  783.     UBYTE            Pattern[256],
  784.                     Comment[40];
  785.     struct List        List;
  786. };
  787.  
  788.     /* Serial settings. */
  789.  
  790. struct SerialSettings
  791. {
  792.     ULONG    BaudRate;        /* Baud rate. */
  793.     ULONG    BreakLength;        /* Length of break signal in microseconds. */
  794.     ULONG    SerialBufferSize;    /* Size of serial read/write buffer. */
  795.  
  796.     UBYTE    SerialDevice[MAX_FILENAME_LENGTH];
  797.                     /* Serial device name. */
  798.     LONG    UnitNumber;        /* Serial device unit number. */
  799.  
  800.     BYTE    BitsPerChar;        /* Bits per character. */
  801.     BYTE    Parity;            /* Parity check mode. */
  802.     BYTE    StopBits;        /* Number of stop bits. */
  803.     BYTE    HandshakingProtocol;    /* Handshaking protocol (RTS/CTS, etc.). */
  804.     BYTE    Duplex;            /* Full- or half-duplex? */
  805.  
  806.     BYTE    xONxOFF;        /* xON/xOFF handshaking enabled? */
  807.     BYTE    HighSpeed;        /* Radboogie? */
  808.     BYTE    Shared;            /* Shared device access? */
  809.     BYTE    StripBit8;        /* Strip high-order bit? */
  810.     BYTE    CheckCarrier;        /* Track the carrier signal? */
  811.     BYTE    PassThrough;        /* Pass xON/xOFF characters through to modem? */
  812.     BYTE    UseOwnDevUnit;        /* Enable OwnDevUnit.library? */
  813.  
  814.     ULONG    Quantum;        /* Buffer read quantum. */
  815.  
  816.     BYTE    IgnoreCarrier;        /* Ignore carrier signal. */
  817.  
  818.     BYTE    UseNet;            /* Use DNet-ID. */
  819.     UWORD    NetID;            /* The DNet-ID to use. */
  820. };
  821.  
  822.     /* Modem settings. */
  823.  
  824. struct ModemSettings
  825. {
  826.     UBYTE    ModemInit[80];        /* Modem init string. */
  827.     UBYTE     ModemExit[80];        /* Modem exit string. */
  828.     UBYTE     ModemHangup[80];    /* Modem hangup string. */
  829.     UBYTE    DialPrefix[80];        /* Dial command prefix. */
  830.     UBYTE    DialSuffix[80];        /* Dial command suffix. */
  831.  
  832.     UBYTE    NoCarrier[16];        /* `No carrier' string. */
  833.     UBYTE    NoDialTone[16];        /* `No dialtone' string. */
  834.     UBYTE    Connect[16];        /* `Connect' string. */
  835.     UBYTE    Voice[16];        /* `Voice' string. */
  836.     UBYTE    Ring[16];        /* `Ring' string. */
  837.     UBYTE    Busy[16];        /* `Busy' string. */
  838.  
  839.     LONG    RedialDelay;        /* Length of redial delay. */
  840.     LONG    DialRetries;        /* Number of dial retries. */
  841.     LONG    DialTimeout;        /* Length of dial timeout. */
  842.     BYTE    ConnectAutoBaud;    /* Use baud rate returned by modem? */
  843.     BYTE    DropDTR;        /* Drop the DTR signal on hangup? */
  844.     BYTE    RedialAfterHangup;    /* Redial list after hangup? */
  845.     BYTE    Pad;
  846.  
  847.     UBYTE    Ok[16];            /* `Ok' string. */
  848.     UBYTE    Error[16];        /* `Error' string. */
  849.  
  850.     BYTE    NoCarrierIsBusy;    /* Treat `NO CARRIER' as `BUSY' signal? */
  851.     BYTE    AbortHangsUp;        /* Dialer `Abort' sends hangup string? */
  852.  
  853.     WORD    ConnectLimit;                /* Connection limit. */
  854.     UBYTE    ConnectLimitMacro[MAX_FILENAME_LENGTH];    /* Macro to be executed when limit is reached. */
  855.  
  856.     LONG    TimeToConnect;        /* Number of seconds to pass between modem picking up
  857.                      * the line and issuing the `CONNECT' message.
  858.                      */
  859. };
  860.  
  861.     /* Command settings. */
  862.  
  863. struct CommandSettings
  864. {
  865.     UBYTE    StartupMacro[256];    /* Startup macro. */
  866.     UBYTE    LogoffMacro[256];    /* Macro executed after carrier has dropped or hung up. */
  867.     UBYTE    UploadMacro[256];    /* Macro to execute after a successful upload. */
  868.     UBYTE    DownloadMacro[256];    /* Macro to execute after a successful download. */
  869.  
  870.     UBYTE    LoginMacro[256];    /* Login macro, complements the logoff macro. */
  871. };
  872.  
  873.     /* Screen settings. */
  874.  
  875. struct ScreenSettings
  876. {
  877.     ULONG    DisplayMode;            /* Screen display mode. */
  878.     WORD    ColourMode;            /* The terminal colour mode. */
  879.     UWORD    Colours[16];            /* Colour palette. */
  880.     UBYTE    FontName[MAX_FILENAME_LENGTH];    /* Default user interface font. */
  881.     WORD    FontHeight;            /* Default user interface font height. */
  882.  
  883.     BYTE    MakeScreenPublic;        /* Are we to make our screen public? */
  884.     BYTE    ShanghaiWindows;        /* Are we to `shanghai' windows? */
  885.  
  886.     BYTE    Blinking;            /* Screen blinking enabled? */
  887.     BYTE    FasterLayout;            /* Faster screen layout? */
  888.     BYTE    TitleBar;            /* Is the screen title bar enabled? */
  889.     BYTE    StatusLine;            /* Which mode is the status line in? */
  890.  
  891.     BYTE    UseWorkbench;            /* Use the Workbench screen for the terminal window? */
  892.  
  893.     UBYTE    PubScreenName[MAXPUBSCREENNAME + 1];    /* Name of public screen to open window upon. */
  894.  
  895.     BYTE    TimeMode;            /* Online time/fee display. */
  896.     BYTE    Depth;                /* Screen depth if any, 0 = don't bother. */
  897.  
  898.     BYTE    UsePens;            /* Use special screen pens? */
  899.     BYTE    PenColourMode;            /* For which colour mode was the pen array built? */
  900.  
  901.     UWORD    PenArray[16];            /* Pen index array. */
  902.  
  903.     ULONG    DisplayWidth,            /* Screen width. */
  904.         DisplayHeight;            /* Screen height. */
  905.     UWORD    OverscanType;            /* Screen overscan type. */
  906.  
  907.     BYTE    ShareScreen;            /* Don't open a backdrop window, share pens. */
  908.     BYTE    SplitStatus;            /* Split the status line from the main window. */
  909. };
  910.  
  911.     /* Terminal settings. */
  912.  
  913. struct TerminalSettings
  914. {
  915.     BYTE    BellMode;                /* The bell mode. */
  916.     BYTE    AlertMode;                /* The user alert mode. */
  917.     BYTE    EmulationMode;                /* The terminal emulation mode. */
  918.     BYTE    FontMode;                /* The font mode. */
  919.  
  920.     BYTE    SendCR;                    /* Standard translations. */
  921.     BYTE    SendLF;
  922.     BYTE    ReceiveCR;
  923.     BYTE    ReceiveLF;
  924.  
  925.     UWORD    NumColumns,                /* Size of the terminal window. */
  926.         NumLines;
  927.  
  928.     UBYTE    KeyMapFileName[MAX_FILENAME_LENGTH];    /* Name of custom keymap file. */
  929.     UBYTE    EmulationFileName[MAX_FILENAME_LENGTH];    /* External emulation file name. */
  930.     UBYTE    BeepFileName[MAX_FILENAME_LENGTH];    /* Name of the custom beep sound file. */
  931.  
  932.     UBYTE    TextFontName[MAX_FILENAME_LENGTH];    /* Terminal text font name. */
  933.     WORD    TextFontHeight;                /* Terminal text font height. */
  934.  
  935.     BYTE    UseTerminalTask;            /* Enable the terminal emulation process. */
  936.     BYTE    Pad;
  937.  
  938.     UBYTE    IBMFontName[MAX_FILENAME_LENGTH];    /* Terminal text font name. */
  939.     WORD    IBMFontHeight;                /* Terminal text font height. */
  940. };
  941.  
  942.     /* Path settings. */
  943.  
  944. struct PathSettings
  945. {
  946.     UBYTE    ASCIIUploadPath[MAX_FILENAME_LENGTH];        /* Default ASCII upload file path. */
  947.     UBYTE    ASCIIDownloadPath[MAX_FILENAME_LENGTH];        /* Default ASCII download file path. */
  948.  
  949.     UBYTE    TextUploadPath[MAX_FILENAME_LENGTH];        /* Default text upload file path. */
  950.     UBYTE    TextDownloadPath[MAX_FILENAME_LENGTH];        /* Default text download file path. */
  951.  
  952.     UBYTE    BinaryUploadPath[MAX_FILENAME_LENGTH];        /* Default binary data upload file path. */
  953.     UBYTE    BinaryDownloadPath[MAX_FILENAME_LENGTH];    /* Default binary data download file path. */
  954.  
  955.     UBYTE    DefaultStorage[MAX_FILENAME_LENGTH];        /* Default configuration storage path. */
  956.  
  957.     UBYTE    Editor[MAX_FILENAME_LENGTH];            /* Text file editor to use. */
  958.  
  959.     UBYTE    HelpFile[MAX_FILENAME_LENGTH];            /* Help text file. */
  960. };
  961.  
  962.     /* Miscellaneous settings. */
  963.  
  964. struct MiscSettings
  965. {
  966.     BYTE    Priority;        /* Program priority. */
  967.     BYTE    BackupConfig;        /* Save the configuration between calls? */
  968.  
  969.     BYTE    OpenFastMacroPanel;    /* Open the fast! macro panel? */
  970.     BYTE    ReleaseDevice;        /* Release serial device when iconified? */
  971.  
  972.     BYTE    TransferServer;        /* Enable data transfer server? */
  973.     BYTE    EmulationServer;    /* Enable terminal emulation server? */
  974.  
  975.     BYTE    OverridePath;        /* Override the protocol transfer path? */
  976.     BYTE    AutoUpload;        /* Enable the auto-upload panel? */
  977.     BYTE    SetArchivedBit;        /* Set the archived bit for files sent? */
  978.     BYTE    IdentifyFiles;        /* Try to identify files after download? */
  979.  
  980.     BYTE    TransferIcons;        /* Transfer files along with their icons? */
  981.     BYTE    CreateIcons;        /* Create icons for files saved? */
  982.  
  983.     BYTE    SimpleIO;        /* Use simple file I/O? */
  984.     BYTE    PerfMeter;        /* Transfer performance meter enabled? */
  985.  
  986.     LONG    IOBufferSize;        /* Size of the asynchronous I/O buffer. */
  987.  
  988.     BYTE    HideUploadIcon;        /* Hide the upload queue icon? */
  989.     BYTE    Pad1;
  990. };
  991.  
  992.     /* Clipboard settings. */
  993.  
  994. struct ClipSettings
  995. {
  996.     WORD    ClipboardUnit;        /* Clipboard unit to use. */
  997.  
  998.     WORD    LineDelay,        /* Insert line delay. */
  999.         CharDelay;        /* Insert character delay. */
  1000.  
  1001.     UBYTE    InsertPrefix[80];    /* Line insertion prefix. */
  1002.     UBYTE    InsertSuffix[80];    /* Line insertion suffix. */
  1003.  
  1004.     UBYTE    LinePrompt[256];    /* Line wait prompt. */
  1005.     WORD    SendTimeout;        /* Line send timeout. */
  1006.     UBYTE    PacingMode;        /* Text pacing mode. */
  1007.     BYTE    Pad;
  1008. };
  1009.  
  1010.     /* Capture and logfile settings. */
  1011.  
  1012. struct CaptureSettings
  1013. {
  1014.     BYTE    LogActions;                /* Create logfile? */
  1015.     BYTE    LogCall;                /* Create callinfo-compatible logfile? */
  1016.     UBYTE    LogFileName[MAX_FILENAME_LENGTH];    /* Default logfile name. */
  1017.  
  1018.     LONG    MaxBufferSize;                /* Maximum text buffer size. */
  1019.     BYTE    BufferEnabled;                /* Is the text buffer enabled? */
  1020.  
  1021.     BYTE    ConnectAutoCapture;            /* Open capture file on logon? */
  1022.     BYTE    CaptureFilterMode;            /* The capture filter mode. */
  1023.     UBYTE    CapturePath[MAX_FILENAME_LENGTH];    /* The default path for capture files. */
  1024.  
  1025.     UBYTE    CallLogFileName[MAX_FILENAME_LENGTH];    /* Name of the call log file. */
  1026.     UBYTE    BufferPath[MAX_FILENAME_LENGTH];    /* Text buffer save path. */
  1027.  
  1028.     BYTE    AutoCaptureDate;            /* Where to include the creation date? */
  1029.     UBYTE    SearchHistory;
  1030.  
  1031.     BYTE    OpenBufferWindow;            /* Where to open the buffer window. */
  1032.     BYTE    OpenBufferScreen;            /* Where to open the buffer screen. */
  1033.  
  1034.     BYTE    BufferScreenPosition;            /* Where to place the buffer screen (horizontal) */
  1035.     UBYTE    BufferWidth;                /* How long each line in the buffer should be. */
  1036.  
  1037.     BYTE    RememberBufferWindow;            /* Remember buffer window context? */
  1038.     BYTE    RememberBufferScreen;            /* Remember buffer screen context? */
  1039.  
  1040.     ULONG    BufferScreenMode;            /* Screen display mode for buffer screen. */
  1041. };
  1042.  
  1043.     /* File settings. */
  1044.  
  1045. struct FileSettings
  1046. {
  1047.     UBYTE    ProtocolFileName[MAX_FILENAME_LENGTH];        /* Transfer protocol file name. */
  1048.     UBYTE    TranslationFileName[MAX_FILENAME_LENGTH];    /* Character translation file name. */
  1049.     UBYTE    MacroFileName[MAX_FILENAME_LENGTH];        /* Keyboard macro file name. */
  1050.     UBYTE    CursorFileName[MAX_FILENAME_LENGTH];        /* Cursor key file name. */
  1051.     UBYTE    FastMacroFileName[MAX_FILENAME_LENGTH];        /* Fast macro file name. */
  1052. };
  1053.  
  1054.     /* Emulation settings. */
  1055.  
  1056. struct EmulationSettings
  1057. {
  1058.     BYTE    CursorMode;        /* Are the cursor keys switched to application mode? */
  1059.     BYTE    NumericMode;        /* Is the numeric keypad switched to application mode? */
  1060.  
  1061.     BYTE    CursorWrap;        /* Is cursor position wrapping enabled? */
  1062.     BYTE    LineWrap;        /* Is character line wrapping enabled? */
  1063.  
  1064.     BYTE    InsertMode;        /* Is the character insertion mode enabled? */
  1065.     BYTE    NewLineMode;        /* Is the newline mode enabled? */
  1066.  
  1067.     BYTE    FontScale;        /* Which font scale is enabled? */
  1068.     BYTE    ScrollMode;        /* Is smooth scrolling enabled? */
  1069.     BYTE    DestructiveBackspace;    /* Backspace erases characters? */
  1070.     BYTE    SwapBSDelete;        /* DEL and BS keys are swapped? */
  1071.     BYTE    PrinterEnabled;        /* Printer commands enabled? */
  1072.     BYTE    CLSResetsCursor;    /* Clear screen command resets cursor position? */
  1073.  
  1074.     UBYTE    AnswerBack[80];        /* Answer-back message. */
  1075.  
  1076.     BYTE    KeysLocked;        /* Numeric keypad mode locked? */
  1077.     UBYTE    MaxScroll;        /* Maximum number of lines to prescroll. */
  1078.     UBYTE    MaxJump;        /* Maximum number of lines to scroll in one jump. */
  1079.     BYTE    CursorLocked;        /* Cursor keys locked? */
  1080.     BYTE    FontLocked;        /* Font size locked? */
  1081.     BYTE    Pad;
  1082. };
  1083.  
  1084.     /* File transfer library settings. */
  1085.  
  1086. struct TransferSettings
  1087. {
  1088.     UBYTE    DefaultLibrary[MAX_FILENAME_LENGTH],
  1089.         ASCIIUploadLibrary[MAX_FILENAME_LENGTH],
  1090.         ASCIIDownloadLibrary[MAX_FILENAME_LENGTH],
  1091.         TextUploadLibrary[MAX_FILENAME_LENGTH],
  1092.         TextDownloadLibrary[MAX_FILENAME_LENGTH],
  1093.         BinaryUploadLibrary[MAX_FILENAME_LENGTH],
  1094.         BinaryDownloadLibrary[MAX_FILENAME_LENGTH];
  1095.     BYTE    InternalASCIIUpload,
  1096.         InternalASCIIDownload,
  1097.         QuietTransfer,
  1098.         MangleFileNames;
  1099.  
  1100.     WORD    LineDelay,        /* Insert line delay. */
  1101.         CharDelay;        /* Insert character delay. */
  1102.  
  1103.     UBYTE    LinePrompt[256];    /* Line wait prompt. */
  1104.     WORD    SendTimeout;        /* Line send timeout. */
  1105.     UBYTE    PacingMode;        /* Text pacing mode. */
  1106.     BYTE    StripBit8;        /* Strip high order bit. */
  1107.     BYTE    IgnoreDataPastArnold;    /* Ignore data past terminator. */
  1108.     UBYTE    TerminatorChar;        /* Terminator character. */
  1109.     BYTE    SendCR,
  1110.         SendLF,
  1111.         ReceiveCR,
  1112.         ReceiveLF;
  1113. };
  1114.  
  1115.     /* The new configuration settings. */
  1116.  
  1117. struct Configuration
  1118. {
  1119.     struct SerialSettings        *SerialConfig;
  1120.     struct ModemSettings        *ModemConfig;
  1121.     struct ScreenSettings        *ScreenConfig;
  1122.     struct TerminalSettings        *TerminalConfig;
  1123.     struct EmulationSettings    *EmulationConfig;
  1124.     struct ClipSettings        *ClipConfig;
  1125.     struct CaptureSettings        *CaptureConfig;
  1126.     struct CommandSettings        *CommandConfig;
  1127.     struct MiscSettings        *MiscConfig;
  1128.     struct PathSettings        *PathConfig;
  1129.     struct FileSettings        *FileConfig;
  1130.     struct TransferSettings        *TransferConfig;
  1131. };
  1132.  
  1133.     /* Phonebook entry header. */
  1134.  
  1135. struct PhoneHeader
  1136. {
  1137.     UBYTE    Name[40],        /* BBS name. */
  1138.         Number[100],        /* Phone number. */
  1139.         Comment[100];        /* Comment. */
  1140.  
  1141.     UBYTE    UserName[100],        /* User name for this BSS. */
  1142.         Password[100];        /* Password for user name. */
  1143.  
  1144.     BYTE    QuickMenu;        /* This entry appears in the quick dial menu? */
  1145.     BYTE    Pad;
  1146. };
  1147.  
  1148.     /* A phonebook entry. */
  1149.  
  1150. struct PhoneEntry
  1151. {
  1152.     struct PhoneNode    *Node;
  1153.  
  1154.     struct MinList         TimeDateList;
  1155.  
  1156.     LONG             Count;
  1157.  
  1158.     struct PhoneHeader    *Header;
  1159.     struct Configuration    *Config;
  1160. };
  1161.  
  1162.     /* A text box for several lines of text. */
  1163.  
  1164. struct TextBox
  1165. {
  1166.     struct TextBox        *NextBox;        /* Next box in chain. */
  1167.  
  1168.     LONG             Left,Top,        /* Position and size. */
  1169.                  Width,Height;
  1170.  
  1171.     LONG             LineWidth,        /* Line width in pixels. */
  1172.                  LineHeight;        /* Line height in pixels. */
  1173.  
  1174.     LONG             NumChars,        /* Number of chars per line. */
  1175.                  NumLines;        /* Number of lines. */
  1176.  
  1177.     STRPTR            *Title,            /* Line titles. */
  1178.                 *Text;            /* Line texts. */
  1179.  
  1180.     LONG             TitleFgPen,
  1181.                  TitleBgPen,
  1182.                  TextPen;
  1183. };
  1184.  
  1185.     /* Block marker structure. */
  1186.  
  1187. struct BlockMarker
  1188. {
  1189.         /* The object to manipulate. */
  1190.  
  1191.     APTR            Object;
  1192.  
  1193.         /* Selection and unselection routines. */
  1194.  
  1195.     VOID         (* Select)(struct BlockMarker *Marker,LONG Left,LONG Top,LONG Width,LONG Height);
  1196.     VOID         (* Unselect)(struct BlockMarker *Marker,LONG Left,LONG Top,LONG Width,LONG Height);
  1197.  
  1198.         /* Origin anchor point. */
  1199.  
  1200.     LONG            OriginX,
  1201.                 OriginY;
  1202.  
  1203.         /* First and last selected line. */
  1204.  
  1205.     LONG            FirstLine,
  1206.                 LastLine;
  1207.  
  1208.         /* First and last selected column. */
  1209.  
  1210.     LONG            FirstColumn,
  1211.                 LastColumn;
  1212.  
  1213.         /* Top of display window, lines in the buffer and size of
  1214.          * the display window.
  1215.          */
  1216.  
  1217.     LONG            Top,
  1218.                 Lines,
  1219.                 Width,
  1220.                 Height;
  1221.  
  1222.         /* Canvas left and top edge. */
  1223.  
  1224.     LONG            LeftEdge,
  1225.                 TopEdge;
  1226.  
  1227.         /* Last mouse position. */
  1228.  
  1229.     LONG            LastX,
  1230.                 LastY;
  1231.  
  1232.         /* Single character dimensions. */
  1233.  
  1234.     LONG            TextFontWidth,
  1235.                 TextFontHeight;
  1236.  
  1237.         /* Plane write mask. */
  1238.  
  1239.     UBYTE            WriteMask;
  1240. };
  1241.  
  1242.     /* Global data flow <-> term interface. */
  1243.  
  1244. struct FlowInfo
  1245. {
  1246.     BYTE            Changed;
  1247.  
  1248.     BYTE            NoCarrier,
  1249.                 ZModemUpload;
  1250.  
  1251.     BYTE            Connect,
  1252.                 Voice,
  1253.                 Ring,
  1254.                 Busy,
  1255.                 NoDialTone,
  1256.                 Ok,
  1257.                 Error;
  1258. };
  1259.  
  1260.     /* A scan sequence, somewhat similar to the FlowInfo structure. */
  1261.  
  1262. struct WaitNode
  1263. {
  1264.     struct Node    Node;
  1265.     LONG        Count;        /* Number of characters matched. */
  1266.     STRPTR        Response;    /* Immediate response. */
  1267.     LONG        ResponseLen;    /* Length of immediate response string. */
  1268. };
  1269.  
  1270. struct DialNode
  1271. {
  1272.     struct Node         Node;
  1273.     struct PhoneEntry    *Entry;
  1274. };
  1275.  
  1276.     /* A list as employed by the ARexx interface. */
  1277.  
  1278. struct GenericList
  1279. {
  1280.     struct MinList         ListHeader;
  1281.     struct Node        *ListNode;
  1282.     LONG             ListCount;
  1283.     struct SignalSemaphore     ListSemaphore;
  1284. };
  1285.  
  1286.     /* Number of buffers to be used for buffered I/O. */
  1287.  
  1288. #define BUFFER_NUMBER        2
  1289.  
  1290.     /* Auxiliary structure for buffered file I/O. */
  1291.  
  1292. struct Buffer
  1293. {
  1294.     struct Message             Message;            /* Vanilla message header. */
  1295.  
  1296.     BYTE                 SimpleIO;            /* Real simple I/O? */
  1297.     BYTE                 Pad;
  1298.  
  1299.     BYTE                 Read;                /* Last access has read data. */
  1300.     BYTE                 Written;            /* Last access has written data. */
  1301.  
  1302.     LONG                 Action;            /* Action to perform. */
  1303.     LONG                 ActionData[2];            /* Seek and the like. */
  1304.     LONG                 Result;            /* Return value. */
  1305.  
  1306.     BPTR                 FileHandle;            /* Dos filehandle. */
  1307.  
  1308.     UBYTE                *Data;                /* Data buffer. */
  1309.     LONG                 BufLength;            /* Length of data buffer. */
  1310.  
  1311.     LONG                 BufPosition;            /* Read/write pointer into buffer. */
  1312.  
  1313.     LONG                 ReadBufFull;            /* How many bytes are still to be read from the buffer? */
  1314.     LONG                 WriteBufFull;            /* How many bytes are still to be written to the buffer?*/
  1315.  
  1316.     LONG                 RealPosition;            /* Real position in file. */
  1317.     LONG                 Cached;            /* How many bytes in pre-load cache. */
  1318.  
  1319.     UBYTE                *DataBuffer[BUFFER_NUMBER];    /* The data buffers. */
  1320.     LONG                 DataLength[BUFFER_NUMBER];    /* The lengths of the data buffers. */
  1321.     WORD                 DataCount;            /* Which buffer to use. */
  1322.     BYTE                 WriteAccess;            /* TRUE if a write file handle. */
  1323.     BYTE                 LastActionFailed;        /* TRUE if last action failed -> abort actions. */
  1324.  
  1325.     struct Process            *Child;
  1326.     struct Process            *Caller;            /* Synchronization. */
  1327.  
  1328.     BPTR                 DirLock;
  1329.     struct InfoData __aligned     InfoData;
  1330.  
  1331.     BYTE                 Fresh;                /* TRUE if no read/write access has taken place yet. */
  1332.     BYTE                 Used;                /* Did any access take place at all? */
  1333.  
  1334.     struct DateStamp         OpenDate;            /* Date and time when file was opened. */
  1335. };
  1336.  
  1337.     /* xpr serial bits. */
  1338.  
  1339. #define ST_PARTYON    (1L << 0)
  1340. #define ST_PARTYODD    (1L << 1)
  1341. #define ST_7WIRE    (1L << 2)
  1342. #define ST_QBREAK    (1L << 3)
  1343. #define ST_RADBOOGIE    (1L << 4)
  1344. #define ST_SHARED    (1L << 5)
  1345. #define ST_EOFMODE    (1L << 6)
  1346. #define ST_XDISABLED    (1L << 7)
  1347. #define ST_PARTYMARKON    (1L << 8)
  1348. #define ST_PARTYMARK    (1L << 9)
  1349. #define ST_2BITS    (1L << 10)
  1350. #define ST_READ7    (1L << 11)
  1351. #define ST_WRITE7    (1L << 12)
  1352.  
  1353.     /* Miscellaneous definitions. */
  1354.  
  1355. #define MILLION        1000000
  1356.  
  1357.     /* Raster text line attributes. */
  1358.  
  1359. #define    ATTR_UNDERLINE    1
  1360. #define    ATTR_HIGHLIGHT    2
  1361. #define ATTR_BLINK    4
  1362. #define    ATTR_INVERSE    8
  1363.  
  1364.     /* Audio channels. */
  1365.  
  1366. #define LEFT0F  1
  1367. #define RIGHT0F  2
  1368. #define RIGHT1F  4
  1369. #define LEFT1F  8
  1370.  
  1371.     /* Program revision and the approriate info structure. */
  1372.  
  1373. struct TermInfo
  1374. {
  1375.     UWORD    Version;
  1376.     UWORD    Revision;
  1377. };
  1378.  
  1379. /**********************************************************************/
  1380.  
  1381.  
  1382.     // This defines the destructor data type
  1383.  
  1384. typedef VOID (* __stdargs DESTRUCTOR)(struct MsgItem *);
  1385.  
  1386.     // A message queue handle
  1387.  
  1388. struct MsgQueue
  1389. {
  1390.     struct SignalSemaphore     Access;    // Access semaphore
  1391.     struct MinList         MsgList;    // This is where the queue items go
  1392.  
  1393.     LONG             QueueSize,    // The length of the queue
  1394.                  MaxSize;    // The maximum size of the queue, may be 0
  1395.  
  1396.     struct MinList         WaitList;    // The list of tasks to wait for a wakeup signal
  1397.  
  1398.     struct Task        *SigTask;    // The owner of this handle
  1399.     ULONG             SigMask;    // The signal mask to wake up the owner
  1400.     WORD             SigBit;    // The bit allocated for the mask, may be -1
  1401.  
  1402.     BOOL             Discard;    // Discard or queue new items?
  1403. };
  1404.  
  1405.     // A message item as used by the queue manager
  1406.  
  1407. struct MsgItem
  1408. {
  1409.     struct MinNode         Link;        // List node link
  1410.     DESTRUCTOR         Destructor;    // Destructor routine if any
  1411. };
  1412.  
  1413.     // Your simple message item destructor setup
  1414.  
  1415. #define InitMsgItem(Item,Dest)    (((struct MsgItem *)Item) -> Destructor = (Dest))
  1416.  
  1417.  
  1418. /**********************************************************************/
  1419.  
  1420.  
  1421. enum    {    DATAMSGTYPE_WRITE,DATAMSGTYPE_WRITECLIP,
  1422.         DATAMSGTYPE_UPDATEREVIEW,DATAMSGTYPE_MOVEREVIEW,
  1423.         DATAMSGTYPE_SERIALCOMMAND,DATAMSGTYPE_UPLOAD,
  1424.         DATAMSGTYPE_COMMANDDONE,DATAMSGTYPE_MENU,
  1425.         DATAMSGTYPE_RENDEZVOUS,DATAMSGTYPE_SERIALCOMMANDNOECHO
  1426.     };
  1427.  
  1428.     // An extension of the MsgItem data type
  1429.  
  1430. struct DataMsg
  1431. {
  1432.     struct MsgItem    Item;    // The message item link
  1433.  
  1434.     LONG        Type;    // Message type
  1435.     UBYTE *        Data;    // Pointer to data area
  1436.     LONG        Size;    // Size of data area
  1437. };
  1438.  
  1439.     // An extension of the DataMsg data type
  1440.  
  1441. struct DataReplyMsg
  1442. {
  1443.     struct DataMsg    Data;        // DataMsg link
  1444.  
  1445.     struct Task *    Creator;    // Creator to notify
  1446.     ULONG        CreatorMask;    // Creator notification signal
  1447. };
  1448.  
  1449.  
  1450. /**********************************************************************/
  1451.  
  1452.  
  1453.     // Serial device attributes
  1454.  
  1455. #define SERA_Baud        TAG_USER+1    // Baud rate
  1456. #define SERA_BreakTime        TAG_USER+2    // Break time
  1457. #define SERA_BitsPerChar    TAG_USER+3    // Bits per character
  1458. #define SERA_StopBits        TAG_USER+4    // Number of stop bits
  1459. #define SERA_BufferSize        TAG_USER+5    // Read/Write buffer size
  1460. #define SERA_Parity        TAG_USER+6    // Parity
  1461. #define SERA_Handshaking    TAG_USER+7    // Handshaking mode
  1462. #define SERA_HighSpeed        TAG_USER+8    // Highspeed mode
  1463. #define SERA_Shared        TAG_USER+9    // Shared access
  1464.  
  1465.  
  1466. /**********************************************************************/
  1467.  
  1468.  
  1469.     /* And now for something completely different... */
  1470.  
  1471. #include "termProtos.h"
  1472. #include "termData.h"
  1473. #include "termErrors.h"
  1474.