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

/* tree.vala
 *
 * Copyright (C) 2008-2011  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 <glib/gstdio.h>
#include <gobject/gvaluecollector.h>


#define VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER (valadoc_api_tree_inherit_doc_container_get_type ())
#define VALADOC_API_TREE_INHERIT_DOC_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER, ValadocApiTreeInheritDocContainer))
#define VALADOC_API_TREE_INHERIT_DOC_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER, ValadocApiTreeInheritDocContainerClass))
#define VALADOC_API_TREE_IS_INHERIT_DOC_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER))
#define VALADOC_API_TREE_IS_INHERIT_DOC_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER))
#define VALADOC_API_TREE_INHERIT_DOC_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER, ValadocApiTreeInheritDocContainerClass))

typedef struct _ValadocApiTreeInheritDocContainer ValadocApiTreeInheritDocContainer;
typedef struct _ValadocApiTreeInheritDocContainerClass ValadocApiTreeInheritDocContainerClass;
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _valadoc_api_tree_inherit_doc_container_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_tree_inherit_doc_container_unref (var), NULL)))
typedef struct _ValadocApiTreeInheritDocContainerPrivate ValadocApiTreeInheritDocContainerPrivate;
typedef struct _ValadocApiTreeParamSpecInheritDocContainer ValadocApiTreeParamSpecInheritDocContainer;
typedef struct _ValadocApiParamSpecTree ValadocApiParamSpecTree;

struct _ValadocApiTreePrivate {
	ValaList* inheritdocs;
	ValaArrayList* external_c_files;
	ValaArrayList* packages;
	ValadocApiPackage* source_package;
	ValadocSettings* settings;
	ValadocErrorReporter* reporter;
	ValadocHighlighterHighlighter* _highlighter;
	ValadocCTypeResolver* _cresolver;
	ValadocApiPackage* _source_package;
	void* _data;
	ValadocWikiPageTree* _wikitree;
};

struct _ValadocApiTreeInheritDocContainer {
	GTypeInstance parent_instance;
	volatile int ref_count;
	ValadocApiTreeInheritDocContainerPrivate * priv;
	ValadocTagletsInheritDoc* taglet;
	ValadocApiNode* taglet_container;
};

struct _ValadocApiTreeInheritDocContainerClass {
	GTypeClass parent_class;
	void (*finalize) (ValadocApiTreeInheritDocContainer *self);
};

struct _ValadocApiTreeParamSpecInheritDocContainer {
	GParamSpec parent_instance;
};

struct _ValadocApiParamSpecTree {
	GParamSpec parent_instance;
};


static gpointer valadoc_api_tree_parent_class = NULL;
static gpointer valadoc_api_tree_inherit_doc_container_parent_class = NULL;

static gpointer valadoc_api_tree_inherit_doc_container_ref (gpointer instance);
static void valadoc_api_tree_inherit_doc_container_unref (gpointer instance);
static GParamSpec* valadoc_api_tree_param_spec_inherit_doc_container (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED;
static void valadoc_api_tree_value_set_inherit_doc_container (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static void valadoc_api_tree_value_take_inherit_doc_container (GValue* value, gpointer v_object) G_GNUC_UNUSED;
static gpointer valadoc_api_tree_value_get_inherit_doc_container (const GValue* value) G_GNUC_UNUSED;
static GType valadoc_api_tree_inherit_doc_container_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
#define VALADOC_API_TREE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_API_TYPE_TREE, ValadocApiTreePrivate))
static void valadoc_api_tree_add_dependencies_to_source_package (ValadocApiTree* self);
G_GNUC_INTERNAL void valadoc_api_package_set_dependency_list (ValadocApiPackage* self, ValaArrayList* list);
static ValadocApiNode* valadoc_api_tree_search_relative_to (ValadocApiTree* self, ValadocApiNode* element, gchar** path, int path_length1);
static gchar** valadoc_api_tree_split_name (ValadocApiTree* self, const gchar* full_name, int* result_length1);
static gchar* valadoc_api_tree_get_file_path (ValadocApiTree* self, const gchar* basename, gchar** directories, int directories_length1);
static ValadocApiPackage* valadoc_api_tree_get_source_package (ValadocApiTree* self);
static void valadoc_api_tree_parse_wiki (ValadocApiTree* self, ValadocDocumentationParser* docparser);
static void valadoc_api_tree_set_wikitree (ValadocApiTree* self, ValadocWikiPageTree* value);
static void valadoc_api_tree_check_wiki (ValadocApiTree* self, ValadocDocumentationParser* docparser);
G_GNUC_INTERNAL void valadoc_api_item_parse_comments (ValadocApiItem* self, ValadocSettings* settings, ValadocDocumentationParser* parser);
G_GNUC_INTERNAL void valadoc_api_item_check_comments (ValadocApiItem* self, ValadocSettings* settings, ValadocDocumentationParser* parser);
static void valadoc_api_tree_postprocess_inheritdoc (ValadocApiTree* self, ValadocDocumentationParser* docparser);
G_GNUC_INTERNAL void valadoc_api_tree_register_inheritdoc (ValadocApiTree* self, ValadocApiNode* container, ValadocTagletsInheritDoc* taglet);
static ValadocApiTreeInheritDocContainer* valadoc_api_tree_inherit_doc_container_new (ValadocApiNode* taglet_container, ValadocTagletsInheritDoc* taglet);
static ValadocApiTreeInheritDocContainer* valadoc_api_tree_inherit_doc_container_construct (GType object_type, ValadocApiNode* taglet_container, ValadocTagletsInheritDoc* taglet);
static void valadoc_api_tree_inherit_doc_container_finalize (ValadocApiTreeInheritDocContainer * obj);
static void valadoc_api_tree_finalize (ValadocApiTree * obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);


void valadoc_api_tree_add_package (ValadocApiTree* self, ValadocApiPackage* package) {
	ValaArrayList* _tmp0_;
	ValadocApiPackage* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (package != NULL);
	_tmp0_ = self->priv->packages;
	_tmp1_ = package;
	vala_collection_add ((ValaCollection*) _tmp0_, _tmp1_);
}


/**
 * Returns a list of C source files.
 *
 * @return list of C source files
 */
static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


ValaCollection* valadoc_api_tree_get_external_c_files (ValadocApiTree* self) {
	ValaCollection* result = NULL;
	ValaArrayList* _tmp0_;
	ValaCollection* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->external_c_files;
	_tmp1_ = _vala_iterable_ref0 ((ValaCollection*) _tmp0_);
	result = _tmp1_;
	return result;
}


void valadoc_api_tree_add_external_c_files (ValadocApiTree* self, const gchar* name) {
	ValaArrayList* _tmp0_;
	const gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->external_c_files;
	_tmp1_ = name;
	vala_collection_add ((ValaCollection*) _tmp0_, _tmp1_);
}


/**
 * Returns a list of all packages in the tree
 *
 * @return list of all packages
 */
ValaCollection* valadoc_api_tree_get_package_list (ValadocApiTree* self) {
	ValaCollection* result = NULL;
	ValaArrayList* _tmp0_;
	ValaCollection* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->packages;
	_tmp1_ = _vala_iterable_ref0 ((ValaCollection*) _tmp0_);
	result = _tmp1_;
	return result;
}


static void valadoc_api_tree_add_dependencies_to_source_package (ValadocApiTree* self) {
	ValadocApiPackage* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->source_package;
	if (_tmp0_ != NULL) {
		ValaArrayList* deplst = NULL;
		GEqualFunc _tmp1_;
		ValaArrayList* _tmp2_;
		ValadocApiPackage* _tmp18_;
		ValaArrayList* _tmp19_;
		_tmp1_ = g_direct_equal;
		_tmp2_ = vala_array_list_new (VALADOC_API_TYPE_PACKAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
		deplst = _tmp2_;
		{
			ValaArrayList* _pkg_list = NULL;
			ValaArrayList* _tmp3_;
			ValaArrayList* _tmp4_;
			gint _pkg_size = 0;
			ValaArrayList* _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			gint _pkg_index = 0;
			_tmp3_ = self->priv->packages;
			_tmp4_ = _vala_iterable_ref0 (_tmp3_);
			_pkg_list = _tmp4_;
			_tmp5_ = _pkg_list;
			_tmp6_ = vala_collection_get_size ((ValaCollection*) _tmp5_);
			_tmp7_ = _tmp6_;
			_pkg_size = _tmp7_;
			_pkg_index = -1;
			while (TRUE) {
				gint _tmp8_;
				gint _tmp9_;
				gint _tmp10_;
				ValadocApiPackage* pkg = NULL;
				ValaArrayList* _tmp11_;
				gint _tmp12_;
				gpointer _tmp13_;
				ValadocApiPackage* _tmp14_;
				ValadocApiPackage* _tmp15_;
				_tmp8_ = _pkg_index;
				_pkg_index = _tmp8_ + 1;
				_tmp9_ = _pkg_index;
				_tmp10_ = _pkg_size;
				if (!(_tmp9_ < _tmp10_)) {
					break;
				}
				_tmp11_ = _pkg_list;
				_tmp12_ = _pkg_index;
				_tmp13_ = vala_list_get ((ValaList*) _tmp11_, _tmp12_);
				pkg = (ValadocApiPackage*) _tmp13_;
				_tmp14_ = pkg;
				_tmp15_ = self->priv->source_package;
				if (_tmp14_ != _tmp15_) {
					ValaArrayList* _tmp16_;
					ValadocApiPackage* _tmp17_;
					_tmp16_ = deplst;
					_tmp17_ = pkg;
					vala_collection_add ((ValaCollection*) _tmp16_, _tmp17_);
				}
				_g_object_unref0 (pkg);
			}
			_vala_iterable_unref0 (_pkg_list);
		}
		_tmp18_ = self->priv->source_package;
		_tmp19_ = deplst;
		valadoc_api_package_set_dependency_list (_tmp18_, _tmp19_);
		_vala_iterable_unref0 (deplst);
	}
}


/**
 * Visits this node with the specified Visitor.
 *
 * @param visitor the visitor to be called while traversing
 */
void valadoc_api_tree_accept (ValadocApiTree* self, ValadocApiVisitor* visitor) {
	ValadocApiVisitor* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (visitor != NULL);
	_tmp0_ = visitor;
	valadoc_api_visitor_visit_tree (_tmp0_, self);
}


/**
 * Visits all children of this node with the given types with the specified Visitor.
 *
 * @param visitor the visitor to be called while traversing
 */
void valadoc_api_tree_accept_children (ValadocApiTree* self, ValadocApiVisitor* visitor) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (visitor != NULL);
	{
		ValaArrayList* _node_list = NULL;
		ValaArrayList* _tmp0_;
		ValaArrayList* _tmp1_;
		gint _node_size = 0;
		ValaArrayList* _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _node_index = 0;
		_tmp0_ = self->priv->packages;
		_tmp1_ = _vala_iterable_ref0 (_tmp0_);
		_node_list = _tmp1_;
		_tmp2_ = _node_list;
		_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
		_tmp4_ = _tmp3_;
		_node_size = _tmp4_;
		_node_index = -1;
		while (TRUE) {
			gint _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			ValadocApiNode* node = NULL;
			ValaArrayList* _tmp8_;
			gint _tmp9_;
			gpointer _tmp10_;
			ValadocApiNode* _tmp11_;
			ValadocApiVisitor* _tmp12_;
			_tmp5_ = _node_index;
			_node_index = _tmp5_ + 1;
			_tmp6_ = _node_index;
			_tmp7_ = _node_size;
			if (!(_tmp6_ < _tmp7_)) {
				break;
			}
			_tmp8_ = _node_list;
			_tmp9_ = _node_index;
			_tmp10_ = vala_list_get ((ValaList*) _tmp8_, _tmp9_);
			node = (ValadocApiNode*) ((ValadocApiPackage*) _tmp10_);
			_tmp11_ = node;
			_tmp12_ = visitor;
			valadoc_api_node_accept (_tmp11_, _tmp12_);
			_g_object_unref0 (node);
		}
		_vala_iterable_unref0 (_node_list);
	}
}


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


static ValadocApiNode* valadoc_api_tree_search_relative_to (ValadocApiTree* self, ValadocApiNode* element, gchar** path, int path_length1) {
	ValadocApiNode* result = NULL;
	ValadocApiNode* node = NULL;
	ValadocApiNode* _tmp0_;
	ValadocApiNode* _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gboolean _tmp8_ = FALSE;
	ValadocApiNode* _tmp9_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (element != NULL, NULL);
	_tmp0_ = element;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	node = _tmp1_;
	_tmp2_ = path;
	_tmp2__length1 = path_length1;
	{
		gchar** name_collection = NULL;
		gint name_collection_length1 = 0;
		gint _name_collection_size_ = 0;
		gint name_it = 0;
		name_collection = _tmp2_;
		name_collection_length1 = _tmp2__length1;
		for (name_it = 0; name_it < _tmp2__length1; name_it = name_it + 1) {
			gchar* _tmp3_;
			gchar* name = NULL;
			_tmp3_ = g_strdup (name_collection[name_it]);
			name = _tmp3_;
			{
				ValadocApiNode* _tmp4_;
				const gchar* _tmp5_;
				ValadocApiNode* _tmp6_;
				ValadocApiNode* _tmp7_;
				_tmp4_ = node;
				_tmp5_ = name;
				_tmp6_ = valadoc_api_node_find_by_name (_tmp4_, _tmp5_);
				_g_object_unref0 (node);
				node = _tmp6_;
				_tmp7_ = node;
				if (_tmp7_ == NULL) {
					_g_free0 (name);
					break;
				}
				_g_free0 (name);
			}
		}
	}
	_tmp9_ = node;
	if (_tmp9_ == NULL) {
		ValadocApiNode* _tmp10_;
		ValadocApiItem* _tmp11_;
		ValadocApiItem* _tmp12_;
		_tmp10_ = element;
		_tmp11_ = valadoc_api_item_get_parent ((ValadocApiItem*) _tmp10_);
		_tmp12_ = _tmp11_;
		_tmp8_ = _tmp12_ != NULL;
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		ValadocApiNode* _tmp13_;
		ValadocApiItem* _tmp14_;
		ValadocApiItem* _tmp15_;
		gchar** _tmp16_;
		gint _tmp16__length1;
		ValadocApiNode* _tmp17_;
		_tmp13_ = element;
		_tmp14_ = valadoc_api_item_get_parent ((ValadocApiItem*) _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = path;
		_tmp16__length1 = path_length1;
		_tmp17_ = valadoc_api_tree_search_relative_to (self, G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, VALADOC_API_TYPE_NODE, ValadocApiNode), _tmp16_, _tmp16__length1);
		_g_object_unref0 (node);
		node = _tmp17_;
	}
	result = node;
	return result;
}


ValadocApiNode* valadoc_api_tree_search_symbol_path (ValadocApiTree* self, ValadocApiNode* element, gchar** path, int path_length1) {
	ValadocApiNode* result = NULL;
	ValadocApiNode* node = NULL;
	ValadocApiNode* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	node = NULL;
	_tmp0_ = element;
	if (_tmp0_ != NULL) {
		ValadocApiNode* _tmp1_;
		gchar** _tmp2_;
		gint _tmp2__length1;
		ValadocApiNode* _tmp3_;
		ValadocApiNode* _tmp4_;
		_tmp1_ = element;
		_tmp2_ = path;
		_tmp2__length1 = path_length1;
		_tmp3_ = valadoc_api_tree_search_relative_to (self, _tmp1_, _tmp2_, _tmp2__length1);
		_g_object_unref0 (node);
		node = _tmp3_;
		_tmp4_ = node;
		if (_tmp4_ != NULL) {
			result = node;
			return result;
		}
	}
	{
		ValaArrayList* _package_list = NULL;
		ValaArrayList* _tmp5_;
		ValaArrayList* _tmp6_;
		gint _package_size = 0;
		ValaArrayList* _tmp7_;
		gint _tmp8_;
		gint _tmp9_;
		gint _package_index = 0;
		_tmp5_ = self->priv->packages;
		_tmp6_ = _vala_iterable_ref0 (_tmp5_);
		_package_list = _tmp6_;
		_tmp7_ = _package_list;
		_tmp8_ = vala_collection_get_size ((ValaCollection*) _tmp7_);
		_tmp9_ = _tmp8_;
		_package_size = _tmp9_;
		_package_index = -1;
		while (TRUE) {
			gint _tmp10_;
			gint _tmp11_;
			gint _tmp12_;
			ValadocApiPackage* package = NULL;
			ValaArrayList* _tmp13_;
			gint _tmp14_;
			gpointer _tmp15_;
			ValadocApiNode* global = NULL;
			ValadocApiPackage* _tmp16_;
			ValadocApiNode* _tmp17_;
			ValadocApiNode* _tmp18_;
			_tmp10_ = _package_index;
			_package_index = _tmp10_ + 1;
			_tmp11_ = _package_index;
			_tmp12_ = _package_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _package_list;
			_tmp14_ = _package_index;
			_tmp15_ = vala_list_get ((ValaList*) _tmp13_, _tmp14_);
			package = (ValadocApiPackage*) _tmp15_;
			_tmp16_ = package;
			_tmp17_ = valadoc_api_node_find_by_name ((ValadocApiNode*) _tmp16_, "");
			global = _tmp17_;
			_tmp18_ = global;
			if (_tmp18_ != NULL) {
				ValadocApiNode* _tmp19_;
				gchar** _tmp20_;
				gint _tmp20__length1;
				ValadocApiNode* _tmp21_;
				ValadocApiNode* _tmp22_;
				_tmp19_ = global;
				_tmp20_ = path;
				_tmp20__length1 = path_length1;
				_tmp21_ = valadoc_api_tree_search_relative_to (self, _tmp19_, _tmp20_, _tmp20__length1);
				_g_object_unref0 (node);
				node = _tmp21_;
				_tmp22_ = node;
				if (_tmp22_ != NULL) {
					result = node;
					_g_object_unref0 (global);
					_g_object_unref0 (package);
					_vala_iterable_unref0 (_package_list);
					return result;
				}
			}
			_g_object_unref0 (global);
			_g_object_unref0 (package);
		}
		_vala_iterable_unref0 (_package_list);
	}
	result = NULL;
	_g_object_unref0 (node);
	return result;
}


ValadocApiTypeSymbol* valadoc_api_tree_search_symbol_type_cstr (ValadocApiTree* self, const gchar* cname) {
	ValadocApiTypeSymbol* result = NULL;
	ValadocCTypeResolver* _tmp0_;
	ValadocCTypeResolver* _tmp2_;
	const gchar* _tmp3_;
	ValadocApiTypeSymbol* _tmp4_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (cname != NULL, NULL);
	_tmp0_ = self->priv->_cresolver;
	if (_tmp0_ == NULL) {
		ValadocCTypeResolver* _tmp1_;
		_tmp1_ = valadoc_ctype_resolver_new (self);
		_g_object_unref0 (self->priv->_cresolver);
		self->priv->_cresolver = _tmp1_;
	}
	_tmp2_ = self->priv->_cresolver;
	_tmp3_ = cname;
	_tmp4_ = valadoc_ctype_resolver_resolve_symbol_type (_tmp2_, _tmp3_);
	result = _tmp4_;
	return result;
}


ValadocApiNode* valadoc_api_tree_search_symbol_cstr (ValadocApiTree* self, ValadocApiNode* element, const gchar* cname) {
	ValadocApiNode* result = NULL;
	ValadocCTypeResolver* _tmp0_;
	ValadocCTypeResolver* _tmp2_;
	ValadocApiNode* _tmp3_;
	const gchar* _tmp4_;
	ValadocApiNode* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (cname != NULL, NULL);
	_tmp0_ = self->priv->_cresolver;
	if (_tmp0_ == NULL) {
		ValadocCTypeResolver* _tmp1_;
		_tmp1_ = valadoc_ctype_resolver_new (self);
		_g_object_unref0 (self->priv->_cresolver);
		self->priv->_cresolver = _tmp1_;
	}
	_tmp2_ = self->priv->_cresolver;
	_tmp3_ = element;
	_tmp4_ = cname;
	_tmp5_ = valadoc_ctype_resolver_resolve_symbol (_tmp2_, _tmp3_, _tmp4_);
	result = _tmp5_;
	return result;
}


ValadocApiNode* valadoc_api_tree_search_symbol_str (ValadocApiTree* self, ValadocApiNode* element, const gchar* symname) {
	ValadocApiNode* result = NULL;
	gchar** path = NULL;
	const gchar* _tmp0_;
	gint _tmp1_;
	gchar** _tmp2_;
	gint path_length1;
	gint _path_size_;
	ValadocApiNode* node = NULL;
	ValadocApiNode* _tmp3_;
	gchar** _tmp4_;
	gint _tmp4__length1;
	ValadocApiNode* _tmp5_;
	ValadocApiNode* _tmp6_;
	gboolean _tmp7_ = FALSE;
	gchar** _tmp8_;
	gint _tmp8__length1;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (symname != NULL, NULL);
	_tmp0_ = symname;
	_tmp2_ = valadoc_api_tree_split_name (self, _tmp0_, &_tmp1_);
	path = _tmp2_;
	path_length1 = _tmp1_;
	_path_size_ = path_length1;
	_tmp3_ = element;
	_tmp4_ = path;
	_tmp4__length1 = path_length1;
	_tmp5_ = valadoc_api_tree_search_symbol_path (self, _tmp3_, _tmp4_, _tmp4__length1);
	node = _tmp5_;
	_tmp6_ = node;
	if (_tmp6_ != NULL) {
		result = node;
		path = (_vala_array_free (path, path_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	_tmp8_ = path;
	_tmp8__length1 = path_length1;
	if (_tmp8__length1 >= 2) {
		gchar** _tmp9_;
		gint _tmp9__length1;
		gchar** _tmp10_;
		gint _tmp10__length1;
		const gchar* _tmp11_;
		gchar** _tmp12_;
		gint _tmp12__length1;
		gchar** _tmp13_;
		gint _tmp13__length1;
		const gchar* _tmp14_;
		_tmp9_ = path;
		_tmp9__length1 = path_length1;
		_tmp10_ = path;
		_tmp10__length1 = path_length1;
		_tmp11_ = _tmp9_[_tmp10__length1 - 2];
		_tmp12_ = path;
		_tmp12__length1 = path_length1;
		_tmp13_ = path;
		_tmp13__length1 = path_length1;
		_tmp14_ = _tmp12_[_tmp13__length1 - 2];
		_tmp7_ = g_strcmp0 (_tmp11_, _tmp14_) == 0;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		gchar** _tmp15_;
		gint _tmp15__length1;
		gchar** _tmp16_;
		gint _tmp16__length1;
		gchar** _tmp17_;
		gint _tmp17__length1;
		gchar** _tmp18_;
		gint _tmp18__length1;
		const gchar* _tmp19_;
		gchar* _tmp20_;
		gchar* _tmp21_;
		gchar** _tmp22_;
		gint _tmp22__length1;
		gchar** _tmp23_;
		gint _tmp23__length1;
		const gchar* _tmp24_;
		gchar* _tmp25_;
		gchar* _tmp26_;
		gchar** _tmp27_;
		gint _tmp27__length1;
		gint _tmp28_;
		ValadocApiNode* _tmp29_;
		gchar** _tmp30_;
		gint _tmp30__length1;
		ValadocApiNode* _tmp31_;
		_tmp15_ = path;
		_tmp15__length1 = path_length1;
		_tmp16_ = path;
		_tmp16__length1 = path_length1;
		_tmp17_ = path;
		_tmp17__length1 = path_length1;
		_tmp18_ = path;
		_tmp18__length1 = path_length1;
		_tmp19_ = _tmp17_[_tmp18__length1 - 2];
		_tmp20_ = g_strconcat (_tmp19_, ".", NULL);
		_tmp21_ = _tmp20_;
		_tmp22_ = path;
		_tmp22__length1 = path_length1;
		_tmp23_ = path;
		_tmp23__length1 = path_length1;
		_tmp24_ = _tmp22_[_tmp23__length1 - 1];
		_tmp25_ = g_strconcat (_tmp21_, _tmp24_, NULL);
		_g_free0 (_tmp15_[_tmp16__length1 - 2]);
		_tmp15_[_tmp16__length1 - 2] = _tmp25_;
		_tmp26_ = _tmp15_[_tmp16__length1 - 2];
		_g_free0 (_tmp21_);
		_tmp27_ = path;
		_tmp27__length1 = path_length1;
		_tmp28_ = _tmp27__length1 - 1;
		path = g_renew (gchar*, path, _tmp27__length1 - 1);
		(_tmp28_ > path_length1) ? memset (path + path_length1, 0, sizeof (gchar*) * (_tmp28_ - path_length1)) : NULL;
		path_length1 = _tmp28_;
		_path_size_ = _tmp28_;
		_tmp29_ = element;
		_tmp30_ = path;
		_tmp30__length1 = path_length1;
		_tmp31_ = valadoc_api_tree_search_symbol_path (self, _tmp29_, _tmp30_, _tmp30__length1);
		result = _tmp31_;
		_g_object_unref0 (node);
		path = (_vala_array_free (path, path_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	result = NULL;
	_g_object_unref0 (node);
	path = (_vala_array_free (path, path_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


static gchar** valadoc_api_tree_split_name (ValadocApiTree* self, const gchar* full_name, int* result_length1) {
	gchar** result = NULL;
	gchar** params = NULL;
	const gchar* _tmp0_;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint params_length1;
	gint _params_size_;
	gint i = 0;
	gint _tmp7_;
	gint _tmp8_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (full_name != NULL, NULL);
	_tmp0_ = full_name;
	_tmp2_ = _tmp1_ = g_strsplit (_tmp0_, ".", -1);
	params = _tmp2_;
	params_length1 = _vala_array_length (_tmp1_);
	_params_size_ = params_length1;
	i = 0;
	while (TRUE) {
		gchar** _tmp3_;
		gint _tmp3__length1;
		gint _tmp4_;
		const gchar* _tmp5_;
		gint _tmp6_;
		_tmp3_ = params;
		_tmp3__length1 = params_length1;
		_tmp4_ = i;
		_tmp5_ = _tmp3_[_tmp4_];
		if (!(_tmp5_ != NULL)) {
			break;
		}
		_tmp6_ = i;
		i = _tmp6_ + 1;
	}
	_tmp7_ = i;
	params_length1 = _tmp7_;
	_tmp8_ = params_length1;
	_tmp9_ = params;
	_tmp9__length1 = params_length1;
	if (result_length1) {
		*result_length1 = _tmp9__length1;
	}
	result = _tmp9_;
	return result;
}


ValadocApiTree* valadoc_api_tree_construct (GType object_type, ValadocErrorReporter* reporter, ValadocSettings* settings, void* data) {
	ValadocApiTree* self = NULL;
	ValadocSettings* _tmp0_;
	ValadocSettings* _tmp1_;
	ValadocErrorReporter* _tmp2_;
	ValadocErrorReporter* _tmp3_;
	void* _tmp4_;
	g_return_val_if_fail (reporter != NULL, NULL);
	g_return_val_if_fail (settings != NULL, NULL);
	self = (ValadocApiTree*) g_type_create_instance (object_type);
	_tmp0_ = settings;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->settings);
	self->priv->settings = _tmp1_;
	_tmp2_ = reporter;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->reporter);
	self->priv->reporter = _tmp3_;
	_tmp4_ = data;
	valadoc_api_tree_set_data (self, _tmp4_);
	return self;
}


ValadocApiTree* valadoc_api_tree_new (ValadocErrorReporter* reporter, ValadocSettings* settings, void* data) {
	return valadoc_api_tree_construct (VALADOC_API_TYPE_TREE, reporter, settings, data);
}


static gchar* valadoc_api_tree_get_file_path (ValadocApiTree* self, const gchar* basename, gchar** directories, int directories_length1) {
	gchar* result = NULL;
	gchar* filename = NULL;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp8_;
	gchar** _tmp9_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (basename != NULL, NULL);
	filename = NULL;
	_tmp0_ = directories;
	_tmp0__length1 = directories_length1;
	if (_tmp0_ != NULL) {
		gchar** _tmp1_;
		gint _tmp1__length1;
		_tmp1_ = directories;
		_tmp1__length1 = directories_length1;
		{
			gchar** dir_collection = NULL;
			gint dir_collection_length1 = 0;
			gint _dir_collection_size_ = 0;
			gint dir_it = 0;
			dir_collection = _tmp1_;
			dir_collection_length1 = _tmp1__length1;
			for (dir_it = 0; dir_it < _tmp1__length1; dir_it = dir_it + 1) {
				gchar* _tmp2_;
				gchar* dir = NULL;
				_tmp2_ = g_strdup (dir_collection[dir_it]);
				dir = _tmp2_;
				{
					const gchar* _tmp3_;
					const gchar* _tmp4_;
					gchar* _tmp5_;
					const gchar* _tmp6_;
					gboolean _tmp7_;
					_tmp3_ = dir;
					_tmp4_ = basename;
					_tmp5_ = g_build_filename (_tmp3_, _tmp4_, NULL);
					_g_free0 (filename);
					filename = _tmp5_;
					_tmp6_ = filename;
					_tmp7_ = g_file_test (_tmp6_, G_FILE_TEST_EXISTS);
					if (_tmp7_) {
						result = filename;
						_g_free0 (dir);
						return result;
					}
					_g_free0 (dir);
				}
			}
		}
	}
	_tmp9_ = _tmp8_ = g_get_system_data_dirs ();
	{
		gchar** dir_collection = NULL;
		gint dir_collection_length1 = 0;
		gint _dir_collection_size_ = 0;
		gint dir_it = 0;
		dir_collection = _tmp9_;
		dir_collection_length1 = _vala_array_length (_tmp8_);
		for (dir_it = 0; dir_it < _vala_array_length (_tmp8_); dir_it = dir_it + 1) {
			gchar* _tmp10_;
			gchar* dir = NULL;
			_tmp10_ = g_strdup (dir_collection[dir_it]);
			dir = _tmp10_;
			{
				const gchar* _tmp11_;
				const gchar* _tmp12_;
				gchar* _tmp13_;
				const gchar* _tmp14_;
				gboolean _tmp15_;
				_tmp11_ = dir;
				_tmp12_ = basename;
				_tmp13_ = g_build_filename (_tmp11_, _tmp12_, NULL);
				_g_free0 (filename);
				filename = _tmp13_;
				_tmp14_ = filename;
				_tmp15_ = g_file_test (_tmp14_, G_FILE_TEST_EXISTS);
				if (_tmp15_) {
					result = filename;
					_g_free0 (dir);
					return result;
				}
				_g_free0 (dir);
			}
		}
	}
	result = NULL;
	_g_free0 (filename);
	return result;
}


gboolean valadoc_api_tree_create_tree (ValadocApiTree* self) {
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	valadoc_api_tree_add_dependencies_to_source_package (self);
	result = TRUE;
	return result;
}


static ValadocApiPackage* valadoc_api_tree_get_source_package (ValadocApiTree* self) {
	ValadocApiPackage* result = NULL;
	ValadocApiPackage* _tmp0_;
	ValadocApiPackage* _tmp17_;
	ValadocApiPackage* _tmp18_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source_package;
	if (_tmp0_ == NULL) {
		{
			ValaArrayList* _pkg_list = NULL;
			ValaArrayList* _tmp1_;
			ValaArrayList* _tmp2_;
			gint _pkg_size = 0;
			ValaArrayList* _tmp3_;
			gint _tmp4_;
			gint _tmp5_;
			gint _pkg_index = 0;
			_tmp1_ = self->priv->packages;
			_tmp2_ = _vala_iterable_ref0 (_tmp1_);
			_pkg_list = _tmp2_;
			_tmp3_ = _pkg_list;
			_tmp4_ = vala_collection_get_size ((ValaCollection*) _tmp3_);
			_tmp5_ = _tmp4_;
			_pkg_size = _tmp5_;
			_pkg_index = -1;
			while (TRUE) {
				gint _tmp6_;
				gint _tmp7_;
				gint _tmp8_;
				ValadocApiPackage* pkg = NULL;
				ValaArrayList* _tmp9_;
				gint _tmp10_;
				gpointer _tmp11_;
				ValadocApiPackage* _tmp12_;
				gboolean _tmp13_;
				gboolean _tmp14_;
				_tmp6_ = _pkg_index;
				_pkg_index = _tmp6_ + 1;
				_tmp7_ = _pkg_index;
				_tmp8_ = _pkg_size;
				if (!(_tmp7_ < _tmp8_)) {
					break;
				}
				_tmp9_ = _pkg_list;
				_tmp10_ = _pkg_index;
				_tmp11_ = vala_list_get ((ValaList*) _tmp9_, _tmp10_);
				pkg = (ValadocApiPackage*) _tmp11_;
				_tmp12_ = pkg;
				_tmp13_ = valadoc_api_package_get_is_package (_tmp12_);
				_tmp14_ = _tmp13_;
				if (!_tmp14_) {
					ValadocApiPackage* _tmp15_;
					ValadocApiPackage* _tmp16_;
					_tmp15_ = pkg;
					_tmp16_ = _g_object_ref0 (_tmp15_);
					_g_object_unref0 (self->priv->_source_package);
					self->priv->_source_package = _tmp16_;
					_g_object_unref0 (pkg);
					break;
				}
				_g_object_unref0 (pkg);
			}
			_vala_iterable_unref0 (_pkg_list);
		}
	}
	_tmp17_ = self->priv->_source_package;
	_tmp18_ = _g_object_ref0 (_tmp17_);
	result = _tmp18_;
	return result;
}


static void valadoc_api_tree_parse_wiki (ValadocApiTree* self, ValadocDocumentationParser* docparser) {
	ValadocWikiPageTree* _tmp0_;
	ValadocWikiPageTree* _tmp1_;
	ValadocApiPackage* pkg = NULL;
	ValadocApiPackage* _tmp2_;
	ValadocApiPackage* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (docparser != NULL);
	_tmp0_ = valadoc_wiki_page_tree_new ();
	_tmp1_ = _tmp0_;
	valadoc_api_tree_set_wikitree (self, _tmp1_);
	_g_object_unref0 (_tmp1_);
	_tmp2_ = valadoc_api_tree_get_source_package (self);
	pkg = _tmp2_;
	_tmp3_ = pkg;
	if (_tmp3_ != NULL) {
		ValadocWikiPageTree* _tmp4_;
		ValadocSettings* _tmp5_;
		ValadocDocumentationParser* _tmp6_;
		ValadocApiPackage* _tmp7_;
		ValadocErrorReporter* _tmp8_;
		_tmp4_ = self->priv->_wikitree;
		_tmp5_ = self->priv->settings;
		_tmp6_ = docparser;
		_tmp7_ = pkg;
		_tmp8_ = self->priv->reporter;
		valadoc_wiki_page_tree_parse (_tmp4_, _tmp5_, _tmp6_, _tmp7_, _tmp8_);
	}
	_g_object_unref0 (pkg);
}


static void valadoc_api_tree_check_wiki (ValadocApiTree* self, ValadocDocumentationParser* docparser) {
	ValadocApiPackage* pkg = NULL;
	ValadocApiPackage* _tmp0_;
	ValadocApiPackage* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (docparser != NULL);
	_tmp0_ = valadoc_api_tree_get_source_package (self);
	pkg = _tmp0_;
	_tmp1_ = pkg;
	if (_tmp1_ != NULL) {
		ValadocWikiPageTree* _tmp2_;
		ValadocSettings* _tmp3_;
		ValadocDocumentationParser* _tmp4_;
		ValadocApiPackage* _tmp5_;
		_tmp2_ = self->priv->_wikitree;
		_tmp3_ = self->priv->settings;
		_tmp4_ = docparser;
		_tmp5_ = pkg;
		valadoc_wiki_page_tree_check (_tmp2_, _tmp3_, _tmp4_, _tmp5_);
	}
	_g_object_unref0 (pkg);
}


void valadoc_api_tree_parse_comments (ValadocApiTree* self, ValadocDocumentationParser* docparser) {
	ValadocDocumentationParser* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (docparser != NULL);
	_tmp0_ = docparser;
	valadoc_api_tree_parse_wiki (self, _tmp0_);
	{
		ValaArrayList* _pkg_list = NULL;
		ValaArrayList* _tmp1_;
		ValaArrayList* _tmp2_;
		gint _pkg_size = 0;
		ValaArrayList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _pkg_index = 0;
		_tmp1_ = self->priv->packages;
		_tmp2_ = _vala_iterable_ref0 (_tmp1_);
		_pkg_list = _tmp2_;
		_tmp3_ = _pkg_list;
		_tmp4_ = vala_collection_get_size ((ValaCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_pkg_size = _tmp5_;
		_pkg_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			gint _tmp8_;
			ValadocApiPackage* pkg = NULL;
			ValaArrayList* _tmp9_;
			gint _tmp10_;
			gpointer _tmp11_;
			ValadocApiPackage* _tmp12_;
			ValadocSettings* _tmp13_;
			gboolean _tmp14_;
			_tmp6_ = _pkg_index;
			_pkg_index = _tmp6_ + 1;
			_tmp7_ = _pkg_index;
			_tmp8_ = _pkg_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _pkg_list;
			_tmp10_ = _pkg_index;
			_tmp11_ = vala_list_get ((ValaList*) _tmp9_, _tmp10_);
			pkg = (ValadocApiPackage*) _tmp11_;
			_tmp12_ = pkg;
			_tmp13_ = self->priv->settings;
			_tmp14_ = valadoc_api_node_is_browsable ((ValadocApiNode*) _tmp12_, _tmp13_);
			if (_tmp14_) {
				ValadocApiPackage* _tmp15_;
				ValadocSettings* _tmp16_;
				ValadocDocumentationParser* _tmp17_;
				_tmp15_ = pkg;
				_tmp16_ = self->priv->settings;
				_tmp17_ = docparser;
				valadoc_api_item_parse_comments ((ValadocApiItem*) _tmp15_, _tmp16_, _tmp17_);
			}
			_g_object_unref0 (pkg);
		}
		_vala_iterable_unref0 (_pkg_list);
	}
}


void valadoc_api_tree_check_comments (ValadocApiTree* self, ValadocDocumentationParser* docparser) {
	ValadocDocumentationParser* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (docparser != NULL);
	_tmp0_ = docparser;
	valadoc_api_tree_check_wiki (self, _tmp0_);
	{
		ValaArrayList* _pkg_list = NULL;
		ValaArrayList* _tmp1_;
		ValaArrayList* _tmp2_;
		gint _pkg_size = 0;
		ValaArrayList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _pkg_index = 0;
		_tmp1_ = self->priv->packages;
		_tmp2_ = _vala_iterable_ref0 (_tmp1_);
		_pkg_list = _tmp2_;
		_tmp3_ = _pkg_list;
		_tmp4_ = vala_collection_get_size ((ValaCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_pkg_size = _tmp5_;
		_pkg_index = -1;
		while (TRUE) {
			gint _tmp6_;
			gint _tmp7_;
			gint _tmp8_;
			ValadocApiPackage* pkg = NULL;
			ValaArrayList* _tmp9_;
			gint _tmp10_;
			gpointer _tmp11_;
			ValadocApiPackage* _tmp12_;
			ValadocSettings* _tmp13_;
			gboolean _tmp14_;
			_tmp6_ = _pkg_index;
			_pkg_index = _tmp6_ + 1;
			_tmp7_ = _pkg_index;
			_tmp8_ = _pkg_size;
			if (!(_tmp7_ < _tmp8_)) {
				break;
			}
			_tmp9_ = _pkg_list;
			_tmp10_ = _pkg_index;
			_tmp11_ = vala_list_get ((ValaList*) _tmp9_, _tmp10_);
			pkg = (ValadocApiPackage*) _tmp11_;
			_tmp12_ = pkg;
			_tmp13_ = self->priv->settings;
			_tmp14_ = valadoc_api_node_is_browsable ((ValadocApiNode*) _tmp12_, _tmp13_);
			if (_tmp14_) {
				ValadocApiPackage* _tmp15_;
				ValadocSettings* _tmp16_;
				ValadocDocumentationParser* _tmp17_;
				ValadocDocumentationParser* _tmp18_;
				_tmp15_ = pkg;
				_tmp16_ = self->priv->settings;
				_tmp17_ = docparser;
				valadoc_api_item_check_comments ((ValadocApiItem*) _tmp15_, _tmp16_, _tmp17_);
				_tmp18_ = docparser;
				valadoc_api_tree_postprocess_inheritdoc (self, _tmp18_);
			}
			_g_object_unref0 (pkg);
		}
		_vala_iterable_unref0 (_pkg_list);
	}
}


G_GNUC_INTERNAL void valadoc_api_tree_register_inheritdoc (ValadocApiTree* self, ValadocApiNode* container, ValadocTagletsInheritDoc* taglet) {
	ValaList* _tmp0_;
	ValadocApiNode* _tmp1_;
	ValadocTagletsInheritDoc* _tmp2_;
	ValadocApiTreeInheritDocContainer* _tmp3_;
	ValadocApiTreeInheritDocContainer* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (container != NULL);
	g_return_if_fail (taglet != NULL);
	_tmp0_ = self->priv->inheritdocs;
	_tmp1_ = container;
	_tmp2_ = taglet;
	_tmp3_ = valadoc_api_tree_inherit_doc_container_new (_tmp1_, _tmp2_);
	_tmp4_ = _tmp3_;
	vala_collection_add ((ValaCollection*) _tmp0_, _tmp4_);
	_valadoc_api_tree_inherit_doc_container_unref0 (_tmp4_);
}


static void valadoc_api_tree_postprocess_inheritdoc (ValadocApiTree* self, ValadocDocumentationParser* docparser) {
	g_return_if_fail (self != NULL);
	g_return_if_fail (docparser != NULL);
	while (TRUE) {
		ValaList* _tmp0_;
		gboolean _tmp1_;
		gboolean _tmp2_;
		ValadocApiTreeInheritDocContainer* container = NULL;
		ValaList* _tmp3_;
		gpointer _tmp4_;
		ValadocDocumentationParser* _tmp5_;
		ValadocApiTreeInheritDocContainer* _tmp6_;
		ValadocApiNode* _tmp7_;
		ValadocApiTreeInheritDocContainer* _tmp8_;
		ValadocTagletsInheritDoc* _tmp9_;
		_tmp0_ = self->priv->inheritdocs;
		_tmp1_ = vala_collection_get_is_empty ((ValaCollection*) _tmp0_);
		_tmp2_ = _tmp1_;
		if (!(!_tmp2_)) {
			break;
		}
		_tmp3_ = self->priv->inheritdocs;
		_tmp4_ = vala_list_remove_at (_tmp3_, 0);
		container = (ValadocApiTreeInheritDocContainer*) _tmp4_;
		_tmp5_ = docparser;
		_tmp6_ = container;
		_tmp7_ = _tmp6_->taglet_container;
		_tmp8_ = container;
		_tmp9_ = _tmp8_->taglet;
		valadoc_documentation_parser_transform_inheritdoc (_tmp5_, _tmp7_, _tmp9_);
		_valadoc_api_tree_inherit_doc_container_unref0 (container);
	}
}


/**
 * Import documentation from various sources
 *
 * @param importers a list of importers
 * @param packages sources
 * @param import_directories List of directories where to find the files
 */
void valadoc_api_tree_import_comments (ValadocApiTree* self, ValadocImporterDocumentationImporter** importers, int importers_length1, gchar** packages, int packages_length1, gchar** import_directories, int import_directories_length1) {
	ValaHashSet* processed = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	ValaHashSet* _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_direct_hash;
	_tmp1_ = g_direct_equal;
	_tmp2_ = vala_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp0_, _tmp1_);
	processed = _tmp2_;
	_tmp3_ = packages;
	_tmp3__length1 = packages_length1;
	{
		gchar** pkg_name_collection = NULL;
		gint pkg_name_collection_length1 = 0;
		gint _pkg_name_collection_size_ = 0;
		gint pkg_name_it = 0;
		pkg_name_collection = _tmp3_;
		pkg_name_collection_length1 = _tmp3__length1;
		for (pkg_name_it = 0; pkg_name_it < _tmp3__length1; pkg_name_it = pkg_name_it + 1) {
			gchar* _tmp4_;
			gchar* pkg_name = NULL;
			_tmp4_ = g_strdup (pkg_name_collection[pkg_name_it]);
			pkg_name = _tmp4_;
			{
				gboolean imported = FALSE;
				ValadocImporterDocumentationImporter** _tmp5_;
				gint _tmp5__length1;
				gboolean _tmp26_;
				imported = FALSE;
				_tmp5_ = importers;
				_tmp5__length1 = importers_length1;
				{
					ValadocImporterDocumentationImporter** importer_collection = NULL;
					gint importer_collection_length1 = 0;
					gint _importer_collection_size_ = 0;
					gint importer_it = 0;
					importer_collection = _tmp5_;
					importer_collection_length1 = _tmp5__length1;
					for (importer_it = 0; importer_it < _tmp5__length1; importer_it = importer_it + 1) {
						ValadocImporterDocumentationImporter* _tmp6_;
						ValadocImporterDocumentationImporter* importer = NULL;
						_tmp6_ = _g_object_ref0 (importer_collection[importer_it]);
						importer = _tmp6_;
						{
							gchar* path = NULL;
							const gchar* _tmp7_;
							ValadocImporterDocumentationImporter* _tmp8_;
							const gchar* _tmp9_;
							const gchar* _tmp10_;
							gchar* _tmp11_;
							gchar* _tmp12_;
							gchar** _tmp13_;
							gint _tmp13__length1;
							gchar* _tmp14_;
							gchar* _tmp15_;
							const gchar* _tmp16_;
							const gchar* _tmp17_;
							gchar* _tmp18_;
							ValaHashSet* _tmp19_;
							const gchar* _tmp20_;
							gboolean _tmp21_;
							_tmp7_ = pkg_name;
							_tmp8_ = importer;
							_tmp9_ = valadoc_importer_documentation_importer_get_file_extension (_tmp8_);
							_tmp10_ = _tmp9_;
							_tmp11_ = g_strdup_printf ("%s.%s", _tmp7_, _tmp10_);
							_tmp12_ = _tmp11_;
							_tmp13_ = import_directories;
							_tmp13__length1 = import_directories_length1;
							_tmp14_ = valadoc_api_tree_get_file_path (self, _tmp12_, _tmp13_, _tmp13__length1);
							_tmp15_ = _tmp14_;
							_g_free0 (_tmp12_);
							path = _tmp15_;
							_tmp16_ = path;
							if (_tmp16_ == NULL) {
								_g_free0 (path);
								_g_object_unref0 (importer);
								continue;
							}
							_tmp17_ = path;
							_tmp18_ = valadoc_realpath (_tmp17_);
							_g_free0 (path);
							path = _tmp18_;
							imported = TRUE;
							_tmp19_ = processed;
							_tmp20_ = path;
							_tmp21_ = vala_collection_contains ((ValaCollection*) _tmp19_, _tmp20_);
							if (!_tmp21_) {
								ValadocImporterDocumentationImporter* _tmp22_;
								const gchar* _tmp23_;
								ValaHashSet* _tmp24_;
								const gchar* _tmp25_;
								_tmp22_ = importer;
								_tmp23_ = path;
								valadoc_importer_documentation_importer_process (_tmp22_, _tmp23_);
								_tmp24_ = processed;
								_tmp25_ = path;
								vala_collection_add ((ValaCollection*) _tmp24_, _tmp25_);
							}
							_g_free0 (path);
							_g_object_unref0 (importer);
						}
					}
				}
				_tmp26_ = imported;
				if (_tmp26_ == FALSE) {
					ValadocErrorReporter* _tmp27_;
					const gchar* _tmp28_;
					_tmp27_ = self->priv->reporter;
					_tmp28_ = pkg_name;
					valadoc_error_reporter_simple_error (_tmp27_, NULL, "'%s' not found in specified import directories", _tmp28_);
				}
				_g_free0 (pkg_name);
			}
		}
	}
	_vala_iterable_unref0 (processed);
}


void* valadoc_api_tree_get_data (ValadocApiTree* self) {
	void* result;
	void* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_data;
	result = _tmp0_;
	return result;
}


void valadoc_api_tree_set_data (ValadocApiTree* self, void* value) {
	void* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_data = _tmp0_;
}


ValadocHighlighterHighlighter* valadoc_api_tree_get_highlighter (ValadocApiTree* self) {
	ValadocHighlighterHighlighter* result;
	ValadocHighlighterHighlighter* _tmp0_;
	ValadocHighlighterHighlighter* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_highlighter;
	if (_tmp0_ == NULL) {
		ValadocHighlighterHighlighter* _tmp1_;
		_tmp1_ = valadoc_highlighter_highlighter_new ();
		_g_object_unref0 (self->priv->_highlighter);
		self->priv->_highlighter = _tmp1_;
	}
	_tmp2_ = self->priv->_highlighter;
	result = _tmp2_;
	return result;
}


ValadocWikiPageTree* valadoc_api_tree_get_wikitree (ValadocApiTree* self) {
	ValadocWikiPageTree* result;
	ValadocWikiPageTree* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_wikitree;
	result = _tmp0_;
	return result;
}


static void valadoc_api_tree_set_wikitree (ValadocApiTree* self, ValadocWikiPageTree* value) {
	ValadocWikiPageTree* _tmp0_;
	ValadocWikiPageTree* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->_wikitree);
	self->priv->_wikitree = _tmp1_;
}


static ValadocApiTreeInheritDocContainer* valadoc_api_tree_inherit_doc_container_construct (GType object_type, ValadocApiNode* taglet_container, ValadocTagletsInheritDoc* taglet) {
	ValadocApiTreeInheritDocContainer* self = NULL;
	ValadocApiNode* _tmp0_;
	ValadocTagletsInheritDoc* _tmp1_;
	g_return_val_if_fail (taglet_container != NULL, NULL);
	g_return_val_if_fail (taglet != NULL, NULL);
	self = (ValadocApiTreeInheritDocContainer*) g_type_create_instance (object_type);
	_tmp0_ = taglet_container;
	self->taglet_container = _tmp0_;
	_tmp1_ = taglet;
	self->taglet = _tmp1_;
	return self;
}


static ValadocApiTreeInheritDocContainer* valadoc_api_tree_inherit_doc_container_new (ValadocApiNode* taglet_container, ValadocTagletsInheritDoc* taglet) {
	return valadoc_api_tree_inherit_doc_container_construct (VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER, taglet_container, taglet);
}


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


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


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


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


static gchar* valadoc_api_tree_value_inherit_doc_container_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		ValadocApiTreeInheritDocContainer * 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_api_tree_inherit_doc_container_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* valadoc_api_tree_value_inherit_doc_container_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	ValadocApiTreeInheritDocContainer ** 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_api_tree_inherit_doc_container_ref (value->data[0].v_pointer);
	}
	return NULL;
}


static GParamSpec* valadoc_api_tree_param_spec_inherit_doc_container (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ValadocApiTreeParamSpecInheritDocContainer* spec;
	g_return_val_if_fail (g_type_is_a (object_type, VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER), 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);
}


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


static void valadoc_api_tree_value_set_inherit_doc_container (GValue* value, gpointer v_object) {
	ValadocApiTreeInheritDocContainer * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER));
		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_api_tree_inherit_doc_container_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		valadoc_api_tree_inherit_doc_container_unref (old);
	}
}


static void valadoc_api_tree_value_take_inherit_doc_container (GValue* value, gpointer v_object) {
	ValadocApiTreeInheritDocContainer * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER));
		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_api_tree_inherit_doc_container_unref (old);
	}
}


static void valadoc_api_tree_inherit_doc_container_class_init (ValadocApiTreeInheritDocContainerClass * klass) {
	valadoc_api_tree_inherit_doc_container_parent_class = g_type_class_peek_parent (klass);
	((ValadocApiTreeInheritDocContainerClass *) klass)->finalize = valadoc_api_tree_inherit_doc_container_finalize;
}


static void valadoc_api_tree_inherit_doc_container_instance_init (ValadocApiTreeInheritDocContainer * self) {
	self->ref_count = 1;
}


static void valadoc_api_tree_inherit_doc_container_finalize (ValadocApiTreeInheritDocContainer * obj) {
	ValadocApiTreeInheritDocContainer * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER, ValadocApiTreeInheritDocContainer);
	g_signal_handlers_destroy (self);
}


static GType valadoc_api_tree_inherit_doc_container_get_type (void) {
	static volatile gsize valadoc_api_tree_inherit_doc_container_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_api_tree_inherit_doc_container_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { valadoc_api_tree_value_inherit_doc_container_init, valadoc_api_tree_value_inherit_doc_container_free_value, valadoc_api_tree_value_inherit_doc_container_copy_value, valadoc_api_tree_value_inherit_doc_container_peek_pointer, "p", valadoc_api_tree_value_inherit_doc_container_collect_value, "p", valadoc_api_tree_value_inherit_doc_container_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (ValadocApiTreeInheritDocContainerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_api_tree_inherit_doc_container_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocApiTreeInheritDocContainer), 0, (GInstanceInitFunc) valadoc_api_tree_inherit_doc_container_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_api_tree_inherit_doc_container_type_id;
		valadoc_api_tree_inherit_doc_container_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ValadocApiTreeInheritDocContainer", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&valadoc_api_tree_inherit_doc_container_type_id__volatile, valadoc_api_tree_inherit_doc_container_type_id);
	}
	return valadoc_api_tree_inherit_doc_container_type_id__volatile;
}


static gpointer valadoc_api_tree_inherit_doc_container_ref (gpointer instance) {
	ValadocApiTreeInheritDocContainer * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


static void valadoc_api_tree_inherit_doc_container_unref (gpointer instance) {
	ValadocApiTreeInheritDocContainer * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		VALADOC_API_TREE_INHERIT_DOC_CONTAINER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


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


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


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


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


static gchar* valadoc_api_value_tree_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		ValadocApiTree * 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_api_tree_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* valadoc_api_value_tree_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	ValadocApiTree ** 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_api_tree_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* valadoc_api_param_spec_tree (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ValadocApiParamSpecTree* spec;
	g_return_val_if_fail (g_type_is_a (object_type, VALADOC_API_TYPE_TREE), 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_api_value_get_tree (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALADOC_API_TYPE_TREE), NULL);
	return value->data[0].v_pointer;
}


void valadoc_api_value_set_tree (GValue* value, gpointer v_object) {
	ValadocApiTree * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALADOC_API_TYPE_TREE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALADOC_API_TYPE_TREE));
		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_api_tree_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		valadoc_api_tree_unref (old);
	}
}


void valadoc_api_value_take_tree (GValue* value, gpointer v_object) {
	ValadocApiTree * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, VALADOC_API_TYPE_TREE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, VALADOC_API_TYPE_TREE));
		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_api_tree_unref (old);
	}
}


static void valadoc_api_tree_class_init (ValadocApiTreeClass * klass) {
	valadoc_api_tree_parent_class = g_type_class_peek_parent (klass);
	((ValadocApiTreeClass *) klass)->finalize = valadoc_api_tree_finalize;
	g_type_class_add_private (klass, sizeof (ValadocApiTreePrivate));
}


static void valadoc_api_tree_instance_init (ValadocApiTree * self) {
	GEqualFunc _tmp0_;
	ValaArrayList* _tmp1_;
	GEqualFunc _tmp2_;
	ValaArrayList* _tmp3_;
	GEqualFunc _tmp4_;
	ValaArrayList* _tmp5_;
	self->priv = VALADOC_API_TREE_GET_PRIVATE (self);
	_tmp0_ = g_direct_equal;
	_tmp1_ = vala_array_list_new (VALADOC_API_TREE_TYPE_INHERIT_DOC_CONTAINER, (GBoxedCopyFunc) valadoc_api_tree_inherit_doc_container_ref, (GDestroyNotify) valadoc_api_tree_inherit_doc_container_unref, _tmp0_);
	self->priv->inheritdocs = (ValaList*) _tmp1_;
	_tmp2_ = g_str_equal;
	_tmp3_ = vala_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp2_);
	self->priv->external_c_files = _tmp3_;
	_tmp4_ = g_direct_equal;
	_tmp5_ = vala_array_list_new (VALADOC_API_TYPE_PACKAGE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp4_);
	self->priv->packages = _tmp5_;
	self->priv->source_package = NULL;
	self->priv->_cresolver = NULL;
	self->ref_count = 1;
}


static void valadoc_api_tree_finalize (ValadocApiTree * obj) {
	ValadocApiTree * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_API_TYPE_TREE, ValadocApiTree);
	g_signal_handlers_destroy (self);
	_vala_iterable_unref0 (self->priv->inheritdocs);
	_vala_iterable_unref0 (self->priv->external_c_files);
	_vala_iterable_unref0 (self->priv->packages);
	_g_object_unref0 (self->priv->source_package);
	_g_object_unref0 (self->priv->settings);
	_g_object_unref0 (self->priv->reporter);
	_g_object_unref0 (self->priv->_highlighter);
	_g_object_unref0 (self->priv->_cresolver);
	_g_object_unref0 (self->priv->_source_package);
	_g_object_unref0 (self->priv->_wikitree);
}


/**
 * The root of the code tree.
 */
GType valadoc_api_tree_get_type (void) {
	static volatile gsize valadoc_api_tree_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_api_tree_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { valadoc_api_value_tree_init, valadoc_api_value_tree_free_value, valadoc_api_value_tree_copy_value, valadoc_api_value_tree_peek_pointer, "p", valadoc_api_value_tree_collect_value, "p", valadoc_api_value_tree_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (ValadocApiTreeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_api_tree_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocApiTree), 0, (GInstanceInitFunc) valadoc_api_tree_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_api_tree_type_id;
		valadoc_api_tree_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ValadocApiTree", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&valadoc_api_tree_type_id__volatile, valadoc_api_tree_type_id);
	}
	return valadoc_api_tree_type_id__volatile;
}


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


void valadoc_api_tree_unref (gpointer instance) {
	ValadocApiTree * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		VALADOC_API_TREE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



