Changeset 116 for trunk/src/helpers/tree.c
- Timestamp:
- Nov 1, 2001, 6:43:18 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/tree.c
r113 r116 285 285 * initializes the root of a tree. 286 286 * 287 * If (plCount != NULL), *plCount is set to null also. 288 * This same plCount pointer can then be passed to 289 * treeInsert and treeDelete also to automatically 290 * maintain a tree item count. 291 * 287 292 *@@changed V0.9.16 (2001-10-19) [umoeller]: added plCount 288 293 */ … … 509 514 * "x" specifies the new tree node which must 510 515 * have been allocated by the caller. x->ulKey 511 * must already contain the node's key (data). 516 * must already contain the node's key (data) 517 * which the sort function can understand. 518 * 512 519 * This function will then set the parent, 513 * left, right, and color members. 520 * left, right, and color members. In addition, 521 * if (plCount != NULL), *plCount is raised by 522 * one. 514 523 * 515 524 * Returns 0 if no error. Might return … … 521 530 522 531 int treeInsert(TREE **root, // in: root of the tree 523 PLONG plCount, // in/out: item count (ptr can be NULL)532 PLONG plCount, // in/out: item count (ptr can be NULL) 524 533 TREE *x, // in: new node to insert 525 534 FNTREE_COMPARE *pfnCompare) // in: comparison func … … 750 759 * Does not free() the node though. 751 760 * 761 * In addition, if (plCount != NULL), *plCount is 762 * decremented. 763 * 752 764 * Returns 0 if the node was deleted or 753 765 * STATUS_INVALID_NODE if not. … … 757 769 758 770 int treeDelete(TREE **root, // in: root of the tree 759 PLONG plCount, // in/out: item count (ptr can be NULL)771 PLONG plCount, // in/out: item count (ptr can be NULL) 760 772 TREE *tree) // in: tree node to delete 761 773 {
Note:
See TracChangeset
for help on using the changeset viewer.