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.

232 lines
7.1 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998 Active Voice Corporation. All Rights Reserved.
  4. //
  5. // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation.
  6. //
  7. // Other brand and product names used herein are trademarks of their respective owners.
  8. //
  9. // The entire program and user interface including the structure, sequence, selection,
  10. // and arrangement of the dialog, the exclusively "yes" and "no" choices represented
  11. // by "1" and "2," and each dialog message are protected by copyrights registered in
  12. // the United States and by international treaties.
  13. //
  14. // Protected by one or more of the following United States patents: 5,070,526, 5,488,650,
  15. // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054.
  16. //
  17. // Active Voice Corporation
  18. // Seattle, Washington
  19. // USA
  20. //
  21. /////////////////////////////////////////////////////////////////////////////////////////
  22. ////
  23. // list.h - interface for linked list functions in list.c
  24. ////
  25. #ifndef __LIST_H__
  26. #define __LIST_H__
  27. #include "winlocal.h"
  28. #define LIST_VERSION 0x00000100
  29. // handle to a list
  30. //
  31. DECLARE_HANDLE32(HLIST);
  32. // handle to a list node
  33. //
  34. DECLARE_HANDLE32(HLISTNODE);
  35. // list data element
  36. //
  37. typedef LPVOID LISTELEM;
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. ////
  42. // list constructor and destructor functions
  43. ////
  44. // ListCreate - list constructor
  45. // <dwVersion> (i) must be LIST_VERSION
  46. // <hInst> (i) instance handle of calling module
  47. // return new list handle (NULL if error)
  48. //
  49. HLIST DLLEXPORT WINAPI ListCreate(DWORD dwVersion, HINSTANCE hInst);
  50. // ListDestroy - list destructor
  51. // <hList> (i) handle returned from ListCreate
  52. // return 0 if success
  53. // NOTE: any nodes within list are destroyed also
  54. //
  55. int DLLEXPORT WINAPI ListDestroy(HLIST hList);
  56. ////
  57. // list status functions
  58. ////
  59. // ListGetCount - return count of nodes in list
  60. // <hList> (i) handle returned from ListCreate
  61. // return node count (-1 if error)
  62. //
  63. long DLLEXPORT WINAPI ListGetCount(HLIST hList);
  64. // ListIsEmpty - return TRUE if list has no nodes
  65. // <hList> (i) handle returned from ListCreate
  66. // return TRUE or FALSE
  67. //
  68. BOOL DLLEXPORT WINAPI ListIsEmpty(HLIST hList);
  69. ////
  70. // list iteration functions
  71. ////
  72. // ListGetHeadNode - get list head node
  73. // <hList> (i) handle returned from ListCreate
  74. // return list head node (NULL if error or empty)
  75. //
  76. HLISTNODE DLLEXPORT WINAPI ListGetHeadNode(HLIST hList);
  77. // ListGetTailNode - get list tail node
  78. // <hList> (i) handle returned from ListCreate
  79. // return list tail node (NULL if error or empty)
  80. //
  81. HLISTNODE DLLEXPORT WINAPI ListGetTailNode(HLIST hList);
  82. // ListGetNextNode - get node which follows specified node
  83. // <hList> (i) handle returned from ListCreate
  84. // <hNode> (i) node handle
  85. // return node which follows specified node (NULL if error or none)
  86. //
  87. HLISTNODE DLLEXPORT WINAPI ListGetNextNode(HLIST hList, HLISTNODE hNode);
  88. // ListGetPrevNode - get node which precedes specified node
  89. // <hList> (i) handle returned from ListCreate
  90. // <hNode> (i) node handle
  91. // return node which precedes specified node (NULL if error or none)
  92. //
  93. HLISTNODE DLLEXPORT WINAPI ListGetPrevNode(HLIST hList, HLISTNODE hNode);
  94. ////
  95. // list element insertion functions
  96. ////
  97. // ListAddHead - add new node with data <elem> to head of list,
  98. // <hList> (i) handle returned from ListCreate
  99. // <elem> (i) new data element
  100. // returns new node handle (NULL if error)
  101. //
  102. HLISTNODE DLLEXPORT WINAPI ListAddHead(HLIST hList, LISTELEM elem);
  103. // ListAddTail - add new node with data <elem> to tail of list,
  104. // <hList> (i) handle returned from ListCreate
  105. // <elem> (i) new data element
  106. // returns new node handle (NULL if error)
  107. //
  108. HLISTNODE DLLEXPORT WINAPI ListAddTail(HLIST hList, LISTELEM elem);
  109. // ListInsertBefore - insert new node with data <elem> before specified node
  110. // <hList> (i) handle returned from ListCreate
  111. // <hNode> (i) node handle
  112. // <elem> (i) new data element
  113. // return handle to new node (NULL if error)
  114. //
  115. HLISTNODE DLLEXPORT WINAPI ListInsertBefore(HLIST hList, HLISTNODE hNode, LISTELEM elem);
  116. // ListInsertAfter - insert new node with data <elem> after specified node
  117. // <hList> (i) handle returned from ListCreate
  118. // <hNode> (i) node handle
  119. // <elem> (i) new data element
  120. // return handle to new node (NULL if error)
  121. //
  122. HLISTNODE DLLEXPORT WINAPI ListInsertAfter(HLIST hList, HLISTNODE hNode, LISTELEM elem);
  123. ////
  124. // list element removal functions
  125. ////
  126. // ListRemoveHead - remove node from head of list,
  127. // <hList> (i) handle returned from ListCreate
  128. // returns removed data element
  129. //
  130. LISTELEM DLLEXPORT WINAPI ListRemoveHead(HLIST hList);
  131. // ListRemoveTail - remove node from tail of list,
  132. // <hList> (i) handle returned from ListCreate
  133. // returns removed data element
  134. //
  135. LISTELEM DLLEXPORT WINAPI ListRemoveTail(HLIST hList);
  136. // ListRemoveAt - remove specified node from list,
  137. // <hList> (i) handle returned from ListCreate
  138. // <hNode> (i) node handle
  139. // returns removed data element
  140. //
  141. LISTELEM DLLEXPORT WINAPI ListRemoveAt(HLIST hList, HLISTNODE hNode);
  142. // ListRemoveAll - remove all nodes from list
  143. // <hList> (i) handle returned from ListCreate
  144. // return 0 if success
  145. //
  146. int DLLEXPORT WINAPI ListRemoveAll(HLIST hList);
  147. ////
  148. // list element get/set value functions
  149. ////
  150. // ListGetHead - return data element from head node
  151. // <hList> (i) handle returned from ListCreate
  152. // return data element
  153. //
  154. LISTELEM DLLEXPORT WINAPI ListGetHead(HLIST hList);
  155. // ListGetTail - return data element from tail node
  156. // <hList> (i) handle returned from ListCreate
  157. // return data element
  158. //
  159. LISTELEM DLLEXPORT WINAPI ListGetTail(HLIST hList);
  160. // ListGetAt - return data element from specified node
  161. // <hList> (i) handle returned from ListCreate
  162. // <hNode> (i) node handle
  163. // return data element
  164. //
  165. LISTELEM DLLEXPORT WINAPI ListGetAt(HLIST hList, HLISTNODE hNode);
  166. // ListSetAt - set data element in specified node
  167. // <hList> (i) handle returned from ListCreate
  168. // <hNode> (i) node handle
  169. // <elem> (i) data element
  170. // return 0 if success
  171. //
  172. int DLLEXPORT WINAPI ListSetAt(HLIST hList, HLISTNODE hNode, LISTELEM elem);
  173. ////
  174. // list search functions
  175. ////
  176. // ListFind - search list for node with matching element
  177. // <hList> (i) handle returned from ListCreate
  178. // <elem> (i) data element to match
  179. // <hNodeAfter> (i) node handle to begin search after
  180. // NULL start search at head node
  181. // return matching node (NULL if error or none)
  182. //
  183. HLISTNODE DLLEXPORT WINAPI ListFind(HLIST hList, LISTELEM elem, HLISTNODE hNodeAfter);
  184. // ListFindIndex - search list for nth node in list
  185. // <hList> (i) handle returned from ListCreate
  186. // <nIndex> (i) zero based index into list
  187. // return handle to node (NULL if error)
  188. //
  189. HLISTNODE DLLEXPORT WINAPI ListFindIndex(HLIST hList, long nIndex);
  190. #ifdef __cplusplus
  191. }
  192. #endif
  193. #endif // __LIST_H__