src/gedlib/node.c
/*===============================================================
 * traverse_nodes -- Traverse nodes in tree while doing something
 * NODE node:    root of tree to traverse
 * func:         function to call at each node (returns FALSE to stop traversal)
 * param:        opaque pointer for client use, passed thru to callback
 *=============================================================*/
- Traverse nodes in tree while doing something
NODE node:    root of tree to traverse
func:         function to call at each node (returns FALSE to stop traversal)
param:        opaque pointer for client use, passed thru to callback
- Traverse nodes in tree while doing something NODE node : root of tree to traverse func : function to call at each node ( returns FALSE to stop traversal ) param : opaque pointer for client use passed thru to callback
BOOLEAN
traverse_nodes (NODE node, BOOLEAN (*func)(NODE, VPTR), VPTR param)
{
	while (node) {
		if (!(*func)(node, param)) return FALSE;
		if (nchild(node)) {
			if (!traverse_nodes(nchild(node), func, param))
				return FALSE;
		}
		node = nsibling(node);
	}
	return TRUE;
}
BOOLEAN traverse_nodes ( NODE node , BOOLEAN ( * func ) ( NODE , VPTR ) , VPTR param ) { while ( node ) { if ( ! ( * func ) ( node , param ) ) return FALSE ; if ( nchild ( node ) ) { if ( ! traverse_nodes ( nchild ( node ) , func , param ) ) return FALSE ; } node = nsibling ( node ) ; } return TRUE ; }
traverse_nodes -- Traverse nodes in tree while doing something
 NODE node:    root of tree to traverse
 func:         function to call at each node (returns FALSE to stop traversal)
 param:        opaque pointer for client use, passed thru to callback
traverse_nodes -- Traverse nodes in tree while doing something NODE node : root of tree to traverse func : function to call at each node ( returns FALSE to stop traversal ) param : opaque pointer for client use passed thru to callback