/* Returns: (type GObject.TypeClass) (transfer none): the parent class of @g_class  */
gpointer g_type_class_peek_parent(gpointer g_class)
/* Returns: (type GObject.TypeClass) (transfer none): the parent class of @g_class  */
gpointer g_type_class_peek_parent(gpointer g_class)
{
  TypeNode *node;
  gpointer class = NULL;
  g_return_val_if_fail (g_class != NULL, NULL);
  node = lookup_type_node_I (G_TYPE_FROM_CLASS (g_class));
  if (node && node->is_classed && node->data && NODE_PARENT_TYPE (node))
    {
      node = lookup_type_node_I (NODE_PARENT_TYPE (node));
      class = node->data->class.class;
    }
  else if (NODE_PARENT_TYPE (node))
    g_warning (G_STRLOC ": invalid class pointer '%p'", g_class);
  return class;
}