/* Returns: the maximum height of the tree beneath @root  */
guint g_node_max_height(GNode *root)
/* Returns: the maximum height of the tree beneath @root  */
guint g_node_max_height(GNode *root)
{
  GNode *child;
  guint max_height = 0;
  if (!root)
    return 0;
  child = root->children;
  while (child)
    {
      guint tmp_height;
      tmp_height = g_node_max_height (child);
      if (tmp_height > max_height)
	max_height = tmp_height;
      child = child->next;
    }
  return max_height + 1;
}