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.

317 lines
9.5 KiB

  1. <html>
  2. <head><title>The mtr package (Internal) </title></head>
  3. <body>
  4. <h1>The mtr package (Internal) </h1>
  5. <h2>Internal data structures of the mtr package</h2>
  6. <h3></h3>
  7. <hr>
  8. <ul>
  9. <li><a href="mtrExtAbs.html"><h3>External abstracts</h3></a>
  10. <li><a href="mtrAllAbs.html"><h3>All abstracts</h3></a>
  11. <li><a href="mtrExtDet.html#prototypes"><h3>External functions</h3></a>
  12. <li><a href="mtrAllDet.html#prototypes"><h3>All functions</h3></a>
  13. </ul>
  14. <hr>
  15. <a name="description">
  16. In this package all definitions are external.
  17. </a>
  18. <hr>
  19. <!-- Function Prototypes and description -->
  20. <dl>
  21. <a name="prototypes"></a>
  22. <dt><pre>
  23. MtrNode * <i></i>
  24. <a name="Mtr_AllocNode"><b>Mtr_AllocNode</b></a>(
  25. <b></b> <i></i>
  26. )
  27. </pre>
  28. <dd> Allocates new tree node. Returns pointer to node.
  29. <p>
  30. <dd> <b>Side Effects</b> None
  31. <p>
  32. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_DeallocNode">Mtr_DeallocNode</a>
  33. </code>
  34. <dt><pre>
  35. MtrNode * <i></i>
  36. <a name="Mtr_CopyTree"><b>Mtr_CopyTree</b></a>(
  37. MtrNode * <b>node</b>, <i></i>
  38. int <b>expansion</b> <i></i>
  39. )
  40. </pre>
  41. <dd> Makes a copy of tree. If parameter expansion is greater than 1, it will expand the tree by that factor. It is an error for expansion to be less than 1. Returns a pointer to the copy if successful; NULL otherwise.
  42. <p>
  43. <dd> <b>Side Effects</b> None
  44. <p>
  45. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_InitTree">Mtr_InitTree</a>
  46. </code>
  47. <dt><pre>
  48. MtrNode * <i></i>
  49. <a name="Mtr_CreateFirstChild"><b>Mtr_CreateFirstChild</b></a>(
  50. MtrNode * <b>parent</b> <i></i>
  51. )
  52. </pre>
  53. <dd> Creates a new node and makes it the first child of parent. Returns pointer to new child.
  54. <p>
  55. <dd> <b>Side Effects</b> None
  56. <p>
  57. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_MakeFirstChild">Mtr_MakeFirstChild</a>
  58. <a href="mtrAllDet.html#Mtr_CreateLastChild">Mtr_CreateLastChild</a>
  59. </code>
  60. <dt><pre>
  61. MtrNode * <i></i>
  62. <a name="Mtr_CreateLastChild"><b>Mtr_CreateLastChild</b></a>(
  63. MtrNode * <b>parent</b> <i></i>
  64. )
  65. </pre>
  66. <dd> Creates a new node and makes it the last child of parent. Returns pointer to new child.
  67. <p>
  68. <dd> <b>Side Effects</b> None
  69. <p>
  70. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_MakeLastChild">Mtr_MakeLastChild</a>
  71. <a href="mtrAllDet.html#Mtr_CreateFirstChild">Mtr_CreateFirstChild</a>
  72. </code>
  73. <dt><pre>
  74. void <i></i>
  75. <a name="Mtr_DeallocNode"><b>Mtr_DeallocNode</b></a>(
  76. MtrNode * <b>node</b> <i>node to be deallocated</i>
  77. )
  78. </pre>
  79. <dd> Deallocates tree node.
  80. <p>
  81. <dd> <b>Side Effects</b> None
  82. <p>
  83. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_AllocNode">Mtr_AllocNode</a>
  84. </code>
  85. <dt><pre>
  86. MtrNode * <i></i>
  87. <a name="Mtr_DissolveGroup"><b>Mtr_DissolveGroup</b></a>(
  88. MtrNode * <b>group</b> <i>group to be dissolved</i>
  89. )
  90. </pre>
  91. <dd> Merges the children of `group' with the children of its parent. Disposes of the node pointed by group. If group is the root of the group tree, this procedure leaves the tree unchanged. Returns the pointer to the parent of `group' upon successful termination; NULL otherwise.
  92. <p>
  93. <dd> <b>Side Effects</b> None
  94. <p>
  95. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_MakeGroup">Mtr_MakeGroup</a>
  96. </code>
  97. <dt><pre>
  98. MtrNode * <i></i>
  99. <a name="Mtr_FindGroup"><b>Mtr_FindGroup</b></a>(
  100. MtrNode * <b>root</b>, <i>root of the group tree</i>
  101. unsigned int <b>low</b>, <i>lower bound of the group</i>
  102. unsigned int <b>size</b> <i>upper bound of the group</i>
  103. )
  104. </pre>
  105. <dd> Finds a group with size leaves starting at low, if it exists. This procedure relies on the low and size fields of each node. It also assumes that the children of each node are sorted in order of increasing low. Returns the pointer to the root of the group upon successful termination; NULL otherwise.
  106. <p>
  107. <dd> <b>Side Effects</b> None
  108. <p>
  109. <dt><pre>
  110. void <i></i>
  111. <a name="Mtr_FreeTree"><b>Mtr_FreeTree</b></a>(
  112. MtrNode * <b>node</b> <i></i>
  113. )
  114. </pre>
  115. <dd> Disposes of tree rooted at node.
  116. <p>
  117. <dd> <b>Side Effects</b> None
  118. <p>
  119. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_InitTree">Mtr_InitTree</a>
  120. </code>
  121. <dt><pre>
  122. MtrNode * <i></i>
  123. <a name="Mtr_InitGroupTree"><b>Mtr_InitGroupTree</b></a>(
  124. int <b>lower</b>, <i></i>
  125. int <b>size</b> <i></i>
  126. )
  127. </pre>
  128. <dd> Allocate new tree with one node, whose low and size fields are specified by the lower and size parameters. Returns pointer to tree root.
  129. <p>
  130. <dd> <b>Side Effects</b> None
  131. <p>
  132. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_InitTree">Mtr_InitTree</a>
  133. <a href="mtrAllDet.html#Mtr_FreeTree">Mtr_FreeTree</a>
  134. </code>
  135. <dt><pre>
  136. MtrNode * <i></i>
  137. <a name="Mtr_InitTree"><b>Mtr_InitTree</b></a>(
  138. <b></b> <i></i>
  139. )
  140. </pre>
  141. <dd> Initializes tree with one node. Returns pointer to node.
  142. <p>
  143. <dd> <b>Side Effects</b> None
  144. <p>
  145. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_FreeTree">Mtr_FreeTree</a>
  146. <a href="mtrAllDet.html#Mtr_InitGroupTree">Mtr_InitGroupTree</a>
  147. </code>
  148. <dt><pre>
  149. void <i></i>
  150. <a name="Mtr_MakeFirstChild"><b>Mtr_MakeFirstChild</b></a>(
  151. MtrNode * <b>parent</b>, <i></i>
  152. MtrNode * <b>child</b> <i></i>
  153. )
  154. </pre>
  155. <dd> Makes child the first child of parent.
  156. <p>
  157. <dd> <b>Side Effects</b> None
  158. <p>
  159. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_MakeLastChild">Mtr_MakeLastChild</a>
  160. <a href="mtrAllDet.html#Mtr_CreateFirstChild">Mtr_CreateFirstChild</a>
  161. </code>
  162. <dt><pre>
  163. MtrNode * <i></i>
  164. <a name="Mtr_MakeGroup"><b>Mtr_MakeGroup</b></a>(
  165. MtrNode * <b>root</b>, <i>root of the group tree</i>
  166. unsigned int <b>low</b>, <i>lower bound of the group</i>
  167. unsigned int <b>size</b>, <i>upper bound of the group</i>
  168. unsigned int <b>flags</b> <i>flags for the new group</i>
  169. )
  170. </pre>
  171. <dd> Makes a new group with size leaves starting at low. If the new group intersects an existing group, it must either contain it or be contained by it. This procedure relies on the low and size fields of each node. It also assumes that the children of each node are sorted in order of increasing low. In case of a valid request, the flags of the new group are set to the value passed in `flags.' This can also be used to change the flags of an existing group. Returns the pointer to the root of the new group upon successful termination; NULL otherwise. If the group already exists, the pointer to its root is returned.
  172. <p>
  173. <dd> <b>Side Effects</b> None
  174. <p>
  175. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_DissolveGroup">Mtr_DissolveGroup</a>
  176. <a href="mtrAllDet.html#Mtr_ReadGroups">Mtr_ReadGroups</a>
  177. <a href="mtrAllDet.html#Mtr_FindGroup">Mtr_FindGroup</a>
  178. </code>
  179. <dt><pre>
  180. void <i></i>
  181. <a name="Mtr_MakeLastChild"><b>Mtr_MakeLastChild</b></a>(
  182. MtrNode * <b>parent</b>, <i></i>
  183. MtrNode * <b>child</b> <i></i>
  184. )
  185. </pre>
  186. <dd> Makes child the last child of parent.
  187. <p>
  188. <dd> <b>Side Effects</b> None
  189. <p>
  190. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_MakeFirstChild">Mtr_MakeFirstChild</a>
  191. <a href="mtrAllDet.html#Mtr_CreateLastChild">Mtr_CreateLastChild</a>
  192. </code>
  193. <dt><pre>
  194. void <i></i>
  195. <a name="Mtr_MakeNextSibling"><b>Mtr_MakeNextSibling</b></a>(
  196. MtrNode * <b>first</b>, <i></i>
  197. MtrNode * <b>second</b> <i></i>
  198. )
  199. </pre>
  200. <dd> Makes second the next sibling of first. Second becomes a child of the parent of first.
  201. <p>
  202. <dd> <b>Side Effects</b> None
  203. <p>
  204. <dt><pre>
  205. void <i></i>
  206. <a name="Mtr_PrintGroups"><b>Mtr_PrintGroups</b></a>(
  207. MtrNode * <b>root</b>, <i>root of the group tree</i>
  208. int <b>silent</b> <i>flag to check tree syntax only</i>
  209. )
  210. </pre>
  211. <dd> Prints the groups as a parenthesized list. After each group, the group's flag are printed, preceded by a `|'. For each flag (except MTR_TERMINAL) a character is printed. <ul> <li>F: MTR_FIXED <li>N: MTR_NEWNODE <li>S: MTR_SOFT </ul> The second argument, silent, if different from 0, causes Mtr_PrintGroups to only check the syntax of the group tree.
  212. <p>
  213. <dd> <b>Side Effects</b> None
  214. <p>
  215. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_PrintTree">Mtr_PrintTree</a>
  216. </code>
  217. <dt><pre>
  218. void <i></i>
  219. <a name="Mtr_PrintTree"><b>Mtr_PrintTree</b></a>(
  220. MtrNode * <b>node</b> <i></i>
  221. )
  222. </pre>
  223. <dd> Prints a tree, one node per line.
  224. <p>
  225. <dd> <b>Side Effects</b> None
  226. <p>
  227. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_PrintGroups">Mtr_PrintGroups</a>
  228. </code>
  229. <dt><pre>
  230. MtrNode * <i></i>
  231. <a name="Mtr_ReadGroups"><b>Mtr_ReadGroups</b></a>(
  232. FILE * <b>fp</b>, <i>file pointer</i>
  233. int <b>nleaves</b> <i>number of leaves of the new tree</i>
  234. )
  235. </pre>
  236. <dd> Reads groups from a file and creates a group tree. Each group is specified by three fields: <xmp> low size flags. </xmp> Low and size are (short) integers. Flags is a string composed of the following characters (with associated translation): <ul> <li>D: MTR_DEFAULT <li>F: MTR_FIXED <li>N: MTR_NEWNODE <li>S: MTR_SOFT <li>T: MTR_TERMINAL </ul> Normally, the only flags that are needed are D and F. Groups and fields are separated by white space (spaces, tabs, and newlines). Returns a pointer to the group tree if successful; NULL otherwise.
  237. <p>
  238. <dd> <b>Side Effects</b> None
  239. <p>
  240. <dd> <b>See Also</b> <code><a href="mtrAllDet.html#Mtr_InitGroupTree">Mtr_InitGroupTree</a>
  241. <a href="mtrAllDet.html#Mtr_MakeGroup">Mtr_MakeGroup</a>
  242. </code>
  243. <dt><pre>
  244. int <i></i>
  245. <a name="Mtr_SwapGroups"><b>Mtr_SwapGroups</b></a>(
  246. MtrNode * <b>first</b>, <i>first node to be swapped</i>
  247. MtrNode * <b>second</b> <i>second node to be swapped</i>
  248. )
  249. </pre>
  250. <dd> Swaps two children of a tree node. Adjusts the high and low fields of the two nodes and their descendants. The two children must be adjacent. However, first may be the younger sibling of second. Returns 1 in case of success; 0 otherwise.
  251. <p>
  252. <dd> <b>Side Effects</b> None
  253. <p>
  254. </dl>
  255. <hr>
  256. Generated automatically by <code>extdoc</code> on 970123
  257. </body></html>