home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MODEM / UWPC201.ZIP / UW-SRC.ZIP / CLIENTS.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-03  |  2.9 KB  |  87 lines

  1. //-------------------------------------------------------------------------
  2. //
  3. // CLIENTS.CPP - Control routines for the special UW/PC clients.
  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    25/07/91  RW  Original Version of CLIENTS.CPP
  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. #include "uw.h"            // UW protocol declarations.
  42. #include "display.h"        // Window display declarations.
  43. #include "mail.h"        // Mail client declarations.
  44. #include "login.h"        // DOS login declarations.
  45.  
  46. #pragma    warn    -par
  47.  
  48. // Start a client service that was requested by a
  49. // "^[|" escape sequence from the remote host.
  50. void    UWProtocol::startclient (int ch)
  51. {
  52. #ifdef    DOOBERY
  53.   if (ch == 'M')        // Start a mail tool client?
  54.     {
  55.       if (!(new UWMailTool (displays[RoundWindow])))
  56.         {
  57.       send ('Q');        // Send Q to quit the mail server.
  58.       send ('\r');
  59.     }
  60.     }
  61.   if (ch == 'L')        // Start a DOS login?
  62.     {
  63.       if (!(new UWLoginTool (displays[RoundWindow])))
  64.     send ('X' & 0x1F);    // Send CTRL-X to cancel the login server.
  65.     }
  66. #endif
  67.   if (ch == 'T')
  68.     {
  69.       // Send the string "stty rows N columns M" //
  70.       UWDisplay *window;
  71.       window = displays[RoundWindow];
  72.       UWMaster.sendstring ("stty rows ");
  73.       if (window -> height >= 100)
  74.         send ('0' + (window -> height / 100));
  75.       if (window -> height >= 10)
  76.         send ('0' + ((window -> height / 10) % 10));
  77.       send ('0' + (window -> height % 10));
  78.       UWMaster.sendstring (" columns ");
  79.       if (window -> width >= 100)
  80.         send ('0' + (window -> width / 100));
  81.       if (window -> width >= 10)
  82.         send ('0' + ((window -> width / 10) % 10));
  83.       send ('0' + (window -> width % 10));
  84.       send ('\r');
  85.     }
  86. } // UWProtocol::startclient //
  87.