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.

70 lines
2.0 KiB

  1. /***********************************************************************
  2. * INTEL Corporation Prorietary Information *
  3. * *
  4. * This listing is supplied under the terms of a license agreement *
  5. * with INTEL Corporation and may not be copied nor disclosed except *
  6. * in accordance with the terms of that agreement. *
  7. * *
  8. * Copyright (c) 1996 Intel Corporation. *
  9. ***********************************************************************/
  10. /*-*-------------------------------------------------------------------------
  11. File Name:
  12. queue.h
  13. Summary:
  14. Queue management header file.
  15. Prerequisites:
  16. windows.h
  17. Hide:
  18. $Header: S:\sturgeon\src\h245ws\vcs\queue.h_v 1.5 13 Dec 1996 12:13:58 SBELL1 $
  19. -------------------------------------------------------------------------*-*/
  20. #ifndef QUEUE_H
  21. #define QUEUE_H
  22. #if defined(__cplusplus)
  23. extern "C"
  24. {
  25. #endif // (__cplusplus)
  26. #define NORMAL 0
  27. #define ABNORMAL 1
  28. #define MAX_QUEUE_SIZE 10
  29. #define Q_NULL -1
  30. typedef struct _QUEUE
  31. {
  32. LPVOID apObjects[MAX_QUEUE_SIZE];
  33. int nHead;
  34. int nTail;
  35. int nCursor;
  36. CRITICAL_SECTION CriticalSection;
  37. } QUEUE, *PQUEUE;
  38. PQUEUE QCreate (void);
  39. void QFree (PQUEUE pQueue);
  40. BOOL QInsert (PQUEUE pQueue, LPVOID pObject);
  41. BOOL QInsertAtHead (PQUEUE pQueue, LPVOID pObject);
  42. LPVOID QRemove (PQUEUE pQueue);
  43. BOOL IsQEmpty (PQUEUE pQueue);
  44. // Iterationg methods.
  45. void QLock (PQUEUE pQueue);
  46. void QUnlock (PQUEUE pQueue);
  47. LPVOID QFirstItem (PQUEUE pQueue);
  48. LPVOID QNextItem (PQUEUE pQueue);
  49. LPVOID QRemoveCurrentItem(PQUEUE pQueue);
  50. #if defined(__cplusplus)
  51. }
  52. #endif // (__cplusplus)
  53. #endif /* QUEUE_H */