/* Reverses the order of the children of a #GNode. (It doesn't change the order of the grandchildren.)  */
void g_node_reverse_children(GNode *node)
/* Reverses the order of the children of a #GNode. (It doesn't change the order of the grandchildren.)  */
void g_node_reverse_children(GNode *node)
{
  GNode *child;
  GNode *last;
  g_return_if_fail (node != NULL);
  child = node->children;
  last = NULL;
  while (child)
    {
      last = child;
      child = last->next;
      last->next = last->prev;
      last->prev = child;
    }
  node->children = last;
}