Documentation Project 1
sack::containers::BinaryTree::DumpTree Function
__cdecl TYPELIB_PROC void DumpTree(PTREEROOT root, int (*Dump)( POINTER user, PTRSZVAL key ));

Basically this is meant to dump to a log, if the print function is passed as NULL, then the tree's contents are dumped to the log. It dumps a very cryptic log of how all nodes in the tree are arranged. But by allowing the user to provide a method to log his data and key, the logging is more meaningful based on the application. The basic code for managing trees and nodes works....

int ForEachNode( POINTER user, PTRSZVAL key )
    // return not 1 to dump to log the internal tree structure
    return 0; // probably did own logging here, so don't log tree internal
void f( void )
    DumpTree( tree, ForEachNode );
Copyright (c) 2010. All rights reserved.
What do you think about this topic? Send feedback!