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

/* gtkdocindexsgmlreader.vala
 *
 * Copyright (C) 2014  Florian Brosch
 *
 * 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:
 *  Florian Brosch <flo.brosch@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include "valadoc.h"
#include <valagee.h>
#include <stdlib.h>
#include <string.h>
#include <gobject/gvaluecollector.h>

#define _vala_map_unref0(var) ((var == NULL) ? NULL : (var = (vala_map_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ValadocImporterParamSpecInternalIdRegistrar ValadocImporterParamSpecInternalIdRegistrar;

struct _ValadocImporterInternalIdRegistrarPrivate {
	ValaHashMap* symbol_map;
	ValaHashMap* map;
};

struct _ValadocImporterParamSpecInternalIdRegistrar {
	GParamSpec parent_instance;
};


static gpointer valadoc_importer_internal_id_registrar_parent_class = NULL;

#define VALADOC_IMPORTER_INTERNAL_ID_REGISTRAR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR, ValadocImporterInternalIdRegistrarPrivate))
static void valadoc_importer_internal_id_registrar_finalize (ValadocImporterInternalIdRegistrar * obj);


ValadocImporterInternalIdRegistrar* valadoc_importer_internal_id_registrar_construct (GType object_type) {
	ValadocImporterInternalIdRegistrar* self = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GEqualFunc _tmp2_;
	ValaHashMap* _tmp3_;
	GHashFunc _tmp4_;
	GEqualFunc _tmp5_;
	GEqualFunc _tmp6_;
	ValaHashMap* _tmp7_;
	self = (ValadocImporterInternalIdRegistrar*) g_type_create_instance (object_type);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_direct_equal;
	_tmp3_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp0_, _tmp1_, _tmp2_);
	_vala_map_unref0 (self->priv->map);
	self->priv->map = _tmp3_;
	_tmp4_ = g_str_hash;
	_tmp5_ = g_str_equal;
	_tmp6_ = g_direct_equal;
	_tmp7_ = vala_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, VALADOC_API_TYPE_NODE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_, _tmp5_, _tmp6_);
	_vala_map_unref0 (self->priv->symbol_map);
	self->priv->symbol_map = _tmp7_;
	return self;
}


ValadocImporterInternalIdRegistrar* valadoc_importer_internal_id_registrar_new (void) {
	return valadoc_importer_internal_id_registrar_construct (VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR);
}


void valadoc_importer_internal_id_registrar_register_symbol (ValadocImporterInternalIdRegistrar* self, const gchar* id, ValadocApiNode* symbol) {
	ValaHashMap* _tmp0_;
	const gchar* _tmp1_;
	ValadocApiNode* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (id != NULL);
	g_return_if_fail (symbol != NULL);
	_tmp0_ = self->priv->symbol_map;
	_tmp1_ = id;
	_tmp2_ = symbol;
	vala_map_set ((ValaMap*) _tmp0_, _tmp1_, _tmp2_);
}


gchar* valadoc_importer_internal_id_registrar_map_url_id (ValadocImporterInternalIdRegistrar* self, const gchar* id) {
	gchar* result = NULL;
	ValaHashMap* _tmp0_;
	const gchar* _tmp1_;
	gpointer _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = self->priv->map;
	_tmp1_ = id;
	_tmp2_ = vala_map_get ((ValaMap*) _tmp0_, _tmp1_);
	result = (gchar*) _tmp2_;
	return result;
}


ValadocApiNode* valadoc_importer_internal_id_registrar_map_symbol_id (ValadocImporterInternalIdRegistrar* self, const gchar* id) {
	ValadocApiNode* result = NULL;
	ValaHashMap* _tmp0_;
	const gchar* _tmp1_;
	gpointer _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	_tmp0_ = self->priv->symbol_map;
	_tmp1_ = id;
	_tmp2_ = vala_map_get ((ValaMap*) _tmp0_, _tmp1_);
	result = (ValadocApiNode*) _tmp2_;
	return result;
}


void valadoc_importer_internal_id_registrar_read_index_sgml_file (ValadocImporterInternalIdRegistrar* self, const gchar* filename, const gchar* index_sgml_online, ValadocErrorReporter* reporter) {
	ValadocMarkupSourceLocation begin = {0};
	ValadocMarkupSourceLocation end = {0};
	ValadocMarkupTokenType token = 0;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* base_path = NULL;
	gchar* _tmp5_;
	ValadocMarkupReader* reader = NULL;
	const gchar* _tmp6_;
	ValadocErrorReporter* _tmp7_;
	ValadocMarkupReader* _tmp8_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (filename != NULL);
	g_return_if_fail (reporter != NULL);
	_tmp1_ = index_sgml_online;
	_tmp2_ = g_strdup (_tmp1_);
	_tmp0_ = _tmp2_;
	if (_tmp0_ == NULL) {
		const gchar* _tmp3_;
		gchar* _tmp4_;
		_tmp3_ = filename;
		_tmp4_ = valadoc_realpath (_tmp3_);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp4_;
	}
	_tmp5_ = _tmp0_;
	_tmp0_ = NULL;
	base_path = _tmp5_;
	_tmp6_ = filename;
	_tmp7_ = reporter;
	_tmp8_ = valadoc_markup_reader_new (_tmp6_, _tmp7_);
	reader = _tmp8_;
	while (TRUE) {
		ValadocMarkupReader* _tmp9_;
		ValadocMarkupSourceLocation _tmp10_ = {0};
		ValadocMarkupSourceLocation _tmp11_ = {0};
		ValadocMarkupTokenType _tmp12_;
		ValadocMarkupTokenType _tmp13_;
		gboolean _tmp14_ = FALSE;
		ValadocMarkupTokenType _tmp15_;
		_tmp9_ = reader;
		_tmp12_ = valadoc_markup_reader_read_token (_tmp9_, &_tmp10_, &_tmp11_);
		begin = _tmp10_;
		end = _tmp11_;
		token = _tmp12_;
		_tmp13_ = token;
		if (!(_tmp13_ != VALADOC_MARKUP_TOKEN_TYPE_EOF)) {
			break;
		}
		_tmp15_ = token;
		if (_tmp15_ == VALADOC_MARKUP_TOKEN_TYPE_START_ELEMENT) {
			ValadocMarkupReader* _tmp16_;
			const gchar* _tmp17_;
			const gchar* _tmp18_;
			_tmp16_ = reader;
			_tmp17_ = valadoc_markup_reader_get_name (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp14_ = g_strcmp0 (_tmp18_, "ONLINE") == 0;
		} else {
			_tmp14_ = FALSE;
		}
		if (_tmp14_) {
			const gchar* _tmp19_;
			_tmp19_ = index_sgml_online;
			if (_tmp19_ == NULL) {
				ValadocMarkupReader* _tmp20_;
				gchar* _tmp21_;
				const gchar* _tmp22_;
				_tmp20_ = reader;
				_tmp21_ = valadoc_markup_reader_get_attribute (_tmp20_, "href");
				_g_free0 (base_path);
				base_path = _tmp21_;
				_tmp22_ = base_path;
				if (_tmp22_ == NULL) {
					ValadocErrorReporter* _tmp23_;
					const gchar* _tmp24_;
					ValadocMarkupSourceLocation _tmp25_;
					gint _tmp26_;
					ValadocMarkupSourceLocation _tmp27_;
					gint _tmp28_;
					ValadocMarkupSourceLocation _tmp29_;
					gint _tmp30_;
					ValadocMarkupReader* _tmp31_;
					ValadocMarkupSourceLocation _tmp32_;
					gint _tmp33_;
					gchar* _tmp34_;
					gchar* _tmp35_;
					_tmp23_ = reporter;
					_tmp24_ = filename;
					_tmp25_ = begin;
					_tmp26_ = _tmp25_.line;
					_tmp27_ = begin;
					_tmp28_ = _tmp27_.column;
					_tmp29_ = end;
					_tmp30_ = _tmp29_.column;
					_tmp31_ = reader;
					_tmp32_ = begin;
					_tmp33_ = _tmp32_.line;
					_tmp34_ = valadoc_markup_reader_get_line_content (_tmp31_, _tmp33_);
					_tmp35_ = _tmp34_;
					valadoc_error_reporter_error (_tmp23_, _tmp24_, (glong) _tmp26_, (glong) _tmp28_, (glong) _tmp30_, _tmp35_, "missing attribute `href' in <ONLINE>");
					_g_free0 (_tmp35_);
				}
			}
		} else {
			gboolean _tmp36_ = FALSE;
			ValadocMarkupTokenType _tmp37_;
			_tmp37_ = token;
			if (_tmp37_ == VALADOC_MARKUP_TOKEN_TYPE_START_ELEMENT) {
				ValadocMarkupReader* _tmp38_;
				const gchar* _tmp39_;
				const gchar* _tmp40_;
				_tmp38_ = reader;
				_tmp39_ = valadoc_markup_reader_get_name (_tmp38_);
				_tmp40_ = _tmp39_;
				_tmp36_ = g_strcmp0 (_tmp40_, "ANCHOR") == 0;
			} else {
				_tmp36_ = FALSE;
			}
			if (_tmp36_) {
				gchar* id = NULL;
				ValadocMarkupReader* _tmp41_;
				gchar* _tmp42_;
				const gchar* _tmp43_;
				gchar* href = NULL;
				ValadocMarkupReader* _tmp57_;
				gchar* _tmp58_;
				const gchar* _tmp59_;
				ValaHashMap* _tmp76_;
				const gchar* _tmp77_;
				const gchar* _tmp78_;
				const gchar* _tmp79_;
				gchar* _tmp80_;
				gchar* _tmp81_;
				_tmp41_ = reader;
				_tmp42_ = valadoc_markup_reader_get_attribute (_tmp41_, "id");
				id = _tmp42_;
				_tmp43_ = id;
				if (_tmp43_ == NULL) {
					ValadocErrorReporter* _tmp44_;
					const gchar* _tmp45_;
					ValadocMarkupSourceLocation _tmp46_;
					gint _tmp47_;
					ValadocMarkupSourceLocation _tmp48_;
					gint _tmp49_;
					ValadocMarkupSourceLocation _tmp50_;
					gint _tmp51_;
					ValadocMarkupReader* _tmp52_;
					ValadocMarkupSourceLocation _tmp53_;
					gint _tmp54_;
					gchar* _tmp55_;
					gchar* _tmp56_;
					_tmp44_ = reporter;
					_tmp45_ = filename;
					_tmp46_ = begin;
					_tmp47_ = _tmp46_.line;
					_tmp48_ = begin;
					_tmp49_ = _tmp48_.column;
					_tmp50_ = end;
					_tmp51_ = _tmp50_.column;
					_tmp52_ = reader;
					_tmp53_ = begin;
					_tmp54_ = _tmp53_.line;
					_tmp55_ = valadoc_markup_reader_get_line_content (_tmp52_, _tmp54_);
					_tmp56_ = _tmp55_;
					valadoc_error_reporter_error (_tmp44_, _tmp45_, (glong) _tmp47_, (glong) _tmp49_, (glong) _tmp51_, _tmp56_, "missing attribute `id' in <ANCHOR>");
					_g_free0 (_tmp56_);
				}
				_tmp57_ = reader;
				_tmp58_ = valadoc_markup_reader_get_attribute (_tmp57_, "href");
				href = _tmp58_;
				_tmp59_ = href;
				if (_tmp59_ == NULL) {
					ValadocErrorReporter* _tmp60_;
					const gchar* _tmp61_;
					ValadocMarkupSourceLocation _tmp62_;
					gint _tmp63_;
					ValadocMarkupSourceLocation _tmp64_;
					gint _tmp65_;
					ValadocMarkupSourceLocation _tmp66_;
					gint _tmp67_;
					ValadocMarkupReader* _tmp68_;
					ValadocMarkupSourceLocation _tmp69_;
					gint _tmp70_;
					gchar* _tmp71_;
					gchar* _tmp72_;
					_tmp60_ = reporter;
					_tmp61_ = filename;
					_tmp62_ = begin;
					_tmp63_ = _tmp62_.line;
					_tmp64_ = begin;
					_tmp65_ = _tmp64_.column;
					_tmp66_ = end;
					_tmp67_ = _tmp66_.column;
					_tmp68_ = reader;
					_tmp69_ = begin;
					_tmp70_ = _tmp69_.line;
					_tmp71_ = valadoc_markup_reader_get_line_content (_tmp68_, _tmp70_);
					_tmp72_ = _tmp71_;
					valadoc_error_reporter_error (_tmp60_, _tmp61_, (glong) _tmp63_, (glong) _tmp65_, (glong) _tmp67_, _tmp72_, "missing attribute `href' in <ANCHOR>");
					_g_free0 (_tmp72_);
				} else {
					const gchar* _tmp73_;
					_tmp73_ = index_sgml_online;
					if (_tmp73_ != NULL) {
						const gchar* _tmp74_;
						gchar* _tmp75_;
						_tmp74_ = href;
						_tmp75_ = g_path_get_basename (_tmp74_);
						_g_free0 (href);
						href = _tmp75_;
					}
				}
				_tmp76_ = self->priv->map;
				_tmp77_ = id;
				_tmp78_ = base_path;
				_tmp79_ = href;
				_tmp80_ = g_build_path ("/", _tmp78_, _tmp79_, NULL);
				_tmp81_ = _tmp80_;
				vala_map_set ((ValaMap*) _tmp76_, _tmp77_, _tmp81_);
				_g_free0 (_tmp81_);
				_g_free0 (href);
				_g_free0 (id);
			} else {
				ValadocErrorReporter* _tmp82_;
				const gchar* _tmp83_;
				ValadocMarkupSourceLocation _tmp84_;
				gint _tmp85_;
				ValadocMarkupSourceLocation _tmp86_;
				gint _tmp87_;
				ValadocMarkupSourceLocation _tmp88_;
				gint _tmp89_;
				ValadocMarkupReader* _tmp90_;
				ValadocMarkupSourceLocation _tmp91_;
				gint _tmp92_;
				gchar* _tmp93_;
				gchar* _tmp94_;
				_tmp82_ = reporter;
				_tmp83_ = filename;
				_tmp84_ = begin;
				_tmp85_ = _tmp84_.line;
				_tmp86_ = begin;
				_tmp87_ = _tmp86_.column;
				_tmp88_ = end;
				_tmp89_ = _tmp88_.column;
				_tmp90_ = reader;
				_tmp91_ = begin;
				_tmp92_ = _tmp91_.line;
				_tmp93_ = valadoc_markup_reader_get_line_content (_tmp90_, _tmp92_);
				_tmp94_ = _tmp93_;
				valadoc_error_reporter_error (_tmp82_, _tmp83_, (glong) _tmp85_, (glong) _tmp87_, (glong) _tmp89_, _tmp94_, "expected element of <ONLINE> or <ANCHOR>");
				_g_free0 (_tmp94_);
			}
		}
	}
	_g_object_unref0 (reader);
	_g_free0 (base_path);
	_g_free0 (_tmp0_);
}


static void valadoc_importer_value_internal_id_registrar_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void valadoc_importer_value_internal_id_registrar_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		valadoc_importer_internal_id_registrar_unref (value->data[0].v_pointer);
	}
}


static void valadoc_importer_value_internal_id_registrar_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = valadoc_importer_internal_id_registrar_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer valadoc_importer_value_internal_id_registrar_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* valadoc_importer_value_internal_id_registrar_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		ValadocImporterInternalIdRegistrar * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = valadoc_importer_internal_id_registrar_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* valadoc_importer_value_internal_id_registrar_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	ValadocImporterInternalIdRegistrar ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = valadoc_importer_internal_id_registrar_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* valadoc_importer_param_spec_internal_id_registrar (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ValadocImporterParamSpecInternalIdRegistrar* spec;
	g_return_val_if_fail (g_type_is_a (object_type, VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer valadoc_importer_value_get_internal_id_registrar (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR), NULL);
	return value->data[0].v_pointer;
}


void valadoc_importer_value_set_internal_id_registrar (GValue* value, gpointer v_object) {
	ValadocImporterInternalIdRegistrar * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		valadoc_importer_internal_id_registrar_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		valadoc_importer_internal_id_registrar_unref (old);
	}
}


void valadoc_importer_value_take_internal_id_registrar (GValue* value, gpointer v_object) {
	ValadocImporterInternalIdRegistrar * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		valadoc_importer_internal_id_registrar_unref (old);
	}
}


static void valadoc_importer_internal_id_registrar_class_init (ValadocImporterInternalIdRegistrarClass * klass) {
	valadoc_importer_internal_id_registrar_parent_class = g_type_class_peek_parent (klass);
	((ValadocImporterInternalIdRegistrarClass *) klass)->finalize = valadoc_importer_internal_id_registrar_finalize;
	g_type_class_add_private (klass, sizeof (ValadocImporterInternalIdRegistrarPrivate));
}


static void valadoc_importer_internal_id_registrar_instance_init (ValadocImporterInternalIdRegistrar * self) {
	self->priv = VALADOC_IMPORTER_INTERNAL_ID_REGISTRAR_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void valadoc_importer_internal_id_registrar_finalize (ValadocImporterInternalIdRegistrar * obj) {
	ValadocImporterInternalIdRegistrar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_IMPORTER_TYPE_INTERNAL_ID_REGISTRAR, ValadocImporterInternalIdRegistrar);
	g_signal_handlers_destroy (self);
	_vala_map_unref0 (self->priv->symbol_map);
	_vala_map_unref0 (self->priv->map);
}


GType valadoc_importer_internal_id_registrar_get_type (void) {
	static volatile gsize valadoc_importer_internal_id_registrar_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_importer_internal_id_registrar_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { valadoc_importer_value_internal_id_registrar_init, valadoc_importer_value_internal_id_registrar_free_value, valadoc_importer_value_internal_id_registrar_copy_value, valadoc_importer_value_internal_id_registrar_peek_pointer, "p", valadoc_importer_value_internal_id_registrar_collect_value, "p", valadoc_importer_value_internal_id_registrar_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (ValadocImporterInternalIdRegistrarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_importer_internal_id_registrar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocImporterInternalIdRegistrar), 0, (GInstanceInitFunc) valadoc_importer_internal_id_registrar_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType valadoc_importer_internal_id_registrar_type_id;
		valadoc_importer_internal_id_registrar_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ValadocImporterInternalIdRegistrar", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&valadoc_importer_internal_id_registrar_type_id__volatile, valadoc_importer_internal_id_registrar_type_id);
	}
	return valadoc_importer_internal_id_registrar_type_id__volatile;
}


gpointer valadoc_importer_internal_id_registrar_ref (gpointer instance) {
	ValadocImporterInternalIdRegistrar * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void valadoc_importer_internal_id_registrar_unref (gpointer instance) {
	ValadocImporterInternalIdRegistrar * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		VALADOC_IMPORTER_INTERNAL_ID_REGISTRAR_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}



