/* Returns: TRUE if @instance is valid, FALSE otherwise  */
gboolean g_type_check_instance(GTypeInstance *type_instance)
/* Returns: TRUE if @instance is valid, FALSE otherwise  */
gboolean g_type_check_instance(GTypeInstance *type_instance)
{
  if (type_instance)
    {
      if (type_instance->g_class)
	{
	  TypeNode *node = lookup_type_node_I (type_instance->g_class->g_type);
	  if (node && node->is_instantiatable)
	    return TRUE;
	  g_warning ("instance of invalid non-instantiatable type '%s'",
		     type_descriptive_name_I (type_instance->g_class->g_type));
	}
      else
	g_warning ("instance with invalid (NULL) class pointer");
    }
  else
    g_warning ("invalid (NULL) pointer instance");
  return FALSE;
}