Source code of Windows XP (NT5)
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.

102 lines
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 2001
  5. //
  6. // File: WCURHEAP.HXX
  7. //
  8. // Contents: Heap definitions for CMergeCursor
  9. //
  10. // History: 20-Jan-92 BarotszM and AmyA Created.
  11. //
  12. //----------------------------------------------------------------------------
  13. #pragma once
  14. #ifdef DISPLAY_INCLUDES
  15. #pragma message( "#include <" __FILE__ ">..." )
  16. #endif
  17. #include <heap.hxx>
  18. #include <ocursor.hxx>
  19. //+---------------------------------------------------------------------------
  20. //
  21. // Function: WidLessThan
  22. //
  23. // Synopsis: Compares work ids in cursors
  24. //
  25. // Arguments: [c1] -- cursor 1
  26. // [c2] -- cursor 2
  27. //
  28. // History: 06-May-91 BartoszM Created
  29. //
  30. //----------------------------------------------------------------------------
  31. inline BOOL WidLessThan ( CCursor* c1, CCursor* c2 )
  32. {
  33. Win4Assert ( c1 != 0 );
  34. Win4Assert ( c2 != 0 );
  35. return ( c1->WorkId() < c2->WorkId() );
  36. }
  37. inline WORKID GetCursorWid( CCursor *pCursor )
  38. {
  39. return pCursor->WorkId();
  40. }
  41. inline BOOL WidLessThan ( WORKID wid, CCursor* c2 )
  42. {
  43. Win4Assert ( c2 != 0 );
  44. return ( wid < c2->WorkId() );
  45. }
  46. inline BOOL WidLessThan ( CCursor *c1, WORKID wid )
  47. {
  48. Win4Assert ( c1 != 0 );
  49. return ( c1->WorkId() < wid );
  50. }
  51. //+---------------------------------------------------------------------------
  52. //
  53. // Function: OccLessThan, public
  54. //
  55. // Synopsis: Compare occurrences in two cursors
  56. //
  57. // Arguments: [c1] -- cursor 1
  58. // [c2] -- cursor 2
  59. //
  60. // History: 17-Jun-91 BartoszM Created
  61. //
  62. //----------------------------------------------------------------------------
  63. inline BOOL OccLessThan ( COccCursor* c1, COccCursor* c2 )
  64. {
  65. Win4Assert ( c1 != 0 );
  66. Win4Assert ( c2 != 0 );
  67. return ( c1->Occurrence() < c2->Occurrence() );
  68. }
  69. inline OCCURRENCE GetCursorOcc( COccCursor *pOccCursor )
  70. {
  71. return pOccCursor->Occurrence();
  72. }
  73. inline BOOL OccLessThan ( OCCURRENCE c1, COccCursor* c2 )
  74. {
  75. Win4Assert ( c2 != 0 );
  76. return ( c1 < c2->Occurrence() );
  77. }
  78. inline BOOL OccLessThan ( COccCursor * c1, OCCURRENCE c2 )
  79. {
  80. Win4Assert ( c1 != 0 );
  81. return ( c1->Occurrence() < c2 );
  82. }
  83. // Define parametrized class CWidHeap (a heap of cursors)
  84. DEF_HEAP ( CWidHeap, CCursor )