/* Returns: the index of the child of @node which contains @data, or -1 if the data is not found  */
gint g_node_child_index(GNode *node, gpointer data)
/* Returns: the index of the child of @node which contains @data, or -1 if the data is not found  */
gint g_node_child_index(GNode *node, gpointer data)
{
  guint n = 0;
  g_return_val_if_fail (node != NULL, -1);
  node = node->children;
  while (node)
    {
      if (node->data == data)
	return n;
      n++;
      node = node->next;
    }
  return -1;
}