home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MODEM / UWPC201.ZIP / UW-SRC.ZIP / CONFIG.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-31  |  4.5 KB  |  130 lines

  1. //-------------------------------------------------------------------------
  2. //
  3. // CONFIG.H - Configuration objects for UW/PC.
  4. // 
  5. //  This file is part of UW/PC - a multi-window comms package for the PC.
  6. //  Copyright (C) 1990-1991  Rhys Weatherley
  7. //
  8. //  This program is free software; you can redistribute it and/or modify
  9. //  it under the terms of the GNU General Public License as published by
  10. //  the Free Software Foundation; either version 1, or (at your option)
  11. //  any later version.
  12. //
  13. //  This program is distributed in the hope that it will be useful,
  14. //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. //  GNU General Public License for more details.
  17. //
  18. //  You should have received a copy of the GNU General Public License
  19. //  along with this program; if not, write to the Free Software
  20. //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. //
  22. // Revision History:
  23. // ================
  24. //
  25. //  Version  DD/MM/YY  By  Description
  26. //  -------  --------  --  --------------------------------------
  27. //    1.0    23/03/91  RW  Original Version of CONFIG.H
  28. //
  29. // You may contact the author by:
  30. // =============================
  31. //
  32. //  e-mail: rhys@cs.uq.oz.au
  33. //    mail: Rhys Weatherley
  34. //          5 Horizon Drive
  35. //          Jamboree Heights
  36. //          Queensland 4074
  37. //        Australia
  38. //
  39. //-------------------------------------------------------------------------
  40.  
  41. #ifndef __CONFIG_H__
  42. #define    __CONFIG_H__
  43.  
  44. //
  45. // Define the available status line positions.
  46. //
  47. #define    STATUS_LEFT        0
  48. #define    STATUS_RIGHT        1
  49. #define    STATUS_CENTRE        2
  50. #define    STATUS_LEFT_SQUASH    3
  51. #define    STATUS_RIGHT_SQUASH    4
  52. #define    STATUS_CENTRE_SQUASH    5
  53.  
  54. //
  55. // Define the configuration class.  All configuration information
  56. // for UW/PC is stored in the object "UWConfig" of this class.
  57. //
  58. #define    STR_LEN        101
  59. #define    MAX_DESCS    5
  60. #define    FONT_STR_LEN    16
  61. class    UWConfiguration {
  62.  
  63. private:
  64.  
  65.     int    linenum;        // Configuration line number.
  66.  
  67.     // Abort the configuration with an error.
  68.     void    error    (char *msg);
  69.  
  70.     // Abort the configuration with an "illegal" config message.
  71.     void    illegal    (char *msg);
  72.  
  73.     // Load a new terminal description from the given filename.
  74.     void    *LoadTerminal (char *filename);
  75.  
  76.     // Find a terminal description in the loaded descriptions.
  77.     // Returns NULL if the terminal type could not be found.
  78.     unsigned char far *FindTerminal (char *type);
  79.  
  80.     // Process a configuration line.
  81.     void    processline (char *line);
  82.  
  83. public:
  84.  
  85.     int    ComPort;        // COM port to be used in UW/PC.
  86.     int    ComParams;        // Communication parameters.
  87.     int    StripHighBit;        // Non-zero for high bit strip.
  88.     char    DeviceParameters[16];    // String description of ComParams.
  89.     int    DisableStatusLine;    // Non-zero to disable status line.
  90.     unsigned char far *P0TermType;    // Protocol 0 terminal type.
  91.     unsigned char far *P1TermType;    // Protocol 1 terminal type.
  92.     char    InitString[STR_LEN];    // Initialisation string.
  93.     char    HangupString[STR_LEN];    // Modem string for hangup.
  94.     int    CarrierInit;        // Non-zero to send init with carrier.
  95.     int    XonXoffFlag;        // Non-zero for encoded XON/XOFF.
  96.     int    BeepEnable;        // Non-zero to enable beep.
  97.     int    SwapBSKeys;        // Non-zero to swap DEL and BS.
  98.     char    DialString[STR_LEN];    // String to send for dial.
  99.     char    CommandString[STR_LEN];    // String to send for "uw" command.
  100.     char    FKeys[10][STR_LEN];    // Function key definitions.
  101.     char    StatusFormat[STR_LEN];    // Format of the status line.
  102.     int    StatusPosn;        // Position of the status line.
  103.     char    FtpString[STR_LEN];    // String to send for "uwftp" command.
  104.     void    *TermDescs[MAX_DESCS];    // New terminal descriptions.
  105.     int    NumTermDescs;        // Number of new descriptions.
  106.     unsigned char NewAttrs[5];    // The new screen attributes.
  107.     int    PopUpNewWindow;        // Non-zero to pop-up new windows.
  108.     int    DisableUW;        // Non-zero to disable server.
  109.     char    ZModemCommand[STR_LEN];    // Name of the ZModem program.
  110.     int    EnableMouse;        // Non-zero if mouse is enabled.
  111.     char    MailBoxName[STR_LEN];    // Name of the user's mailbox.
  112.     char    Password[STR_LEN];    // Password for login client.
  113.     char    MailString[STR_LEN];    // Name of the "uwmail" command.
  114.     int    CursorSize;        // Shape of the screen cursor.
  115.     char    FontFace[FONT_STR_LEN];    // Name of font for Windows 3.0.
  116.     int    FontHeight;        // Height of the font for Windows 3.0.
  117.  
  118.     UWConfiguration (void);        // Set the defaults.
  119.  
  120.     int    doconfig (char *argv0);    // Do the configuration.
  121.  
  122. };
  123.  
  124. //
  125. // Define the main UW/PC configuration object.
  126. //
  127. extern    UWConfiguration    UWConfig;
  128.  
  129. #endif    /* __CONFIG_H__ */
  130.