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.

149 lines
2.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000
  6. //
  7. // File: LinkList.cxx
  8. //
  9. //--------------------------------------------------------------------------
  10. /* --------------------------------------------------------------------
  11. File: Linkist.cxx
  12. Description:
  13. The implementation of the functions that support link list operations.
  14. All of these simply relegate to the macro versions
  15. History :
  16. kamenm Aug 2000 Created
  17. -------------------------------------------------------------------- */
  18. #include <precomp.hxx>
  19. PLIST_ENTRY
  20. RpcpfRemoveHeadList(
  21. PLIST_ENTRY ListHead
  22. )
  23. /*++
  24. Routine Description:
  25. Removes the head of the list.
  26. Arguments:
  27. ListHead - the head of the list
  28. Return Value:
  29. The removed entry. If the list is empty,
  30. ListHead will be returned.
  31. --*/
  32. {
  33. return RpcpRemoveHeadList(ListHead);
  34. }
  35. PLIST_ENTRY
  36. RpcpfRemoveTailList(
  37. PLIST_ENTRY ListHead
  38. )
  39. /*++
  40. Routine Description:
  41. Removes the tail of the list
  42. Arguments:
  43. ListHead - the head of the list
  44. Return Value:
  45. The removed entry. If the list is empty,
  46. ListHead will be returned.
  47. --*/
  48. {
  49. return RpcpRemoveTailList(ListHead);
  50. }
  51. VOID
  52. RpcpfRemoveEntryList(
  53. PLIST_ENTRY Entry
  54. )
  55. /*++
  56. Routine Description:
  57. Removes an entry from the list
  58. Arguments:
  59. Entry - the entry to remove
  60. Return Value:
  61. --*/
  62. {
  63. ASSERT(Entry->Blink->Flink == Entry);
  64. ASSERT(Entry->Flink->Blink == Entry);
  65. RpcpRemoveEntryList(Entry);
  66. #if DBG
  67. // Catch double-remove of an entry on chk builds.
  68. Entry->Blink = NULL;
  69. Entry->Flink = NULL;
  70. #endif
  71. }
  72. VOID
  73. RpcpfInsertTailList(
  74. PLIST_ENTRY ListHead,
  75. PLIST_ENTRY Entry
  76. )
  77. /*++
  78. Routine Description:
  79. Adds an entry to the tail of the list
  80. Arguments:
  81. ListHead - the head of the list
  82. Entry - the entry to add
  83. Return Value:
  84. --*/
  85. {
  86. RpcpInsertTailList(ListHead,Entry);
  87. }
  88. VOID
  89. RpcpfInsertHeadList(
  90. PLIST_ENTRY ListHead,
  91. PLIST_ENTRY Entry
  92. )
  93. /*++
  94. Routine Description:
  95. Adds an entry to the head of the list
  96. Arguments:
  97. ListHead - the head of the list
  98. Entry - the entry to add
  99. Return Value:
  100. --*/
  101. {
  102. RpcpInsertHeadList(ListHead,Entry);
  103. }