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.

92 lines
1.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1992 - 1999
  6. //
  7. // File: queue.hxx
  8. //
  9. //--------------------------------------------------------------------------
  10. /*++
  11. --*/
  12. #ifndef __QUEUE_HXX__
  13. #define __QUEUE_HXX__
  14. #define INITIALQUEUESLOTS 4
  15. typedef struct
  16. {
  17. void * Buffer;
  18. unsigned int BufferLength;
  19. } QUEUE_ITEM;
  20. class QUEUE
  21. {
  22. private:
  23. QUEUE_ITEM * QueueSlots;
  24. int NumberOfQueueSlots;
  25. int EndOfQueue;
  26. QUEUE_ITEM InitialQueueSlots[INITIALQUEUESLOTS];
  27. public:
  28. QUEUE (
  29. );
  30. ~QUEUE (
  31. );
  32. int
  33. PutOnQueue (
  34. IN void * Item,
  35. IN unsigned int Length
  36. );
  37. int
  38. PutOnFrontOfQueue (
  39. IN void * Item,
  40. IN unsigned int Length
  41. );
  42. void *
  43. TakeOffQueue (
  44. OUT unsigned int * Length
  45. );
  46. void *
  47. TakeOffEndOfQueue (
  48. OUT unsigned int * Length
  49. );
  50. int
  51. IsQueueEmpty (
  52. )
  53. {
  54. return(!(EndOfQueue));
  55. }
  56. int
  57. Size (
  58. )
  59. {
  60. return EndOfQueue;
  61. }
  62. int
  63. MergeWithQueue (
  64. IN QUEUE *SourceQueue
  65. );
  66. int
  67. MergeWithQueueInFront (
  68. IN QUEUE *SourceQueue
  69. );
  70. };
  71. #endif // __QUEUE_HXX__