/* Returns: the position of @child with respect to its siblings  */
gint g_node_child_position(GNode *node, GNode *child)
/* Returns: the position of @child with respect to its siblings  */
gint g_node_child_position(GNode *node, GNode *child)
{
  guint n = 0;
  g_return_val_if_fail (node != NULL, -1);
  g_return_val_if_fail (child != NULL, -1);
  g_return_val_if_fail (child->parent == node, -1);
  node = node->children;
  while (node)
    {
      if (node == child)
	return n;
      n++;
      node = node->next;
    }
  return -1;
}