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

/* taglet.vala
 *
 * Copyright (C) 2008-2009 Didier Villevalois
 * Copyright (C) 2008-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:
 * 	Didier 'Ptitjes Villevalois <ptitjes@free.fr>
 */

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

typedef enum  {
	VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_NORMAL,
	VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_FINISH,
	VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_TYPE
} ValadocTagletsLinkSymbolContext;

#define VALADOC_TAGLETS_LINK_TYPE_SYMBOL_CONTEXT (valadoc_taglets_link_symbol_context_get_type ())
enum  {
	VALADOC_TAGLETS_LINK_0_PROPERTY,
	VALADOC_TAGLETS_LINK_SYMBOL_NAME_PROPERTY,
	VALADOC_TAGLETS_LINK_C_ACCEPT_PLURAL_PROPERTY,
	VALADOC_TAGLETS_LINK_C_IS_PLURAL_PROPERTY,
	VALADOC_TAGLETS_LINK_NUM_PROPERTIES
};
static GParamSpec* valadoc_taglets_link_properties[VALADOC_TAGLETS_LINK_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ValadocTagletsLinkPrivate {
	gchar* _symbol_name;
	gboolean _c_accept_plural;
	gboolean _c_is_plural;
	ValadocTagletsLinkSymbolContext _context;
	ValadocApiNode* _symbol;
};

static gint ValadocTagletsLink_private_offset;
static gpointer valadoc_taglets_link_parent_class = NULL;

static GType valadoc_taglets_link_symbol_context_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
 G_GNUC_INTERNAL void valadoc_taglets_link_set_symbol_name (ValadocTagletsLink* self,
                                           const gchar* value);
 G_GNUC_INTERNAL void valadoc_taglets_link_set_c_accept_plural (ValadocTagletsLink* self,
                                               gboolean value);
static void valadoc_taglets_link_set_c_is_plural (ValadocTagletsLink* self,
                                           gboolean value);
static ValadocRule* valadoc_taglets_link_real_get_parser_rule (ValadocContentInlineTaglet* base,
                                                        ValadocRule* run_rule);
static void __lambda8_ (ValadocTagletsLink* self,
                 ValadocToken* token,
                 GError** error);
static void ___lambda8__valadoc_token_type_action (ValadocToken* token,
                                            gpointer self,
                                            GError** error);
static void __lambda9_ (ValadocTagletsLink* self,
                 ValadocToken* token,
                 GError** error);
static void ___lambda9__valadoc_token_type_action (ValadocToken* token,
                                            gpointer self,
                                            GError** error);
static void __lambda10_ (ValadocTagletsLink* self,
                  ValadocToken* token,
                  GError** error);
static void ___lambda10__valadoc_token_type_action (ValadocToken* token,
                                             gpointer self,
                                             GError** error);
static void valadoc_taglets_link_real_check (ValadocContentContentElement* base,
                                      ValadocApiTree* api_root,
                                      ValadocApiNode* container,
                                      const gchar* file_path,
                                      ValadocErrorReporter* reporter,
                                      ValadocSettings* settings);
static ValadocContentContentElement* valadoc_taglets_link_real_produce_content (ValadocContentInlineTaglet* base);
 G_GNUC_INTERNAL ValadocContentSymbolLink* valadoc_content_symbol_link_new (ValadocApiNode* symbol,
                                                           const gchar* given_symbol_name);
 G_GNUC_INTERNAL ValadocContentSymbolLink* valadoc_content_symbol_link_construct (GType object_type,
                                                                 ValadocApiNode* symbol,
                                                                 const gchar* given_symbol_name);
 G_GNUC_INTERNAL ValadocContentRun* valadoc_content_run_new (ValadocContentRunStyle style);
 G_GNUC_INTERNAL ValadocContentRun* valadoc_content_run_construct (GType object_type,
                                                  ValadocContentRunStyle style);
 G_GNUC_INTERNAL ValadocContentText* valadoc_content_text_new (const gchar* text);
 G_GNUC_INTERNAL ValadocContentText* valadoc_content_text_construct (GType object_type,
                                                    const gchar* text);
static gboolean valadoc_taglets_link_real_is_empty (ValadocContentContentElement* base);
static ValadocContentContentElement* valadoc_taglets_link_real_copy (ValadocContentContentElement* base,
                                                              ValadocContentContentElement* new_parent);
 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
                                                 ValadocContentContentElement* value);
static void valadoc_taglets_link_finalize (GObject * obj);
static GType valadoc_taglets_link_get_type_once (void);
static void _vala_valadoc_taglets_link_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec);
static void _vala_valadoc_taglets_link_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
valadoc_taglets_link_get_instance_private (ValadocTagletsLink* self)
{
	return G_STRUCT_MEMBER_P (self, ValadocTagletsLink_private_offset);
}

static GType
valadoc_taglets_link_symbol_context_get_type_once (void)
{
	static const GEnumValue values[] = {{VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_NORMAL, "VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_NORMAL", "normal"}, {VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_FINISH, "VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_FINISH", "finish"}, {VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_TYPE, "VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_TYPE", "type"}, {0, NULL, NULL}};
	GType valadoc_taglets_link_symbol_context_type_id;
	valadoc_taglets_link_symbol_context_type_id = g_enum_register_static ("ValadocTagletsLinkSymbolContext", values);
	return valadoc_taglets_link_symbol_context_type_id;
}

static GType
valadoc_taglets_link_symbol_context_get_type (void)
{
	static volatile gsize valadoc_taglets_link_symbol_context_type_id__once = 0;
	if (g_once_init_enter (&valadoc_taglets_link_symbol_context_type_id__once)) {
		GType valadoc_taglets_link_symbol_context_type_id;
		valadoc_taglets_link_symbol_context_type_id = valadoc_taglets_link_symbol_context_get_type_once ();
		g_once_init_leave (&valadoc_taglets_link_symbol_context_type_id__once, valadoc_taglets_link_symbol_context_type_id);
	}
	return valadoc_taglets_link_symbol_context_type_id__once;
}

const gchar*
valadoc_taglets_link_get_symbol_name (ValadocTagletsLink* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_symbol_name;
	result = _tmp0_;
	return result;
}

 G_GNUC_INTERNAL void
valadoc_taglets_link_set_symbol_name (ValadocTagletsLink* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_taglets_link_get_symbol_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_symbol_name);
		self->priv->_symbol_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_taglets_link_properties[VALADOC_TAGLETS_LINK_SYMBOL_NAME_PROPERTY]);
	}
}

gboolean
valadoc_taglets_link_get_c_accept_plural (ValadocTagletsLink* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_c_accept_plural;
	return result;
}

 G_GNUC_INTERNAL void
valadoc_taglets_link_set_c_accept_plural (ValadocTagletsLink* self,
                                          gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_taglets_link_get_c_accept_plural (self);
	if (old_value != value) {
		self->priv->_c_accept_plural = value;
		g_object_notify_by_pspec ((GObject *) self, valadoc_taglets_link_properties[VALADOC_TAGLETS_LINK_C_ACCEPT_PLURAL_PROPERTY]);
	}
}

gboolean
valadoc_taglets_link_get_c_is_plural (ValadocTagletsLink* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_c_is_plural;
	return result;
}

static void
valadoc_taglets_link_set_c_is_plural (ValadocTagletsLink* self,
                                      gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_taglets_link_get_c_is_plural (self);
	if (old_value != value) {
		self->priv->_c_is_plural = value;
		g_object_notify_by_pspec ((GObject *) self, valadoc_taglets_link_properties[VALADOC_TAGLETS_LINK_C_IS_PLURAL_PROPERTY]);
	}
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
__lambda8_ (ValadocTagletsLink* self,
            ValadocToken* token,
            GError** error)
{
	const gchar* _tmp0_;
	g_return_if_fail (token != NULL);
	_tmp0_ = valadoc_token_to_string (token);
	valadoc_taglets_link_set_symbol_name (self, _tmp0_);
}

static void
___lambda8__valadoc_token_type_action (ValadocToken* token,
                                       gpointer self,
                                       GError** error)
{
	__lambda8_ ((ValadocTagletsLink*) self, token, error);
}

static void
__lambda9_ (ValadocTagletsLink* self,
            ValadocToken* token,
            GError** error)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (token != NULL);
	_tmp0_ = self->priv->_symbol_name;
	_tmp1_ = valadoc_token_to_string (token);
	_tmp2_ = g_strconcat (_tmp0_, _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	valadoc_taglets_link_set_symbol_name (self, _tmp3_);
	_g_free0 (_tmp3_);
}

static void
___lambda9__valadoc_token_type_action (ValadocToken* token,
                                       gpointer self,
                                       GError** error)
{
	__lambda9_ ((ValadocTagletsLink*) self, token, error);
}

static void
__lambda10_ (ValadocTagletsLink* self,
             ValadocToken* token,
             GError** error)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (token != NULL);
	_tmp0_ = self->priv->_symbol_name;
	_tmp1_ = valadoc_token_to_string (token);
	_tmp2_ = g_strconcat (_tmp0_, _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	valadoc_taglets_link_set_symbol_name (self, _tmp3_);
	_g_free0 (_tmp3_);
}

static void
___lambda10__valadoc_token_type_action (ValadocToken* token,
                                        gpointer self,
                                        GError** error)
{
	__lambda10_ ((ValadocTagletsLink*) self, token, error);
}

static ValadocRule*
valadoc_taglets_link_real_get_parser_rule (ValadocContentInlineTaglet* base,
                                           ValadocRule* run_rule)
{
	ValadocTagletsLink * self;
	ValadocTokenType* _tmp0_;
	GObject* _tmp1_;
	ValadocTokenType* _tmp2_;
	GObject* _tmp3_;
	GObject** _tmp4_;
	GObject** _tmp5_;
	gint _tmp5__length1;
	ValadocRule* _tmp6_;
	GObject** _tmp7_;
	GObject** _tmp8_;
	gint _tmp8__length1;
	ValadocRule* _tmp9_;
	GObject** _tmp10_;
	GObject** _tmp11_;
	gint _tmp11__length1;
	ValadocRule* _tmp12_;
	ValadocTokenType* _tmp13_;
	ValadocTokenType* _tmp14_;
	ValadocTokenType* _tmp15_;
	ValadocTokenType* _tmp16_;
	ValadocTokenType* _tmp17_;
	ValadocTokenType* _tmp18_;
	ValadocTokenType* _tmp19_;
	ValadocTokenType* _tmp20_;
	GObject** _tmp21_;
	GObject** _tmp22_;
	gint _tmp22__length1;
	ValadocRule* _tmp23_;
	GObject** _tmp24_;
	GObject** _tmp25_;
	gint _tmp25__length1;
	ValadocRule* _tmp26_;
	GObject** _tmp27_;
	GObject** _tmp28_;
	gint _tmp28__length1;
	ValadocRule* _tmp29_;
	GObject** _tmp30_;
	GObject** _tmp31_;
	gint _tmp31__length1;
	ValadocRule* _tmp32_;
	ValadocRule* _tmp33_;
	ValadocRule* result;
	self = (ValadocTagletsLink*) base;
	g_return_val_if_fail (run_rule != NULL, NULL);
	_tmp0_ = valadoc_token_type_SPACE;
	_tmp1_ = _g_object_ref0 ((GObject*) _tmp0_);
	_tmp2_ = valadoc_token_type_EOL;
	_tmp3_ = _g_object_ref0 ((GObject*) _tmp2_);
	_tmp4_ = g_new0 (GObject*, 2 + 1);
	_tmp4_[0] = _tmp1_;
	_tmp4_[1] = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp5__length1 = 2;
	_tmp6_ = valadoc_rule_one_of (_tmp5_, (gint) 2);
	_tmp7_ = g_new0 (GObject*, 1 + 1);
	_tmp7_[0] = (GObject*) _tmp6_;
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 1;
	_tmp9_ = valadoc_rule_many (_tmp8_, (gint) 1);
	_tmp10_ = g_new0 (GObject*, 1 + 1);
	_tmp10_[0] = (GObject*) _tmp9_;
	_tmp11_ = _tmp10_;
	_tmp11__length1 = 1;
	_tmp12_ = valadoc_rule_option (_tmp11_, (gint) 1);
	_tmp13_ = valadoc_token_type_any_word ();
	_tmp14_ = _tmp13_;
	_tmp15_ = valadoc_token_type_action (_tmp14_, ___lambda8__valadoc_token_type_action, self);
	_tmp16_ = valadoc_token_type_any_word ();
	_tmp17_ = _tmp16_;
	_tmp18_ = valadoc_token_type_action (_tmp17_, ___lambda9__valadoc_token_type_action, self);
	_tmp19_ = valadoc_token_type_MINUS;
	_tmp20_ = valadoc_token_type_action (_tmp19_, ___lambda10__valadoc_token_type_action, self);
	_tmp21_ = g_new0 (GObject*, 2 + 1);
	_tmp21_[0] = (GObject*) _tmp18_;
	_tmp21_[1] = (GObject*) _tmp20_;
	_tmp22_ = _tmp21_;
	_tmp22__length1 = 2;
	_tmp23_ = valadoc_rule_one_of (_tmp22_, (gint) 2);
	_tmp24_ = g_new0 (GObject*, 1 + 1);
	_tmp24_[0] = (GObject*) _tmp23_;
	_tmp25_ = _tmp24_;
	_tmp25__length1 = 1;
	_tmp26_ = valadoc_rule_many (_tmp25_, (gint) 1);
	_tmp27_ = g_new0 (GObject*, 1 + 1);
	_tmp27_[0] = (GObject*) _tmp26_;
	_tmp28_ = _tmp27_;
	_tmp28__length1 = 1;
	_tmp29_ = valadoc_rule_option (_tmp28_, (gint) 1);
	_tmp30_ = g_new0 (GObject*, 3 + 1);
	_tmp30_[0] = (GObject*) _tmp12_;
	_tmp30_[1] = (GObject*) _tmp15_;
	_tmp30_[2] = (GObject*) _tmp29_;
	_tmp31_ = _tmp30_;
	_tmp31__length1 = 3;
	_tmp32_ = valadoc_rule_seq (_tmp31_, (gint) 3);
	_tmp33_ = _tmp32_;
	_tmp31_ = (_vala_array_free (_tmp31_, _tmp31__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp28_ = (_vala_array_free (_tmp28_, _tmp28__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp25_ = (_vala_array_free (_tmp25_, _tmp25__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp22_ = (_vala_array_free (_tmp22_, _tmp22__length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (_tmp17_);
	_g_object_unref0 (_tmp14_);
	_tmp11_ = (_vala_array_free (_tmp11_, _tmp11__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_object_unref), NULL);
	_tmp5_ = (_vala_array_free (_tmp5_, _tmp5__length1, (GDestroyNotify) g_object_unref), NULL);
	result = _tmp33_;
	return result;
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static void
valadoc_taglets_link_real_check (ValadocContentContentElement* base,
                                 ValadocApiTree* api_root,
                                 ValadocApiNode* container,
                                 const gchar* file_path,
                                 ValadocErrorReporter* reporter,
                                 ValadocSettings* settings)
{
	ValadocTagletsLink * self;
	const gchar* _tmp0_;
	gboolean _tmp61_ = FALSE;
	ValadocApiNode* _tmp62_;
	self = (ValadocTagletsLink*) base;
	g_return_if_fail (api_root != NULL);
	g_return_if_fail (container != NULL);
	g_return_if_fail (file_path != NULL);
	g_return_if_fail (reporter != NULL);
	g_return_if_fail (settings != NULL);
	_tmp0_ = self->priv->_symbol_name;
	if (g_str_has_prefix (_tmp0_, "c::")) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_ = NULL;
		gboolean _tmp4_ = FALSE;
		gboolean _tmp5_;
		gchar* singular_symbol_name = NULL;
		gchar* _tmp12_;
		const gchar* _tmp13_;
		ValadocApiNode* _tmp14_;
		gboolean _tmp15_ = FALSE;
		ValadocApiNode* _tmp16_;
		gboolean _tmp20_ = FALSE;
		ValadocApiNode* _tmp21_;
		ValadocApiNode* _tmp46_;
		ValadocApiNode* _tmp55_;
		_tmp1_ = self->priv->_symbol_name;
		_tmp2_ = string_substring (_tmp1_, (glong) 3, (glong) -1);
		_g_free0 (self->priv->_symbol_name);
		self->priv->_symbol_name = _tmp2_;
		_tmp5_ = self->priv->_c_accept_plural;
		if (_tmp5_) {
			const gchar* _tmp6_;
			_tmp6_ = self->priv->_symbol_name;
			_tmp4_ = g_str_has_suffix (_tmp6_, "s");
		} else {
			_tmp4_ = FALSE;
		}
		if (_tmp4_) {
			const gchar* _tmp7_;
			const gchar* _tmp8_;
			gint _tmp9_;
			gint _tmp10_;
			gchar* _tmp11_;
			_tmp7_ = self->priv->_symbol_name;
			_tmp8_ = self->priv->_symbol_name;
			_tmp9_ = strlen (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = string_substring (_tmp7_, (glong) 0, (glong) (_tmp10_ - 1));
			_g_free0 (_tmp3_);
			_tmp3_ = _tmp11_;
		} else {
			_g_free0 (_tmp3_);
			_tmp3_ = NULL;
		}
		_tmp12_ = g_strdup (_tmp3_);
		singular_symbol_name = _tmp12_;
		_tmp13_ = self->priv->_symbol_name;
		_tmp14_ = valadoc_api_tree_search_symbol_cstr (api_root, container, _tmp13_);
		_g_object_unref0 (self->priv->_symbol);
		self->priv->_symbol = _tmp14_;
		_tmp16_ = self->priv->_symbol;
		if (_tmp16_ == NULL) {
			const gchar* _tmp17_;
			_tmp17_ = singular_symbol_name;
			_tmp15_ = _tmp17_ != NULL;
		} else {
			_tmp15_ = FALSE;
		}
		if (_tmp15_) {
			const gchar* _tmp18_;
			ValadocApiNode* _tmp19_;
			_tmp18_ = singular_symbol_name;
			_tmp19_ = valadoc_api_tree_search_symbol_cstr (api_root, container, _tmp18_);
			_g_object_unref0 (self->priv->_symbol);
			self->priv->_symbol = _tmp19_;
			valadoc_taglets_link_set_c_is_plural (self, TRUE);
		}
		self->priv->_context = VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_NORMAL;
		_tmp21_ = self->priv->_symbol;
		if (_tmp21_ == NULL) {
			const gchar* _tmp22_;
			_tmp22_ = self->priv->_symbol_name;
			_tmp20_ = g_str_has_suffix (_tmp22_, "_finish");
		} else {
			_tmp20_ = FALSE;
		}
		if (_tmp20_) {
			gchar* tmp = NULL;
			const gchar* _tmp23_;
			const gchar* _tmp24_;
			gint _tmp25_;
			gint _tmp26_;
			gchar* _tmp27_;
			const gchar* _tmp28_;
			gchar* _tmp29_;
			gchar* _tmp30_;
			ValadocApiNode* _tmp31_;
			ValadocApiMethod* _tmp32_;
			gboolean _tmp33_ = FALSE;
			ValadocApiNode* _tmp34_;
			_tmp23_ = self->priv->_symbol_name;
			_tmp24_ = self->priv->_symbol_name;
			_tmp25_ = strlen (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = string_substring (_tmp23_, (glong) 0, (glong) (_tmp26_ - 7));
			tmp = _tmp27_;
			_tmp28_ = tmp;
			_tmp29_ = g_strconcat (_tmp28_, "_async", NULL);
			_tmp30_ = _tmp29_;
			_tmp31_ = valadoc_api_tree_search_symbol_cstr (api_root, container, _tmp30_);
			_tmp32_ = VALADOC_API_IS_METHOD (_tmp31_) ? ((ValadocApiMethod*) _tmp31_) : NULL;
			if (_tmp32_ == NULL) {
				_g_object_unref0 (_tmp31_);
			}
			_g_object_unref0 (self->priv->_symbol);
			self->priv->_symbol = (ValadocApiNode*) _tmp32_;
			_g_free0 (_tmp30_);
			_tmp34_ = self->priv->_symbol;
			if (_tmp34_ != NULL) {
				ValadocApiNode* _tmp35_;
				gboolean _tmp36_;
				gboolean _tmp37_;
				_tmp35_ = self->priv->_symbol;
				_tmp36_ = valadoc_api_method_get_is_yields (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, VALADOC_API_TYPE_METHOD, ValadocApiMethod));
				_tmp37_ = _tmp36_;
				_tmp33_ = _tmp37_;
			} else {
				_tmp33_ = FALSE;
			}
			if (_tmp33_) {
				self->priv->_context = VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_FINISH;
			} else {
				const gchar* _tmp38_;
				ValadocApiNode* _tmp39_;
				ValadocApiMethod* _tmp40_;
				gboolean _tmp41_ = FALSE;
				ValadocApiNode* _tmp42_;
				_tmp38_ = tmp;
				_tmp39_ = valadoc_api_tree_search_symbol_cstr (api_root, container, _tmp38_);
				_tmp40_ = VALADOC_API_IS_METHOD (_tmp39_) ? ((ValadocApiMethod*) _tmp39_) : NULL;
				if (_tmp40_ == NULL) {
					_g_object_unref0 (_tmp39_);
				}
				_g_object_unref0 (self->priv->_symbol);
				self->priv->_symbol = (ValadocApiNode*) _tmp40_;
				_tmp42_ = self->priv->_symbol;
				if (_tmp42_ != NULL) {
					ValadocApiNode* _tmp43_;
					gboolean _tmp44_;
					gboolean _tmp45_;
					_tmp43_ = self->priv->_symbol;
					_tmp44_ = valadoc_api_method_get_is_yields (G_TYPE_CHECK_INSTANCE_CAST (_tmp43_, VALADOC_API_TYPE_METHOD, ValadocApiMethod));
					_tmp45_ = _tmp44_;
					_tmp41_ = _tmp45_;
				} else {
					_tmp41_ = FALSE;
				}
				if (_tmp41_) {
					self->priv->_context = VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_FINISH;
				} else {
					_g_object_unref0 (self->priv->_symbol);
					self->priv->_symbol = NULL;
				}
			}
			_g_free0 (tmp);
		}
		_tmp46_ = self->priv->_symbol;
		if (_tmp46_ == NULL) {
			const gchar* _tmp47_;
			ValadocApiTypeSymbol* _tmp48_;
			gboolean _tmp49_ = FALSE;
			ValadocApiNode* _tmp50_;
			ValadocApiNode* _tmp54_;
			_tmp47_ = self->priv->_symbol_name;
			_tmp48_ = valadoc_api_tree_search_symbol_type_cstr (api_root, _tmp47_);
			_g_object_unref0 (self->priv->_symbol);
			self->priv->_symbol = (ValadocApiNode*) _tmp48_;
			_tmp50_ = self->priv->_symbol;
			if (_tmp50_ == NULL) {
				const gchar* _tmp51_;
				_tmp51_ = singular_symbol_name;
				_tmp49_ = _tmp51_ != NULL;
			} else {
				_tmp49_ = FALSE;
			}
			if (_tmp49_) {
				const gchar* _tmp52_;
				ValadocApiTypeSymbol* _tmp53_;
				_tmp52_ = singular_symbol_name;
				_tmp53_ = valadoc_api_tree_search_symbol_type_cstr (api_root, _tmp52_);
				_g_object_unref0 (self->priv->_symbol);
				self->priv->_symbol = (ValadocApiNode*) _tmp53_;
				valadoc_taglets_link_set_c_is_plural (self, TRUE);
			}
			_tmp54_ = self->priv->_symbol;
			if (_tmp54_ != NULL) {
				self->priv->_context = VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_TYPE;
			}
		}
		_tmp55_ = self->priv->_symbol;
		if (_tmp55_ != NULL) {
			ValadocApiNode* _tmp56_;
			const gchar* _tmp57_;
			const gchar* _tmp58_;
			_tmp56_ = self->priv->_symbol;
			_tmp57_ = valadoc_api_node_get_name (_tmp56_);
			_tmp58_ = _tmp57_;
			valadoc_taglets_link_set_symbol_name (self, _tmp58_);
		}
		_g_free0 (singular_symbol_name);
		_g_free0 (_tmp3_);
	} else {
		const gchar* _tmp59_;
		ValadocApiNode* _tmp60_;
		_tmp59_ = self->priv->_symbol_name;
		_tmp60_ = valadoc_api_tree_search_symbol_str (api_root, container, _tmp59_);
		_g_object_unref0 (self->priv->_symbol);
		self->priv->_symbol = _tmp60_;
	}
	_tmp62_ = self->priv->_symbol;
	if (_tmp62_ == NULL) {
		const gchar* _tmp63_;
		_tmp63_ = self->priv->_symbol_name;
		_tmp61_ = g_strcmp0 (_tmp63_, "main") != 0;
	} else {
		_tmp61_ = FALSE;
	}
	if (_tmp61_) {
		gchar* _tmp64_ = NULL;
		gchar* node_segment = NULL;
		gchar* _tmp69_;
		const gchar* _tmp70_;
		gchar* _tmp71_;
		gchar* _tmp72_;
		const gchar* _tmp73_;
		if (VALADOC_API_IS_PACKAGE (container)) {
			gchar* _tmp65_;
			_tmp65_ = g_strdup ("");
			_g_free0 (_tmp64_);
			_tmp64_ = _tmp65_;
		} else {
			gchar* _tmp66_;
			gchar* _tmp67_;
			gchar* _tmp68_;
			_tmp66_ = valadoc_api_node_get_full_name (container);
			_tmp67_ = _tmp66_;
			_tmp68_ = g_strconcat (_tmp67_, ": ", NULL);
			_g_free0 (_tmp64_);
			_tmp64_ = _tmp68_;
			_g_free0 (_tmp67_);
		}
		_tmp69_ = g_strdup (_tmp64_);
		node_segment = _tmp69_;
		_tmp70_ = node_segment;
		_tmp71_ = g_strdup_printf ("%s: %s@link", file_path, _tmp70_);
		_tmp72_ = _tmp71_;
		_tmp73_ = self->priv->_symbol_name;
		valadoc_error_reporter_simple_warning (reporter, _tmp72_, "`%s' does not exist", _tmp73_);
		_g_free0 (_tmp72_);
		_g_free0 (node_segment);
		_g_free0 (_tmp64_);
	}
	VALADOC_CONTENT_CONTENT_ELEMENT_CLASS (valadoc_taglets_link_parent_class)->check ((ValadocContentContentElement*) G_TYPE_CHECK_INSTANCE_CAST (self, VALADOC_CONTENT_TYPE_INLINE_TAGLET, ValadocContentInlineTaglet), api_root, container, file_path, reporter, settings);
}

static ValadocContentContentElement*
valadoc_taglets_link_real_produce_content (ValadocContentInlineTaglet* base)
{
	ValadocTagletsLink * self;
	ValadocContentSymbolLink* link = NULL;
	ValadocContentSymbolLink* _tmp0_;
	ValadocContentSymbolLink* _tmp1_;
	ValadocApiNode* _tmp2_;
	ValadocContentSymbolLink* _tmp3_;
	const gchar* _tmp4_;
	ValadocContentInline* content = NULL;
	gboolean _tmp42_;
	ValadocContentContentElement* result;
	self = (ValadocTagletsLink*) base;
	_tmp0_ = valadoc_content_symbol_link_new (NULL, NULL);
	link = _tmp0_;
	_tmp1_ = link;
	_tmp2_ = self->priv->_symbol;
	valadoc_content_symbol_link_set_symbol (_tmp1_, _tmp2_);
	_tmp3_ = link;
	_tmp4_ = self->priv->_symbol_name;
	valadoc_content_symbol_link_set_given_symbol_name (_tmp3_, _tmp4_);
	switch (self->priv->_context) {
		case VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_FINISH:
		{
			ValadocContentSymbolLink* _tmp5_;
			ValadocContentSymbolLink* _tmp6_;
			const gchar* _tmp7_;
			const gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			ValadocContentSymbolLink* _tmp11_;
			ValadocContentInline* _tmp12_;
			_tmp5_ = link;
			_tmp6_ = link;
			_tmp7_ = valadoc_content_symbol_link_get_given_symbol_name (_tmp6_);
			_tmp8_ = _tmp7_;
			_tmp9_ = g_strconcat (_tmp8_, ".end", NULL);
			_tmp10_ = _tmp9_;
			valadoc_content_symbol_link_set_given_symbol_name (_tmp6_, _tmp10_);
			_g_free0 (_tmp10_);
			_tmp11_ = link;
			_tmp12_ = _g_object_ref0 ((ValadocContentInline*) _tmp11_);
			_g_object_unref0 (content);
			content = _tmp12_;
			break;
		}
		case VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_TYPE:
		{
			ValadocContentRun* run = NULL;
			ValadocContentRun* _tmp13_;
			ValadocContentRun* _tmp14_;
			ValadocContentInline* _tmp15_;
			ValadocContentRun* keyword = NULL;
			ValadocContentRun* _tmp16_;
			ValadocContentRun* _tmp17_;
			ValaList* _tmp18_;
			ValaList* _tmp19_;
			ValadocContentText* _tmp20_;
			ValadocContentText* _tmp21_;
			ValadocContentRun* _tmp22_;
			ValaList* _tmp23_;
			ValaList* _tmp24_;
			ValadocContentRun* _tmp25_;
			ValadocContentRun* _tmp26_;
			ValaList* _tmp27_;
			ValaList* _tmp28_;
			ValadocContentText* _tmp29_;
			ValadocContentText* _tmp30_;
			ValadocContentRun* _tmp31_;
			ValaList* _tmp32_;
			ValaList* _tmp33_;
			ValadocContentSymbolLink* _tmp34_;
			ValadocContentRun* _tmp35_;
			ValaList* _tmp36_;
			ValaList* _tmp37_;
			ValadocContentText* _tmp38_;
			ValadocContentText* _tmp39_;
			_tmp13_ = valadoc_content_run_new (VALADOC_CONTENT_RUN_STYLE_MONOSPACED);
			run = _tmp13_;
			_tmp14_ = run;
			_tmp15_ = _g_object_ref0 ((ValadocContentInline*) _tmp14_);
			_g_object_unref0 (content);
			content = _tmp15_;
			_tmp16_ = valadoc_content_run_new (VALADOC_CONTENT_RUN_STYLE_LANG_KEYWORD);
			keyword = _tmp16_;
			_tmp17_ = keyword;
			_tmp18_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp17_);
			_tmp19_ = _tmp18_;
			_tmp20_ = valadoc_content_text_new ("typeof");
			_tmp21_ = _tmp20_;
			vala_collection_add ((ValaCollection*) _tmp19_, (ValadocContentInline*) _tmp21_);
			_g_object_unref0 (_tmp21_);
			_tmp22_ = run;
			_tmp23_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = keyword;
			vala_collection_add ((ValaCollection*) _tmp24_, (ValadocContentInline*) _tmp25_);
			_tmp26_ = run;
			_tmp27_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = valadoc_content_text_new (" (");
			_tmp30_ = _tmp29_;
			vala_collection_add ((ValaCollection*) _tmp28_, (ValadocContentInline*) _tmp30_);
			_g_object_unref0 (_tmp30_);
			_tmp31_ = run;
			_tmp32_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = link;
			vala_collection_add ((ValaCollection*) _tmp33_, (ValadocContentInline*) _tmp34_);
			_tmp35_ = run;
			_tmp36_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = valadoc_content_text_new (")");
			_tmp39_ = _tmp38_;
			vala_collection_add ((ValaCollection*) _tmp37_, (ValadocContentInline*) _tmp39_);
			_g_object_unref0 (_tmp39_);
			_g_object_unref0 (keyword);
			_g_object_unref0 (run);
			break;
		}
		default:
		{
			ValadocContentSymbolLink* _tmp40_;
			ValadocContentInline* _tmp41_;
			_tmp40_ = link;
			_tmp41_ = _g_object_ref0 ((ValadocContentInline*) _tmp40_);
			_g_object_unref0 (content);
			content = _tmp41_;
			break;
		}
	}
	_tmp42_ = self->priv->_c_is_plural;
	if (_tmp42_ == TRUE) {
		ValadocContentRun* run = NULL;
		ValadocContentRun* _tmp43_;
		ValadocContentRun* _tmp44_;
		ValaList* _tmp45_;
		ValaList* _tmp46_;
		ValadocContentInline* _tmp47_;
		ValadocContentRun* _tmp48_;
		ValaList* _tmp49_;
		ValaList* _tmp50_;
		ValadocContentText* _tmp51_;
		ValadocContentText* _tmp52_;
		_tmp43_ = valadoc_content_run_new (VALADOC_CONTENT_RUN_STYLE_NONE);
		run = _tmp43_;
		_tmp44_ = run;
		_tmp45_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp44_);
		_tmp46_ = _tmp45_;
		_tmp47_ = content;
		vala_collection_add ((ValaCollection*) _tmp46_, _tmp47_);
		_tmp48_ = run;
		_tmp49_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp48_);
		_tmp50_ = _tmp49_;
		_tmp51_ = valadoc_content_text_new ("s");
		_tmp52_ = _tmp51_;
		vala_collection_add ((ValaCollection*) _tmp50_, (ValadocContentInline*) _tmp52_);
		_g_object_unref0 (_tmp52_);
		result = (ValadocContentContentElement*) run;
		_g_object_unref0 (content);
		_g_object_unref0 (link);
		return result;
	}
	result = (ValadocContentContentElement*) content;
	_g_object_unref0 (link);
	return result;
}

static gboolean
valadoc_taglets_link_real_is_empty (ValadocContentContentElement* base)
{
	ValadocTagletsLink * self;
	gboolean result;
	self = (ValadocTagletsLink*) base;
	result = FALSE;
	return result;
}

static ValadocContentContentElement*
valadoc_taglets_link_real_copy (ValadocContentContentElement* base,
                                ValadocContentContentElement* new_parent)
{
	ValadocTagletsLink * self;
	ValadocTagletsLink* link = NULL;
	ValadocTagletsLink* _tmp0_;
	ValadocSettings* _tmp1_;
	ValadocSettings* _tmp2_;
	ValadocResourceLocator* _tmp3_;
	ValadocResourceLocator* _tmp4_;
	const gchar* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	ValadocApiNode* _tmp8_;
	ValadocApiNode* _tmp9_;
	ValadocContentContentElement* result;
	self = (ValadocTagletsLink*) base;
	_tmp0_ = valadoc_taglets_link_new ();
	link = _tmp0_;
	valadoc_content_content_element_set_parent ((ValadocContentContentElement*) link, new_parent);
	_tmp1_ = ((ValadocContentInlineTaglet*) self)->settings;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (((ValadocContentInlineTaglet*) link)->settings);
	((ValadocContentInlineTaglet*) link)->settings = _tmp2_;
	_tmp3_ = ((ValadocContentInlineTaglet*) self)->locator;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (((ValadocContentInlineTaglet*) link)->locator);
	((ValadocContentInlineTaglet*) link)->locator = _tmp4_;
	_tmp5_ = self->priv->_symbol_name;
	valadoc_taglets_link_set_symbol_name (link, _tmp5_);
	_tmp6_ = self->priv->_c_accept_plural;
	valadoc_taglets_link_set_c_accept_plural (link, _tmp6_);
	_tmp7_ = self->priv->_c_is_plural;
	valadoc_taglets_link_set_c_is_plural (link, _tmp7_);
	link->priv->_context = self->priv->_context;
	_tmp8_ = self->priv->_symbol;
	_tmp9_ = _g_object_ref0 (_tmp8_);
	_g_object_unref0 (link->priv->_symbol);
	link->priv->_symbol = _tmp9_;
	result = (ValadocContentContentElement*) link;
	return result;
}

ValadocTagletsLink*
valadoc_taglets_link_construct (GType object_type)
{
	ValadocTagletsLink * self = NULL;
	self = (ValadocTagletsLink*) valadoc_content_inline_taglet_construct (object_type);
	return self;
}

ValadocTagletsLink*
valadoc_taglets_link_new (void)
{
	return valadoc_taglets_link_construct (VALADOC_TAGLETS_TYPE_LINK);
}

static void
valadoc_taglets_link_class_init (ValadocTagletsLinkClass * klass,
                                 gpointer klass_data)
{
	valadoc_taglets_link_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ValadocTagletsLink_private_offset);
	((ValadocContentInlineTagletClass *) klass)->get_parser_rule = (ValadocRule* (*) (ValadocContentInlineTaglet*, ValadocRule*)) valadoc_taglets_link_real_get_parser_rule;
	((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_taglets_link_real_check;
	((ValadocContentInlineTagletClass *) klass)->produce_content = (ValadocContentContentElement* (*) (ValadocContentInlineTaglet*)) valadoc_taglets_link_real_produce_content;
	((ValadocContentContentElementClass *) klass)->is_empty = (gboolean (*) (ValadocContentContentElement*)) valadoc_taglets_link_real_is_empty;
	((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_taglets_link_real_copy;
	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_taglets_link_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_taglets_link_set_property;
	G_OBJECT_CLASS (klass)->finalize = valadoc_taglets_link_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_TAGLETS_LINK_SYMBOL_NAME_PROPERTY, valadoc_taglets_link_properties[VALADOC_TAGLETS_LINK_SYMBOL_NAME_PROPERTY] = g_param_spec_string ("symbol-name", "symbol-name", "symbol-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * Accept leading 's', e.g. #Widgets
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_TAGLETS_LINK_C_ACCEPT_PLURAL_PROPERTY, valadoc_taglets_link_properties[VALADOC_TAGLETS_LINK_C_ACCEPT_PLURAL_PROPERTY] = g_param_spec_boolean ("c-accept-plural", "c-accept-plural", "c-accept-plural", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * True if symbol_name could only be resolved after removing 's'
	 *
	 * E.g. true or #Widgets, false for #Widget
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_TAGLETS_LINK_C_IS_PLURAL_PROPERTY, valadoc_taglets_link_properties[VALADOC_TAGLETS_LINK_C_IS_PLURAL_PROPERTY] = g_param_spec_boolean ("c-is-plural", "c-is-plural", "c-is-plural", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
valadoc_taglets_link_instance_init (ValadocTagletsLink * self,
                                    gpointer klass)
{
	self->priv = valadoc_taglets_link_get_instance_private (self);
	self->priv->_context = VALADOC_TAGLETS_LINK_SYMBOL_CONTEXT_NORMAL;
}

static void
valadoc_taglets_link_finalize (GObject * obj)
{
	ValadocTagletsLink * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_TAGLETS_TYPE_LINK, ValadocTagletsLink);
	_g_free0 (self->priv->_symbol_name);
	_g_object_unref0 (self->priv->_symbol);
	G_OBJECT_CLASS (valadoc_taglets_link_parent_class)->finalize (obj);
}

static GType
valadoc_taglets_link_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValadocTagletsLinkClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_taglets_link_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocTagletsLink), 0, (GInstanceInitFunc) valadoc_taglets_link_instance_init, NULL };
	GType valadoc_taglets_link_type_id;
	valadoc_taglets_link_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_INLINE_TAGLET, "ValadocTagletsLink", &g_define_type_info, 0);
	ValadocTagletsLink_private_offset = g_type_add_instance_private (valadoc_taglets_link_type_id, sizeof (ValadocTagletsLinkPrivate));
	return valadoc_taglets_link_type_id;
}

GType
valadoc_taglets_link_get_type (void)
{
	static volatile gsize valadoc_taglets_link_type_id__once = 0;
	if (g_once_init_enter (&valadoc_taglets_link_type_id__once)) {
		GType valadoc_taglets_link_type_id;
		valadoc_taglets_link_type_id = valadoc_taglets_link_get_type_once ();
		g_once_init_leave (&valadoc_taglets_link_type_id__once, valadoc_taglets_link_type_id);
	}
	return valadoc_taglets_link_type_id__once;
}

static void
_vala_valadoc_taglets_link_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec)
{
	ValadocTagletsLink * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_TAGLETS_TYPE_LINK, ValadocTagletsLink);
	switch (property_id) {
		case VALADOC_TAGLETS_LINK_SYMBOL_NAME_PROPERTY:
		g_value_set_string (value, valadoc_taglets_link_get_symbol_name (self));
		break;
		case VALADOC_TAGLETS_LINK_C_ACCEPT_PLURAL_PROPERTY:
		g_value_set_boolean (value, valadoc_taglets_link_get_c_accept_plural (self));
		break;
		case VALADOC_TAGLETS_LINK_C_IS_PLURAL_PROPERTY:
		g_value_set_boolean (value, valadoc_taglets_link_get_c_is_plural (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_valadoc_taglets_link_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec)
{
	ValadocTagletsLink * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_TAGLETS_TYPE_LINK, ValadocTagletsLink);
	switch (property_id) {
		case VALADOC_TAGLETS_LINK_SYMBOL_NAME_PROPERTY:
		valadoc_taglets_link_set_symbol_name (self, g_value_get_string (value));
		break;
		case VALADOC_TAGLETS_LINK_C_ACCEPT_PLURAL_PROPERTY:
		valadoc_taglets_link_set_c_accept_plural (self, g_value_get_boolean (value));
		break;
		case VALADOC_TAGLETS_LINK_C_IS_PLURAL_PROPERTY:
		valadoc_taglets_link_set_c_is_plural (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

