/* valavoidtype.c generated by valac, the Vala compiler
 * generated from valavoidtype.vala, do not modify */

/* valavoidtype.vala
 *
 * Copyright (C) 2007-2008  Jürg Billeter
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Jürg Billeter <j@bitron.ch>
 */

#include "vala.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>

static gpointer vala_void_type_parent_class = NULL;

static gboolean vala_void_type_real_stricter (ValaDataType* base,
                                       ValaDataType* type2);
static gboolean vala_void_type_real_compatible (ValaDataType* base,
                                         ValaDataType* type2);
static gchar* vala_void_type_real_to_qualified_string (ValaDataType* base,
                                                ValaScope* scope);
static ValaDataType* vala_void_type_real_copy (ValaDataType* base);
static GType vala_void_type_get_type_once (void);

ValaVoidType*
vala_void_type_construct (GType object_type,
                          ValaSourceReference* source_reference)
{
	ValaVoidType* self = NULL;
	self = (ValaVoidType*) vala_data_type_construct (object_type);
	vala_code_node_set_source_reference ((ValaCodeNode*) self, source_reference);
	return self;
}

ValaVoidType*
vala_void_type_new (ValaSourceReference* source_reference)
{
	return vala_void_type_construct (VALA_TYPE_VOID_TYPE, source_reference);
}

static gboolean
vala_void_type_real_stricter (ValaDataType* base,
                              ValaDataType* type2)
{
	ValaVoidType * self;
	gboolean result;
	self = (ValaVoidType*) base;
	g_return_val_if_fail (type2 != NULL, FALSE);
	result = VALA_IS_VOID_TYPE (type2);
	return result;
}

static gboolean
vala_void_type_real_compatible (ValaDataType* base,
                                ValaDataType* type2)
{
	ValaVoidType * self;
	gboolean result;
	self = (ValaVoidType*) base;
	g_return_val_if_fail (type2 != NULL, FALSE);
	result = VALA_IS_VOID_TYPE (type2);
	return result;
}

static gchar*
vala_void_type_real_to_qualified_string (ValaDataType* base,
                                         ValaScope* scope)
{
	ValaVoidType * self;
	gchar* _tmp0_;
	gchar* result;
	self = (ValaVoidType*) base;
	_tmp0_ = g_strdup ("void");
	result = _tmp0_;
	return result;
}

static ValaDataType*
vala_void_type_real_copy (ValaDataType* base)
{
	ValaVoidType * self;
	ValaSourceReference* _tmp0_;
	ValaSourceReference* _tmp1_;
	ValaVoidType* _tmp2_;
	ValaDataType* result;
	self = (ValaVoidType*) base;
	_tmp0_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = vala_void_type_new (_tmp1_);
	result = (ValaDataType*) _tmp2_;
	return result;
}

static void
vala_void_type_class_init (ValaVoidTypeClass * klass,
                           gpointer klass_data)
{
	vala_void_type_parent_class = g_type_class_peek_parent (klass);
	((ValaDataTypeClass *) klass)->stricter = (gboolean (*) (ValaDataType*, ValaDataType*)) vala_void_type_real_stricter;
	((ValaDataTypeClass *) klass)->compatible = (gboolean (*) (ValaDataType*, ValaDataType*)) vala_void_type_real_compatible;
	((ValaDataTypeClass *) klass)->to_qualified_string = (gchar* (*) (ValaDataType*, ValaScope*)) vala_void_type_real_to_qualified_string;
	((ValaDataTypeClass *) klass)->copy = (ValaDataType* (*) (ValaDataType*)) vala_void_type_real_copy;
}

static void
vala_void_type_instance_init (ValaVoidType * self,
                              gpointer klass)
{
}

/**
 * The void type.
 */
static GType
vala_void_type_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValaVoidTypeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_void_type_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaVoidType), 0, (GInstanceInitFunc) vala_void_type_instance_init, NULL };
	GType vala_void_type_type_id;
	vala_void_type_type_id = g_type_register_static (VALA_TYPE_DATA_TYPE, "ValaVoidType", &g_define_type_info, 0);
	return vala_void_type_type_id;
}

GType
vala_void_type_get_type (void)
{
	static volatile gsize vala_void_type_type_id__once = 0;
	if (g_once_init_enter (&vala_void_type_type_id__once)) {
		GType vala_void_type_type_id;
		vala_void_type_type_id = vala_void_type_get_type_once ();
		g_once_init_leave (&vala_void_type_type_id__once, vala_void_type_type_id);
	}
	return vala_void_type_type_id__once;
}

