home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MODEM / UWPC201.ZIP / UW-SRC.ZIP / LOGIN.H < prev    next >
Encoding:
C/C++ Source or Header  |  1991-07-27  |  2.6 KB  |  88 lines

  1. //-------------------------------------------------------------------------
  2. //
  3. // LOGIN.H - Declarations for the DOS login facility to allow a user to
  4. //         login to the PC remotely.
  5. // 
  6. //  This file is part of UW/PC - a multi-window comms package for the PC.
  7. //  Copyright (C) 1990-1991  Rhys Weatherley
  8. //
  9. //  This program is free software; you can redistribute it and/or modify
  10. //  it under the terms of the GNU General Public License as published by
  11. //  the Free Software Foundation; either version 1, or (at your option)
  12. //  any later version.
  13. //
  14. //  This program is distributed in the hope that it will be useful,
  15. //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. //  GNU General Public License for more details.
  18. //
  19. //  You should have received a copy of the GNU General Public License
  20. //  along with this program; if not, write to the Free Software
  21. //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. //
  23. // Revision History:
  24. // ================
  25. //
  26. //  Version  DD/MM/YY  By  Description
  27. //  -------  --------  --  --------------------------------------
  28. //    1.0    26/07/91  RW  Original Version of LOGIN.H
  29. //
  30. // You may contact the author by:
  31. // =============================
  32. //
  33. //  e-mail: rhys@cs.uq.oz.au
  34. //    mail: Rhys Weatherley
  35. //          5 Horizon Drive
  36. //          Jamboree Heights
  37. //          Queensland 4074
  38. //        Australia
  39. //
  40. //-------------------------------------------------------------------------
  41.  
  42. #ifndef __LOGIN_H__
  43. #define    __LOGIN_H__
  44.  
  45. #include "client.h"        // Client handling declarations.
  46.  
  47. //
  48. // Define the structure of a DOS login client.  The only special
  49. // control character sent is CTRL-Z to clear the screen.
  50. //
  51. class    UWLoginTool : public UWClient {
  52.  
  53. private:
  54.  
  55.     int    mode;        // Operation mode.
  56.     char    buffer[80];    // Buffer for string entry.
  57.     int    posn;        // Current buffer position.
  58.  
  59.     // Send a string of characters to the remote host.
  60.     void    sendstr    (char *str);
  61.  
  62.     // Clear the buffer.
  63.     void    clrbuf    (void) { posn = 0; };
  64.  
  65.     // Process a character meant for the buffer.  Returns
  66.     // zero if OK, 1 if '\r' pressed, -1 if ESC pressed.
  67.     int    charbuf    (int ch);
  68.  
  69.     // Output the main login menu.
  70.     void    menu    (void);
  71.  
  72.     // Execute the current command.
  73.     int    execute    (void);
  74.  
  75. public:
  76.  
  77.     UWLoginTool (UWDisplay *wind);
  78.  
  79.     virtual    char far *name    () { return ((char far *)"LOGIN"); };
  80.     virtual    void    key    (int keypress);
  81.     virtual    void    remote    (int ch);
  82.     virtual    char    *getstatus (void)
  83.           { return ("Login in progress - ESC aborts"); };
  84.  
  85. };
  86.  
  87. #endif    /* __LOGIN_H__ */
  88.