Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.7 KiB

  1. // TermCap.h : This file contains the
  2. // Created: Dec '97
  3. // History:
  4. // Copyright (C) 1997 Microsoft Corporation
  5. // All rights reserved.
  6. // Microsoft Confidential
  7. #ifndef _TERMCAP_H_
  8. #define _TERMCAP_H_
  9. #include "cmnhdr.h"
  10. #include <windows.h>
  11. namespace _Utils {
  12. class CTermCap {
  13. public:
  14. virtual ~CTermCap();
  15. static CTermCap* Instance();
  16. bool LoadEntry( LPSTR lpszTermName );
  17. //WORD GetNumber( LPCSTR lpszCapabilityName );
  18. bool CheckFlag( LPCSTR lpszCapabilityName );
  19. LPSTR GetString( LPCSTR lpszCapabilityName );
  20. LPSTR CursorMove( LPSTR lpszCursMotionStr, WORD wHorPos, WORD wVertPos );
  21. void ProcessString( LPSTR* lpszStr );
  22. static PCHAR m_pszFileName;
  23. private:
  24. static CTermCap* m_pInstance;
  25. static int m_iRefCount;
  26. enum { BUFF_SIZE1 = 128, BUFF_SIZE2 = 256, BUFF_SIZE3 = 1024 };
  27. PCHAR m_lpBuffer;
  28. HANDLE m_hFile;
  29. bool FindEntry( LPSTR lpszTermName );
  30. bool LookForTermName( LPSTR lpszTermName );
  31. LPSTR ParseString( LPSTR lpStr);
  32. PCHAR SkipToNextField( PCHAR lpBuf );
  33. CTermCap();
  34. CTermCap(const CTermCap&);
  35. CTermCap& operator=( const CTermCap& rhs );
  36. };
  37. }
  38. #endif // _TERMCAP_H_
  39. // Notes:
  40. // This is a Singleton class.
  41. // LoadEntry() must be called before calling any other
  42. // functions (of course, except Instance()).
  43. // User must delete the instance pointer obtained from
  44. // Instance() when done.
  45. // It is recommended that a user of this class understand
  46. // the structure and content of the "termcap" file.
  47. // Note : At present, this class doesn't support the
  48. // concept of padding dummy characters to handle
  49. // different speeds of transmission
  50. //