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.

59 lines
1.2 KiB

  1. /*
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. lists.h
  5. Abstract:
  6. This module contains the macros for managing lists
  7. Author:
  8. Jameel Hyder (microsoft!jameelh)
  9. Revision History:
  10. 25 Oct 1992 Initial Version
  11. Notes: Tab stop: 4
  12. --*/
  13. #ifndef _LISTS_
  14. #define _LISTS_
  15. #define AfpLinkDoubleAtHead(_pHead, _p, Next, Prev) \
  16. { \
  17. (_p)->Next = (_pHead); \
  18. (_p)->Prev = &(_pHead); \
  19. if ((_pHead) != NULL) \
  20. (_pHead)->Prev = &(_p)->Next; \
  21. (_pHead) = (_p); \
  22. }
  23. #define AfpLinkDoubleAtEnd(_pThis, _pLast, Next, Prev) \
  24. { \
  25. (_pLast)->Next = (_pThis); \
  26. (_pThis)->Prev = &(_pLast)->Next; \
  27. (_pThis)->Next = NULL; \
  28. }
  29. #define AfpInsertDoubleBefore(_pThis, _pBefore, Next, Prev) \
  30. { \
  31. (_pThis)->Next = (_pBefore); \
  32. (_pThis)->Prev = (_pBefore)->Prev; \
  33. (_pBefore)->Prev = &(_pThis)->Next; \
  34. *((_pThis)->Prev) = (_pThis); \
  35. }
  36. #define AfpUnlinkDouble(_p, Next, Prev) \
  37. { \
  38. *((_p)->Prev) = (_p)->Next; \
  39. if ((_p)->Next != NULL) \
  40. (_p)->Next->Prev = (_p)->Prev; \
  41. }
  42. #endif // _LISTS_
  43.