/* aur_plugin.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from aur_plugin.vala, do not modify */

/*
 *  pamac-vala
 *
 *  Copyright (C) 2014-2023 Guillaume Benoit <guillaume@manjaro.org>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a get of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <float.h>
#include <math.h>
#include <json-glib/json-glib.h>
#include <glib/gi18n-lib.h>
#include <alpm.h>
#include <unistd.h>
#include <sys/types.h>
#include <gio/gio.h>
#include <stdio.h>
#include "pamac-aur.h"
#include <gmodule.h>

#define PAMAC_AUR_aur_url "https://aur.archlinux.org"
#define PAMAC_AUR_manjaro_url "https://aur.manjaro.org"
#define PAMAC_AUR_db_name "packages-meta-ext-v1"
#define PAMAC_AUR_db_ext ".json.gz"
#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

#define PAMAC_TYPE_AUR_INFOS (pamac_aur_infos_get_type ())
#define PAMAC_AUR_INFOS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_AUR_INFOS, PamacAURInfos))
#define PAMAC_AUR_INFOS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAMAC_TYPE_AUR_INFOS, PamacAURInfosClass))
#define PAMAC_IS_AUR_INFOS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_AUR_INFOS))
#define PAMAC_IS_AUR_INFOS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAMAC_TYPE_AUR_INFOS))
#define PAMAC_AUR_INFOS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAMAC_TYPE_AUR_INFOS, PamacAURInfosClass))

typedef struct _PamacAURInfos PamacAURInfos;
typedef struct _PamacAURInfosClass PamacAURInfosClass;
typedef struct _PamacAURInfosPrivate PamacAURInfosPrivate;

#define PAMAC_TYPE_AUR_INFOS_LINKED (pamac_aur_infos_linked_get_type ())
#define PAMAC_AUR_INFOS_LINKED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_AUR_INFOS_LINKED, PamacAURInfosLinked))
#define PAMAC_AUR_INFOS_LINKED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAMAC_TYPE_AUR_INFOS_LINKED, PamacAURInfosLinkedClass))
#define PAMAC_IS_AUR_INFOS_LINKED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_AUR_INFOS_LINKED))
#define PAMAC_IS_AUR_INFOS_LINKED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAMAC_TYPE_AUR_INFOS_LINKED))
#define PAMAC_AUR_INFOS_LINKED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAMAC_TYPE_AUR_INFOS_LINKED, PamacAURInfosLinkedClass))

typedef struct _PamacAURInfosLinked PamacAURInfosLinked;
typedef struct _PamacAURInfosLinkedClass PamacAURInfosLinkedClass;
typedef struct _PamacAURInfosLinkedPrivate PamacAURInfosLinkedPrivate;
enum  {
	PAMAC_AUR_INFOS_LINKED_0_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_NAME_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_VERSION_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_DESC_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_LICENSE_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_URL_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_GROUPS_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_DEPENDS_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_OPTDEPENDS_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_MAKEDEPENDS_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_CHECKDEPENDS_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_PROVIDES_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_REPLACES_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_CONFLICTS_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_PACKAGEBASE_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_MAINTAINER_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_POPULARITY_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_LASTMODIFIED_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_OUTOFDATE_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_FIRSTSUBMITTED_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_NUMVOTES_PROPERTY,
	PAMAC_AUR_INFOS_LINKED_NUM_PROPERTIES
};
static GParamSpec* pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_NUM_PROPERTIES];
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define PAMAC_TYPE_AUR_PLUGIN (pamac_aur_plugin_get_type ())
#define PAMAC_AUR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_AUR_PLUGIN, PamacAURPlugin))
#define PAMAC_IS_AUR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_AUR_PLUGIN))
#define PAMAC_AUR_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), PAMAC_TYPE_AUR_PLUGIN, PamacAURPluginIface))

typedef struct _PamacAURPlugin PamacAURPlugin;
typedef struct _PamacAURPluginIface PamacAURPluginIface;

#define PAMAC_TYPE_AUR (pamac_aur_get_type ())
#define PAMAC_AUR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PAMAC_TYPE_AUR, PamacAUR))
#define PAMAC_AUR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PAMAC_TYPE_AUR, PamacAURClass))
#define PAMAC_IS_AUR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PAMAC_TYPE_AUR))
#define PAMAC_IS_AUR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PAMAC_TYPE_AUR))
#define PAMAC_AUR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PAMAC_TYPE_AUR, PamacAURClass))

typedef struct _PamacAUR PamacAUR;
typedef struct _PamacAURClass PamacAURClass;
typedef struct _PamacAURPrivate PamacAURPrivate;

#define TYPE_ALPM_CONFIG (alpm_config_get_type ())
#define ALPM_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_ALPM_CONFIG, AlpmConfig))
#define ALPM_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_ALPM_CONFIG, AlpmConfigClass))
#define IS_ALPM_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_ALPM_CONFIG))
#define IS_ALPM_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_ALPM_CONFIG))
#define ALPM_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_ALPM_CONFIG, AlpmConfigClass))

typedef struct _AlpmConfig AlpmConfig;
typedef struct _AlpmConfigClass AlpmConfigClass;
enum  {
	PAMAC_AUR_0_PROPERTY,
	PAMAC_AUR_NUM_PROPERTIES
};
static GParamSpec* pamac_aur_properties[PAMAC_AUR_NUM_PROPERTIES];
#define _alpm_config_unref0(var) ((var == NULL) ? NULL : (var = (alpm_config_unref (var), NULL)))
#define _alpm_release0(var) ((var == NULL) ? NULL : (var = (alpm_release (var), NULL)))
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

struct _PamacAURInfos {
	GObject parent_instance;
	PamacAURInfosPrivate * priv;
};

struct _PamacAURInfosClass {
	GObjectClass parent_class;
	const gchar* (*get_name) (PamacAURInfos* self);
	const gchar* (*get_version) (PamacAURInfos* self);
	const gchar* (*get_desc) (PamacAURInfos* self);
	const gchar* (*get_license) (PamacAURInfos* self);
	const gchar* (*get_url) (PamacAURInfos* self);
	GPtrArray* (*get_groups) (PamacAURInfos* self);
	GPtrArray* (*get_depends) (PamacAURInfos* self);
	GPtrArray* (*get_optdepends) (PamacAURInfos* self);
	GPtrArray* (*get_makedepends) (PamacAURInfos* self);
	GPtrArray* (*get_checkdepends) (PamacAURInfos* self);
	GPtrArray* (*get_provides) (PamacAURInfos* self);
	GPtrArray* (*get_replaces) (PamacAURInfos* self);
	GPtrArray* (*get_conflicts) (PamacAURInfos* self);
	const gchar* (*get_packagebase) (PamacAURInfos* self);
	const gchar* (*get_maintainer) (PamacAURInfos* self);
	gdouble (*get_popularity) (PamacAURInfos* self);
	GDateTime* (*get_lastmodified) (PamacAURInfos* self);
	GDateTime* (*get_outofdate) (PamacAURInfos* self);
	GDateTime* (*get_firstsubmitted) (PamacAURInfos* self);
	guint64 (*get_numvotes) (PamacAURInfos* self);
};

struct _PamacAURInfosLinked {
	PamacAURInfos parent_instance;
	PamacAURInfosLinkedPrivate * priv;
};

struct _PamacAURInfosLinkedClass {
	PamacAURInfosClass parent_class;
};

struct _PamacAURInfosLinkedPrivate {
	JsonObject* json_object;
	gboolean license_set;
	const gchar* _name;
	const gchar* _version;
	const gchar* _desc;
	gchar* _license;
	const gchar* _url;
	GPtrArray* _groups;
	GPtrArray* _depends;
	GPtrArray* _optdepends;
	GPtrArray* _makedepends;
	GPtrArray* _checkdepends;
	GPtrArray* _provides;
	GPtrArray* _replaces;
	GPtrArray* _conflicts;
	const gchar* _packagebase;
	const gchar* _maintainer;
	gdouble _popularity;
	GDateTime* _lastmodified;
	GDateTime* _outofdate;
	GDateTime* _firstsubmitted;
	guint64 _numvotes;
};

struct _PamacAURPluginIface {
	GTypeInterface parent_iface;
	void (*set_real_build_dir) (PamacAURPlugin* self, const gchar* config_aur_build_dir);
	const gchar* (*get_real_build_dir) (PamacAURPlugin* self);
	PamacAURInfos* (*get_infos) (PamacAURPlugin* self, const gchar* pkgname);
	GPtrArray* (*get_multi_infos) (PamacAURPlugin* self, GPtrArray* pkgnames);
	GPtrArray* (*get_providers) (PamacAURPlugin* self, const gchar* depend);
	GPtrArray* (*search) (PamacAURPlugin* self, const gchar* search_string);
};

struct _PamacAUR {
	GObject parent_instance;
	PamacAURPrivate * priv;
	alpm_handle_t* alpm_handle;
};

struct _PamacAURClass {
	GObjectClass parent_class;
};

struct _PamacAURPrivate {
	AlpmConfig* alpm_config;
	GHashTable* cached_infos;
	GRecMutex __lock_cached_infos;
	GHashTable* search_results;
	GRecMutex __lock_search_results;
	gchar* real_build_dir;
	gboolean db_loaded;
};

static gint PamacAURInfosLinked_private_offset;
static gpointer pamac_aur_infos_linked_parent_class = NULL;
static gint PamacAUR_private_offset;
static gpointer pamac_aur_parent_class = NULL;
static PamacAURPluginIface * pamac_aur_pamac_aur_plugin_parent_iface = NULL;

VALA_EXTERN GType pamac_aur_infos_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_aur_infos_linked_get_type (void) G_GNUC_CONST ;
VALA_EXTERN const gchar* pamac_aur_infos_get_name (PamacAURInfos* self);
VALA_EXTERN const gchar* pamac_aur_infos_get_version (PamacAURInfos* self);
VALA_EXTERN const gchar* pamac_aur_infos_get_desc (PamacAURInfos* self);
VALA_EXTERN const gchar* pamac_aur_infos_get_license (PamacAURInfos* self);
VALA_EXTERN const gchar* pamac_aur_infos_get_url (PamacAURInfos* self);
VALA_EXTERN GPtrArray* pamac_aur_infos_get_groups (PamacAURInfos* self);
VALA_EXTERN GPtrArray* pamac_aur_infos_get_depends (PamacAURInfos* self);
VALA_EXTERN GPtrArray* pamac_aur_infos_get_optdepends (PamacAURInfos* self);
VALA_EXTERN GPtrArray* pamac_aur_infos_get_makedepends (PamacAURInfos* self);
VALA_EXTERN GPtrArray* pamac_aur_infos_get_checkdepends (PamacAURInfos* self);
VALA_EXTERN GPtrArray* pamac_aur_infos_get_provides (PamacAURInfos* self);
VALA_EXTERN GPtrArray* pamac_aur_infos_get_replaces (PamacAURInfos* self);
VALA_EXTERN GPtrArray* pamac_aur_infos_get_conflicts (PamacAURInfos* self);
VALA_EXTERN const gchar* pamac_aur_infos_get_packagebase (PamacAURInfos* self);
VALA_EXTERN const gchar* pamac_aur_infos_get_maintainer (PamacAURInfos* self);
VALA_EXTERN gdouble pamac_aur_infos_get_popularity (PamacAURInfos* self);
VALA_EXTERN GDateTime* pamac_aur_infos_get_lastmodified (PamacAURInfos* self);
VALA_EXTERN GDateTime* pamac_aur_infos_get_outofdate (PamacAURInfos* self);
VALA_EXTERN GDateTime* pamac_aur_infos_get_firstsubmitted (PamacAURInfos* self);
VALA_EXTERN guint64 pamac_aur_infos_get_numvotes (PamacAURInfos* self);
VALA_EXTERN PamacAURInfosLinked* pamac_aur_infos_linked_new (JsonObject* json_object);
VALA_EXTERN PamacAURInfosLinked* pamac_aur_infos_linked_construct (GType object_type,
                                                       JsonObject* json_object);
VALA_EXTERN PamacAURInfos* pamac_aur_infos_construct (GType object_type);
static void pamac_aur_infos_linked_get_property_array (PamacAURInfosLinked* self,
                                                const gchar* property,
                                                GPtrArray** array);
static void _g_free0_ (gpointer var);
static void pamac_aur_infos_linked_finalize (GObject * obj);
static GType pamac_aur_infos_linked_get_type_once (void);
static void _vala_pamac_aur_infos_linked_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec);
VALA_EXTERN GType pamac_aur_plugin_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType pamac_aur_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gpointer alpm_config_ref (gpointer instance);
VALA_EXTERN void alpm_config_unref (gpointer instance);
VALA_EXTERN GParamSpec* param_spec_alpm_config (const gchar* name,
                                    const gchar* nick,
                                    const gchar* blurb,
                                    GType object_type,
                                    GParamFlags flags);
VALA_EXTERN void value_set_alpm_config (GValue* value,
                            gpointer v_object);
VALA_EXTERN void value_take_alpm_config (GValue* value,
                             gpointer v_object);
VALA_EXTERN gpointer value_get_alpm_config (const GValue* value);
VALA_EXTERN GType alpm_config_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PamacAUR* pamac_aur_new (void);
VALA_EXTERN PamacAUR* pamac_aur_construct (GType object_type);
static const gchar* pamac_aur_real_get_real_build_dir (PamacAURPlugin* base);
static void pamac_aur_real_set_real_build_dir (PamacAURPlugin* base,
                                        const gchar* config_aur_build_dir);
static void pamac_aur_parse_db (PamacAUR* self,
                         gboolean force);
static void* _g_realloc_grealloc_func (void* data,
                                gsize size);
static void _g_free_gdestroy_notify (void* data);
static PamacAURInfos* pamac_aur_real_get_infos (PamacAURPlugin* base,
                                         const gchar* pkgname);
static GPtrArray* pamac_aur_real_get_multi_infos (PamacAURPlugin* base,
                                           GPtrArray* pkgnames);
static GPtrArray* pamac_aur_real_get_providers (PamacAURPlugin* base,
                                         const gchar* depend);
static GPtrArray* pamac_aur_real_search (PamacAURPlugin* base,
                                  const gchar* search_string);
static void _g_object_unref0_ (gpointer var);
static gboolean pamac_aur_find_match (PamacAUR* self,
                               PamacAURInfosLinked* data,
                               const gchar* targ,
                               GRegex* regex);
static GObject * pamac_aur_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties);
static void _g_ptr_array_unref0_ (gpointer var);
VALA_EXTERN gchar* get_user_agent (void);
VALA_EXTERN AlpmConfig* alpm_config_new (const gchar* path);
VALA_EXTERN AlpmConfig* alpm_config_construct (GType object_type,
                                   const gchar* path);
VALA_EXTERN alpm_handle_t* alpm_config_get_handle (AlpmConfig* self,
                                       gboolean files_db,
                                       gboolean tmp_db,
                                       gboolean copy_dbs);
VALA_EXTERN gchar* get_os_id (void);
VALA_EXTERN const gchar* pamac_aur_plugin_get_real_build_dir (PamacAURPlugin* self);
VALA_EXTERN void pamac_aur_plugin_set_real_build_dir (PamacAURPlugin* self,
                                          const gchar* config_aur_build_dir);
VALA_EXTERN PamacAURInfos* pamac_aur_plugin_get_infos (PamacAURPlugin* self,
                                           const gchar* pkgname);
VALA_EXTERN GPtrArray* pamac_aur_plugin_get_multi_infos (PamacAURPlugin* self,
                                             GPtrArray* pkgnames);
VALA_EXTERN GPtrArray* pamac_aur_plugin_get_providers (PamacAURPlugin* self,
                                           const gchar* depend);
VALA_EXTERN GPtrArray* pamac_aur_plugin_search (PamacAURPlugin* self,
                                    const gchar* search_string);
static void pamac_aur_finalize (GObject * obj);
static GType pamac_aur_get_type_once (void);
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 gssize _vala_array_length (gpointer array);

static inline gpointer
pamac_aur_infos_linked_get_instance_private (PamacAURInfosLinked* self)
{
	return G_STRUCT_MEMBER_P (self, PamacAURInfosLinked_private_offset);
}

static gpointer
_json_object_ref0 (gpointer self)
{
	return self ? json_object_ref (self) : NULL;
}

PamacAURInfosLinked*
pamac_aur_infos_linked_construct (GType object_type,
                                  JsonObject* json_object)
{
	PamacAURInfosLinked * self = NULL;
	JsonObject* _tmp0_;
	self = (PamacAURInfosLinked*) pamac_aur_infos_construct (object_type);
	_tmp0_ = _json_object_ref0 (json_object);
	_json_object_unref0 (self->priv->json_object);
	self->priv->json_object = _tmp0_;
	return self;
}

PamacAURInfosLinked*
pamac_aur_infos_linked_new (JsonObject* json_object)
{
	return pamac_aur_infos_linked_construct (PAMAC_TYPE_AUR_INFOS_LINKED, json_object);
}

static void
pamac_aur_infos_linked_get_property_array (PamacAURInfosLinked* self,
                                           const gchar* property,
                                           GPtrArray** array)
{
	JsonObject* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (property != NULL);
	g_return_if_fail (*array != NULL);
	_tmp0_ = self->priv->json_object;
	if (_tmp0_ != NULL) {
		JsonNode* node = NULL;
		JsonObject* _tmp1_;
		JsonNode* _tmp2_;
		JsonNode* _tmp3_;
		_tmp1_ = self->priv->json_object;
		_tmp2_ = json_object_get_member (_tmp1_, property);
		node = _tmp2_;
		_tmp3_ = node;
		if (_tmp3_ != NULL) {
			JsonArray* json_array = NULL;
			JsonNode* _tmp4_;
			JsonArray* _tmp5_;
			JsonArray* _tmp6_;
			_tmp4_ = node;
			_tmp5_ = json_node_get_array (_tmp4_);
			json_array = _tmp5_;
			_tmp6_ = json_array;
			if (_tmp6_ != NULL) {
				guint json_array_length = 0U;
				JsonArray* _tmp7_;
				_tmp7_ = json_array;
				json_array_length = json_array_get_length (_tmp7_);
				{
					guint i = 0U;
					i = (guint) 0;
					{
						gboolean _tmp8_ = FALSE;
						_tmp8_ = TRUE;
						while (TRUE) {
							JsonArray* _tmp10_;
							const gchar* _tmp11_;
							gchar* _tmp12_;
							if (!_tmp8_) {
								guint _tmp9_;
								_tmp9_ = i;
								i = _tmp9_ + 1;
							}
							_tmp8_ = FALSE;
							if (!(i < json_array_length)) {
								break;
							}
							_tmp10_ = json_array;
							_tmp11_ = json_array_get_string_element (_tmp10_, i);
							_tmp12_ = g_strdup (_tmp11_);
							g_ptr_array_add (*array, _tmp12_);
						}
					}
				}
			}
		}
	}
}

static const gchar*
pamac_aur_infos_linked_real_get_name (PamacAURInfos* base)
{
	const gchar* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp5_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_name;
	if (_tmp1_ == NULL) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonObject* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = self->priv->json_object;
		_tmp4_ = json_object_get_string_member (_tmp3_, "Name");
		self->priv->_name = _tmp4_;
	}
	_tmp5_ = self->priv->_name;
	result = _tmp5_;
	return result;
}

static const gchar*
pamac_aur_infos_linked_real_get_version (PamacAURInfos* base)
{
	const gchar* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp5_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_version;
	if (_tmp1_ == NULL) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonObject* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = self->priv->json_object;
		_tmp4_ = json_object_get_string_member (_tmp3_, "Version");
		self->priv->_version = _tmp4_;
	}
	_tmp5_ = self->priv->_version;
	result = _tmp5_;
	return result;
}

static const gchar*
pamac_aur_infos_linked_real_get_desc (PamacAURInfos* base)
{
	const gchar* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp8_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_desc;
	if (_tmp1_ == NULL) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonNode* node = NULL;
		JsonObject* _tmp3_;
		JsonNode* _tmp4_;
		JsonNode* _tmp5_;
		_tmp3_ = self->priv->json_object;
		_tmp4_ = json_object_get_member (_tmp3_, "Description");
		node = _tmp4_;
		_tmp5_ = node;
		if (_tmp5_ != NULL) {
			JsonNode* _tmp6_;
			const gchar* _tmp7_;
			_tmp6_ = node;
			_tmp7_ = json_node_get_string (_tmp6_);
			self->priv->_desc = _tmp7_;
		}
	}
	_tmp8_ = self->priv->_desc;
	result = _tmp8_;
	return result;
}

static const gchar*
pamac_aur_infos_linked_real_get_license (PamacAURInfos* base)
{
	const gchar* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp21_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_license;
	if (_tmp1_ == NULL) {
		_tmp0_ = !self->priv->license_set;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonObject* _tmp2_;
		self->priv->license_set = TRUE;
		_tmp2_ = self->priv->json_object;
		if (_tmp2_ != NULL) {
			JsonNode* node = NULL;
			JsonObject* _tmp3_;
			JsonNode* _tmp4_;
			JsonNode* _tmp5_;
			_tmp3_ = self->priv->json_object;
			_tmp4_ = json_object_get_member (_tmp3_, "License");
			node = _tmp4_;
			_tmp5_ = node;
			if (_tmp5_ != NULL) {
				JsonArray* json_array = NULL;
				JsonNode* _tmp6_;
				JsonArray* _tmp7_;
				GString* license_str = NULL;
				JsonArray* _tmp8_;
				const gchar* _tmp9_;
				GString* _tmp10_;
				guint json_array_length = 0U;
				JsonArray* _tmp11_;
				GString* _tmp18_;
				gchar* _tmp19_;
				_tmp6_ = node;
				_tmp7_ = json_node_get_array (_tmp6_);
				json_array = _tmp7_;
				_tmp8_ = json_array;
				_tmp9_ = json_array_get_string_element (_tmp8_, (guint) 0);
				_tmp10_ = g_string_new (_tmp9_);
				license_str = _tmp10_;
				_tmp11_ = json_array;
				json_array_length = json_array_get_length (_tmp11_);
				{
					guint i = 0U;
					i = (guint) 1;
					{
						gboolean _tmp12_ = FALSE;
						_tmp12_ = TRUE;
						while (TRUE) {
							GString* _tmp14_;
							GString* _tmp15_;
							JsonArray* _tmp16_;
							const gchar* _tmp17_;
							if (!_tmp12_) {
								guint _tmp13_;
								_tmp13_ = i;
								i = _tmp13_ + 1;
							}
							_tmp12_ = FALSE;
							if (!(i < json_array_length)) {
								break;
							}
							_tmp14_ = license_str;
							g_string_append (_tmp14_, " ");
							_tmp15_ = license_str;
							_tmp16_ = json_array;
							_tmp17_ = json_array_get_string_element (_tmp16_, i);
							g_string_append (_tmp15_, _tmp17_);
						}
					}
				}
				_tmp18_ = license_str;
				_tmp19_ = _tmp18_->str;
				_tmp18_->str = NULL;
				_g_free0 (self->priv->_license);
				self->priv->_license = _tmp19_;
				_g_string_free0 (license_str);
			} else {
				gchar* _tmp20_;
				_tmp20_ = g_strdup (g_dgettext (NULL, "Unknown"));
				_g_free0 (self->priv->_license);
				self->priv->_license = _tmp20_;
			}
		}
	}
	_tmp21_ = self->priv->_license;
	result = _tmp21_;
	return result;
}

static const gchar*
pamac_aur_infos_linked_real_get_url (PamacAURInfos* base)
{
	const gchar* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp8_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_url;
	if (_tmp1_ == NULL) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonNode* node = NULL;
		JsonObject* _tmp3_;
		JsonNode* _tmp4_;
		JsonNode* _tmp5_;
		_tmp3_ = self->priv->json_object;
		_tmp4_ = json_object_get_member (_tmp3_, "URL");
		node = _tmp4_;
		_tmp5_ = node;
		if (_tmp5_ != NULL) {
			JsonNode* _tmp6_;
			const gchar* _tmp7_;
			_tmp6_ = node;
			_tmp7_ = json_node_get_string (_tmp6_);
			self->priv->_url = _tmp7_;
		}
	}
	_tmp8_ = self->priv->_url;
	result = _tmp8_;
	return result;
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static GPtrArray*
pamac_aur_infos_linked_real_get_groups (PamacAURInfos* base)
{
	GPtrArray* result;
	PamacAURInfosLinked* self;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	self = (PamacAURInfosLinked*) base;
	_tmp0_ = self->priv->_groups;
	if (_tmp0_ == NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
		_g_ptr_array_unref0 (self->priv->_groups);
		self->priv->_groups = _tmp1_;
		pamac_aur_infos_linked_get_property_array (self, "Groups", &self->priv->_groups);
	}
	_tmp2_ = self->priv->_groups;
	result = _tmp2_;
	return result;
}

static GPtrArray*
pamac_aur_infos_linked_real_get_depends (PamacAURInfos* base)
{
	GPtrArray* result;
	PamacAURInfosLinked* self;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	self = (PamacAURInfosLinked*) base;
	_tmp0_ = self->priv->_depends;
	if (_tmp0_ == NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
		_g_ptr_array_unref0 (self->priv->_depends);
		self->priv->_depends = _tmp1_;
		pamac_aur_infos_linked_get_property_array (self, "Depends", &self->priv->_depends);
	}
	_tmp2_ = self->priv->_depends;
	result = _tmp2_;
	return result;
}

static GPtrArray*
pamac_aur_infos_linked_real_get_optdepends (PamacAURInfos* base)
{
	GPtrArray* result;
	PamacAURInfosLinked* self;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	self = (PamacAURInfosLinked*) base;
	_tmp0_ = self->priv->_optdepends;
	if (_tmp0_ == NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
		_g_ptr_array_unref0 (self->priv->_optdepends);
		self->priv->_optdepends = _tmp1_;
		pamac_aur_infos_linked_get_property_array (self, "OptDepends", &self->priv->_optdepends);
	}
	_tmp2_ = self->priv->_optdepends;
	result = _tmp2_;
	return result;
}

static GPtrArray*
pamac_aur_infos_linked_real_get_makedepends (PamacAURInfos* base)
{
	GPtrArray* result;
	PamacAURInfosLinked* self;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	self = (PamacAURInfosLinked*) base;
	_tmp0_ = self->priv->_makedepends;
	if (_tmp0_ == NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
		_g_ptr_array_unref0 (self->priv->_makedepends);
		self->priv->_makedepends = _tmp1_;
		pamac_aur_infos_linked_get_property_array (self, "MakeDepends", &self->priv->_makedepends);
	}
	_tmp2_ = self->priv->_makedepends;
	result = _tmp2_;
	return result;
}

static GPtrArray*
pamac_aur_infos_linked_real_get_checkdepends (PamacAURInfos* base)
{
	GPtrArray* result;
	PamacAURInfosLinked* self;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	self = (PamacAURInfosLinked*) base;
	_tmp0_ = self->priv->_checkdepends;
	if (_tmp0_ == NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
		_g_ptr_array_unref0 (self->priv->_checkdepends);
		self->priv->_checkdepends = _tmp1_;
		pamac_aur_infos_linked_get_property_array (self, "CheckDepends", &self->priv->_checkdepends);
	}
	_tmp2_ = self->priv->_checkdepends;
	result = _tmp2_;
	return result;
}

static GPtrArray*
pamac_aur_infos_linked_real_get_provides (PamacAURInfos* base)
{
	GPtrArray* result;
	PamacAURInfosLinked* self;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	self = (PamacAURInfosLinked*) base;
	_tmp0_ = self->priv->_provides;
	if (_tmp0_ == NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
		_g_ptr_array_unref0 (self->priv->_provides);
		self->priv->_provides = _tmp1_;
		pamac_aur_infos_linked_get_property_array (self, "Provides", &self->priv->_provides);
	}
	_tmp2_ = self->priv->_provides;
	result = _tmp2_;
	return result;
}

static GPtrArray*
pamac_aur_infos_linked_real_get_replaces (PamacAURInfos* base)
{
	GPtrArray* result;
	PamacAURInfosLinked* self;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	self = (PamacAURInfosLinked*) base;
	_tmp0_ = self->priv->_replaces;
	if (_tmp0_ == NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
		_g_ptr_array_unref0 (self->priv->_replaces);
		self->priv->_replaces = _tmp1_;
		pamac_aur_infos_linked_get_property_array (self, "Replaces", &self->priv->_replaces);
	}
	_tmp2_ = self->priv->_replaces;
	result = _tmp2_;
	return result;
}

static GPtrArray*
pamac_aur_infos_linked_real_get_conflicts (PamacAURInfos* base)
{
	GPtrArray* result;
	PamacAURInfosLinked* self;
	GPtrArray* _tmp0_;
	GPtrArray* _tmp2_;
	self = (PamacAURInfosLinked*) base;
	_tmp0_ = self->priv->_conflicts;
	if (_tmp0_ == NULL) {
		GPtrArray* _tmp1_;
		_tmp1_ = g_ptr_array_new_full ((guint) 0, _g_free0_);
		_g_ptr_array_unref0 (self->priv->_conflicts);
		self->priv->_conflicts = _tmp1_;
		pamac_aur_infos_linked_get_property_array (self, "Conflicts", &self->priv->_conflicts);
	}
	_tmp2_ = self->priv->_conflicts;
	result = _tmp2_;
	return result;
}

static const gchar*
pamac_aur_infos_linked_real_get_packagebase (PamacAURInfos* base)
{
	const gchar* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp5_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_packagebase;
	if (_tmp1_ == NULL) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonObject* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = self->priv->json_object;
		_tmp4_ = json_object_get_string_member (_tmp3_, "PackageBase");
		self->priv->_packagebase = _tmp4_;
	}
	_tmp5_ = self->priv->_packagebase;
	result = _tmp5_;
	return result;
}

static const gchar*
pamac_aur_infos_linked_real_get_maintainer (PamacAURInfos* base)
{
	const gchar* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp5_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_maintainer;
	if (_tmp1_ == NULL) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonObject* _tmp3_;
		const gchar* _tmp4_;
		_tmp3_ = self->priv->json_object;
		_tmp4_ = json_object_get_string_member (_tmp3_, "Maintainer");
		self->priv->_maintainer = _tmp4_;
	}
	_tmp5_ = self->priv->_maintainer;
	result = _tmp5_;
	return result;
}

static gdouble
pamac_aur_infos_linked_real_get_popularity (PamacAURInfos* base)
{
	gdouble result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	self = (PamacAURInfosLinked*) base;
	if (self->priv->_popularity == ((gdouble) 0)) {
		JsonObject* _tmp1_;
		_tmp1_ = self->priv->json_object;
		_tmp0_ = _tmp1_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		self->priv->_popularity = json_object_get_double_member (_tmp2_, "Popularity");
	}
	result = self->priv->_popularity;
	return result;
}

static GDateTime*
pamac_aur_infos_linked_real_get_lastmodified (PamacAURInfos* base)
{
	GDateTime* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	GDateTime* _tmp1_;
	GDateTime* _tmp5_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_lastmodified;
	if (_tmp1_ == NULL) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonObject* _tmp3_;
		GDateTime* _tmp4_;
		_tmp3_ = self->priv->json_object;
		_tmp4_ = g_date_time_new_from_unix_local (json_object_get_int_member (_tmp3_, "LastModified"));
		_g_date_time_unref0 (self->priv->_lastmodified);
		self->priv->_lastmodified = _tmp4_;
	}
	_tmp5_ = self->priv->_lastmodified;
	result = _tmp5_;
	return result;
}

static GDateTime*
pamac_aur_infos_linked_real_get_outofdate (PamacAURInfos* base)
{
	GDateTime* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	GDateTime* _tmp1_;
	GDateTime* _tmp8_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_outofdate;
	if (_tmp1_ == NULL) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonNode* node = NULL;
		JsonObject* _tmp3_;
		JsonNode* _tmp4_;
		JsonNode* _tmp5_;
		_tmp3_ = self->priv->json_object;
		_tmp4_ = json_object_get_member (_tmp3_, "OutOfDate");
		node = _tmp4_;
		_tmp5_ = node;
		if (!json_node_is_null (_tmp5_)) {
			JsonNode* _tmp6_;
			GDateTime* _tmp7_;
			_tmp6_ = node;
			_tmp7_ = g_date_time_new_from_unix_local (json_node_get_int (_tmp6_));
			_g_date_time_unref0 (self->priv->_outofdate);
			self->priv->_outofdate = _tmp7_;
		}
	}
	_tmp8_ = self->priv->_outofdate;
	result = _tmp8_;
	return result;
}

static GDateTime*
pamac_aur_infos_linked_real_get_firstsubmitted (PamacAURInfos* base)
{
	GDateTime* result;
	PamacAURInfosLinked* self;
	gboolean _tmp0_ = FALSE;
	GDateTime* _tmp1_;
	GDateTime* _tmp5_;
	self = (PamacAURInfosLinked*) base;
	_tmp1_ = self->priv->_firstsubmitted;
	if (_tmp1_ == NULL) {
		JsonObject* _tmp2_;
		_tmp2_ = self->priv->json_object;
		_tmp0_ = _tmp2_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		JsonObject* _tmp3_;
		GDateTime* _tmp4_;
		_tmp3_ = self->priv->json_object;
		_tmp4_ = g_date_time_new_from_unix_local (json_object_get_int_member (_tmp3_, "FirstSubmitted"));
		_g_date_time_unref0 (self->priv->_firstsubmitted);
		self->priv->_firstsubmitted = _tmp4_;
	}
	_tmp5_ = self->priv->_firstsubmitted;
	result = _tmp5_;
	return result;
}

static guint64
pamac_aur_infos_linked_real_get_numvotes (PamacAURInfos* base)
{
	guint64 result;
	PamacAURInfosLinked* self;
	self = (PamacAURInfosLinked*) base;
	if (self->priv->_numvotes == ((guint64) 0)) {
		JsonObject* _tmp0_;
		_tmp0_ = self->priv->json_object;
		self->priv->_numvotes = (guint64) json_object_get_int_member (_tmp0_, "NumVotes");
	}
	result = self->priv->_numvotes;
	return result;
}

static void
pamac_aur_infos_linked_class_init (PamacAURInfosLinkedClass * klass,
                                   gpointer klass_data)
{
	pamac_aur_infos_linked_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PamacAURInfosLinked_private_offset);
	PAMAC_AUR_INFOS_CLASS (klass)->get_name = (const gchar* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_name;
	PAMAC_AUR_INFOS_CLASS (klass)->get_version = (const gchar* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_version;
	PAMAC_AUR_INFOS_CLASS (klass)->get_desc = (const gchar* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_desc;
	PAMAC_AUR_INFOS_CLASS (klass)->get_license = (const gchar* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_license;
	PAMAC_AUR_INFOS_CLASS (klass)->get_url = (const gchar* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_url;
	PAMAC_AUR_INFOS_CLASS (klass)->get_groups = (GPtrArray* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_groups;
	PAMAC_AUR_INFOS_CLASS (klass)->get_depends = (GPtrArray* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_depends;
	PAMAC_AUR_INFOS_CLASS (klass)->get_optdepends = (GPtrArray* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_optdepends;
	PAMAC_AUR_INFOS_CLASS (klass)->get_makedepends = (GPtrArray* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_makedepends;
	PAMAC_AUR_INFOS_CLASS (klass)->get_checkdepends = (GPtrArray* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_checkdepends;
	PAMAC_AUR_INFOS_CLASS (klass)->get_provides = (GPtrArray* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_provides;
	PAMAC_AUR_INFOS_CLASS (klass)->get_replaces = (GPtrArray* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_replaces;
	PAMAC_AUR_INFOS_CLASS (klass)->get_conflicts = (GPtrArray* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_conflicts;
	PAMAC_AUR_INFOS_CLASS (klass)->get_packagebase = (const gchar* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_packagebase;
	PAMAC_AUR_INFOS_CLASS (klass)->get_maintainer = (const gchar* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_maintainer;
	PAMAC_AUR_INFOS_CLASS (klass)->get_popularity = (gdouble (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_popularity;
	PAMAC_AUR_INFOS_CLASS (klass)->get_lastmodified = (GDateTime* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_lastmodified;
	PAMAC_AUR_INFOS_CLASS (klass)->get_outofdate = (GDateTime* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_outofdate;
	PAMAC_AUR_INFOS_CLASS (klass)->get_firstsubmitted = (GDateTime* (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_firstsubmitted;
	PAMAC_AUR_INFOS_CLASS (klass)->get_numvotes = (guint64 (*) (PamacAURInfos*)) pamac_aur_infos_linked_real_get_numvotes;
	G_OBJECT_CLASS (klass)->get_property = _vala_pamac_aur_infos_linked_get_property;
	G_OBJECT_CLASS (klass)->finalize = pamac_aur_infos_linked_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_NAME_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_VERSION_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_VERSION_PROPERTY] = g_param_spec_string ("version", "version", "version", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_DESC_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_DESC_PROPERTY] = g_param_spec_string ("desc", "desc", "desc", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_LICENSE_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_LICENSE_PROPERTY] = g_param_spec_string ("license", "license", "license", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_URL_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_URL_PROPERTY] = g_param_spec_string ("url", "url", "url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_GROUPS_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_GROUPS_PROPERTY] = g_param_spec_boxed ("groups", "groups", "groups", G_TYPE_PTR_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_DEPENDS_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_DEPENDS_PROPERTY] = g_param_spec_boxed ("depends", "depends", "depends", G_TYPE_PTR_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_OPTDEPENDS_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_OPTDEPENDS_PROPERTY] = g_param_spec_boxed ("optdepends", "optdepends", "optdepends", G_TYPE_PTR_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_MAKEDEPENDS_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_MAKEDEPENDS_PROPERTY] = g_param_spec_boxed ("makedepends", "makedepends", "makedepends", G_TYPE_PTR_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_CHECKDEPENDS_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_CHECKDEPENDS_PROPERTY] = g_param_spec_boxed ("checkdepends", "checkdepends", "checkdepends", G_TYPE_PTR_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_PROVIDES_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_PROVIDES_PROPERTY] = g_param_spec_boxed ("provides", "provides", "provides", G_TYPE_PTR_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_REPLACES_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_REPLACES_PROPERTY] = g_param_spec_boxed ("replaces", "replaces", "replaces", G_TYPE_PTR_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_CONFLICTS_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_CONFLICTS_PROPERTY] = g_param_spec_boxed ("conflicts", "conflicts", "conflicts", G_TYPE_PTR_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_PACKAGEBASE_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_PACKAGEBASE_PROPERTY] = g_param_spec_string ("packagebase", "packagebase", "packagebase", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_MAINTAINER_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_MAINTAINER_PROPERTY] = g_param_spec_string ("maintainer", "maintainer", "maintainer", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_POPULARITY_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_POPULARITY_PROPERTY] = g_param_spec_double ("popularity", "popularity", "popularity", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_LASTMODIFIED_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_LASTMODIFIED_PROPERTY] = g_param_spec_boxed ("lastmodified", "lastmodified", "lastmodified", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_OUTOFDATE_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_OUTOFDATE_PROPERTY] = g_param_spec_boxed ("outofdate", "outofdate", "outofdate", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_FIRSTSUBMITTED_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_FIRSTSUBMITTED_PROPERTY] = g_param_spec_boxed ("firstsubmitted", "firstsubmitted", "firstsubmitted", G_TYPE_DATE_TIME, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PAMAC_AUR_INFOS_LINKED_NUMVOTES_PROPERTY, pamac_aur_infos_linked_properties[PAMAC_AUR_INFOS_LINKED_NUMVOTES_PROPERTY] = g_param_spec_uint64 ("numvotes", "numvotes", "numvotes", 0, G_MAXUINT64, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
pamac_aur_infos_linked_instance_init (PamacAURInfosLinked * self,
                                      gpointer klass)
{
	self->priv = pamac_aur_infos_linked_get_instance_private (self);
}

static void
pamac_aur_infos_linked_finalize (GObject * obj)
{
	PamacAURInfosLinked * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PAMAC_TYPE_AUR_INFOS_LINKED, PamacAURInfosLinked);
	_json_object_unref0 (self->priv->json_object);
	_g_free0 (self->priv->_license);
	_g_ptr_array_unref0 (self->priv->_groups);
	_g_ptr_array_unref0 (self->priv->_depends);
	_g_ptr_array_unref0 (self->priv->_optdepends);
	_g_ptr_array_unref0 (self->priv->_makedepends);
	_g_ptr_array_unref0 (self->priv->_checkdepends);
	_g_ptr_array_unref0 (self->priv->_provides);
	_g_ptr_array_unref0 (self->priv->_replaces);
	_g_ptr_array_unref0 (self->priv->_conflicts);
	_g_date_time_unref0 (self->priv->_lastmodified);
	_g_date_time_unref0 (self->priv->_outofdate);
	_g_date_time_unref0 (self->priv->_firstsubmitted);
	G_OBJECT_CLASS (pamac_aur_infos_linked_parent_class)->finalize (obj);
}

static GType
pamac_aur_infos_linked_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PamacAURInfosLinkedClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pamac_aur_infos_linked_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PamacAURInfosLinked), 0, (GInstanceInitFunc) pamac_aur_infos_linked_instance_init, NULL };
	GType pamac_aur_infos_linked_type_id;
	pamac_aur_infos_linked_type_id = g_type_register_static (PAMAC_TYPE_AUR_INFOS, "PamacAURInfosLinked", &g_define_type_info, 0);
	PamacAURInfosLinked_private_offset = g_type_add_instance_private (pamac_aur_infos_linked_type_id, sizeof (PamacAURInfosLinkedPrivate));
	return pamac_aur_infos_linked_type_id;
}

GType
pamac_aur_infos_linked_get_type (void)
{
	static volatile gsize pamac_aur_infos_linked_type_id__once = 0;
	if (g_once_init_enter (&pamac_aur_infos_linked_type_id__once)) {
		GType pamac_aur_infos_linked_type_id;
		pamac_aur_infos_linked_type_id = pamac_aur_infos_linked_get_type_once ();
		g_once_init_leave (&pamac_aur_infos_linked_type_id__once, pamac_aur_infos_linked_type_id);
	}
	return pamac_aur_infos_linked_type_id__once;
}

static void
_vala_pamac_aur_infos_linked_get_property (GObject * object,
                                           guint property_id,
                                           GValue * value,
                                           GParamSpec * pspec)
{
	PamacAURInfosLinked * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PAMAC_TYPE_AUR_INFOS_LINKED, PamacAURInfosLinked);
	switch (property_id) {
		case PAMAC_AUR_INFOS_LINKED_NAME_PROPERTY:
		g_value_set_string (value, pamac_aur_infos_get_name ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_VERSION_PROPERTY:
		g_value_set_string (value, pamac_aur_infos_get_version ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_DESC_PROPERTY:
		g_value_set_string (value, pamac_aur_infos_get_desc ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_LICENSE_PROPERTY:
		g_value_set_string (value, pamac_aur_infos_get_license ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_URL_PROPERTY:
		g_value_set_string (value, pamac_aur_infos_get_url ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_GROUPS_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_groups ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_DEPENDS_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_depends ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_OPTDEPENDS_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_optdepends ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_MAKEDEPENDS_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_makedepends ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_CHECKDEPENDS_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_checkdepends ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_PROVIDES_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_provides ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_REPLACES_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_replaces ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_CONFLICTS_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_conflicts ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_PACKAGEBASE_PROPERTY:
		g_value_set_string (value, pamac_aur_infos_get_packagebase ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_MAINTAINER_PROPERTY:
		g_value_set_string (value, pamac_aur_infos_get_maintainer ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_POPULARITY_PROPERTY:
		g_value_set_double (value, pamac_aur_infos_get_popularity ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_LASTMODIFIED_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_lastmodified ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_OUTOFDATE_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_outofdate ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_FIRSTSUBMITTED_PROPERTY:
		g_value_set_boxed (value, pamac_aur_infos_get_firstsubmitted ((PamacAURInfos*) self));
		break;
		case PAMAC_AUR_INFOS_LINKED_NUMVOTES_PROPERTY:
		g_value_set_uint64 (value, pamac_aur_infos_get_numvotes ((PamacAURInfos*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
pamac_aur_get_instance_private (PamacAUR* self)
{
	return G_STRUCT_MEMBER_P (self, PamacAUR_private_offset);
}

PamacAUR*
pamac_aur_construct (GType object_type)
{
	PamacAUR * self = NULL;
	self = (PamacAUR*) g_object_new (object_type, NULL);
	return self;
}

PamacAUR*
pamac_aur_new (void)
{
	return pamac_aur_construct (PAMAC_TYPE_AUR);
}

static const gchar*
pamac_aur_real_get_real_build_dir (PamacAURPlugin* base)
{
	PamacAUR * self;
	const gchar* _tmp0_;
	const gchar* result;
	self = (PamacAUR*) base;
	_tmp0_ = self->priv->real_build_dir;
	result = _tmp0_;
	return result;
}

static void
pamac_aur_real_set_real_build_dir (PamacAURPlugin* base,
                                   const gchar* config_aur_build_dir)
{
	PamacAUR * self;
	self = (PamacAUR*) base;
	g_return_if_fail (config_aur_build_dir != NULL);
	if (geteuid () == ((uid_t) 0)) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("/var/cache/pamac");
		_g_free0 (self->priv->real_build_dir);
		self->priv->real_build_dir = _tmp0_;
	} else {
		gboolean _tmp1_ = FALSE;
		if (g_strcmp0 (config_aur_build_dir, "/var/tmp") == 0) {
			_tmp1_ = TRUE;
		} else {
			_tmp1_ = g_strcmp0 (config_aur_build_dir, "/tmp") == 0;
		}
		if (_tmp1_) {
			const gchar* _tmp2_;
			gchar* _tmp3_;
			gchar* _tmp4_;
			gchar* _tmp5_;
			_tmp2_ = g_get_user_name ();
			_tmp3_ = g_strdup_printf ("pamac-build-%s", _tmp2_);
			_tmp4_ = _tmp3_;
			_tmp5_ = g_build_filename (config_aur_build_dir, _tmp4_, NULL);
			_g_free0 (self->priv->real_build_dir);
			self->priv->real_build_dir = _tmp5_;
			_g_free0 (_tmp4_);
		} else {
			gchar* _tmp6_;
			_tmp6_ = g_strdup (config_aur_build_dir);
			_g_free0 (self->priv->real_build_dir);
			self->priv->real_build_dir = _tmp6_;
		}
	}
}

static void*
_g_realloc_grealloc_func (void* data,
                          gsize size)
{
	void* result;
	result = g_realloc (data, size);
	return result;
}

static void
_g_free_gdestroy_notify (void* data)
{
	g_free (data);
}

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

static void
pamac_aur_parse_db (PamacAUR* self,
                    gboolean force)
{
	gboolean _tmp0_ = FALSE;
	alpm_handle_t* _tmp1_;
	gchar* absolute_path = NULL;
	alpm_handle_t* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	GFile* zipfile = NULL;
	const gchar* _tmp7_;
	GFile* _tmp8_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->alpm_handle;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp2_ = FALSE;
		if (!force) {
			_tmp2_ = self->priv->db_loaded;
		} else {
			_tmp2_ = FALSE;
		}
		_tmp0_ = _tmp2_;
	}
	if (_tmp0_) {
		return;
	}
	_tmp3_ = self->alpm_handle;
	_tmp4_ = alpm_option_get_dbpath (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_build_filename (_tmp5_, "sync", PAMAC_AUR_db_name PAMAC_AUR_db_ext, NULL);
	absolute_path = _tmp6_;
	_tmp7_ = absolute_path;
	_tmp8_ = g_file_new_for_path (_tmp7_);
	zipfile = _tmp8_;
	{
		GFileInputStream* src_stream = NULL;
		GFile* _tmp9_;
		GFileInputStream* _tmp10_;
		GMemoryOutputStream* dst_stream = NULL;
		GMemoryOutputStream* _tmp11_;
		GConverterOutputStream* conv_stream = NULL;
		GMemoryOutputStream* _tmp12_;
		GZlibDecompressor* _tmp13_;
		GZlibDecompressor* _tmp14_;
		GConverterOutputStream* _tmp15_;
		GConverterOutputStream* _tmp16_;
		GConverterOutputStream* _tmp17_;
		GFileInputStream* _tmp18_;
		JsonParser* parser = NULL;
		JsonParser* _tmp19_;
		JsonParser* _tmp20_;
		GMemoryOutputStream* _tmp21_;
		guint8* _tmp22_;
		JsonNode* root = NULL;
		JsonParser* _tmp23_;
		JsonNode* _tmp24_;
		JsonNode* _tmp25_;
		_tmp9_ = zipfile;
		_tmp10_ = g_file_read (_tmp9_, NULL, &_inner_error0_);
		src_stream = _tmp10_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp11_ = (GMemoryOutputStream*) g_memory_output_stream_new (NULL, 0, _g_realloc_grealloc_func, _g_free_gdestroy_notify);
		dst_stream = _tmp11_;
		_tmp12_ = dst_stream;
		_tmp13_ = g_zlib_decompressor_new (G_ZLIB_COMPRESSOR_FORMAT_GZIP);
		_tmp14_ = _tmp13_;
		_tmp15_ = (GConverterOutputStream*) g_converter_output_stream_new ((GOutputStream*) _tmp12_, (GConverter*) _tmp14_);
		_tmp16_ = _tmp15_;
		_g_object_unref0 (_tmp14_);
		conv_stream = _tmp16_;
		_tmp17_ = conv_stream;
		_tmp18_ = src_stream;
		g_output_stream_splice ((GOutputStream*) _tmp17_, (GInputStream*) _tmp18_, 0, NULL, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (conv_stream);
			_g_object_unref0 (dst_stream);
			_g_object_unref0 (src_stream);
			goto __catch0_g_error;
		}
		_tmp19_ = json_parser_new_immutable ();
		parser = _tmp19_;
		_tmp20_ = parser;
		_tmp21_ = dst_stream;
		_tmp22_ = g_memory_output_stream_get_data (_tmp21_);
		json_parser_load_from_data (_tmp20_, (const gchar*) _tmp22_, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (parser);
			_g_object_unref0 (conv_stream);
			_g_object_unref0 (dst_stream);
			_g_object_unref0 (src_stream);
			goto __catch0_g_error;
		}
		_tmp23_ = parser;
		_tmp24_ = json_parser_get_root (_tmp23_);
		root = _tmp24_;
		_tmp25_ = root;
		if (_tmp25_ == NULL) {
			FILE* _tmp26_;
			const gchar* _tmp27_;
			_tmp26_ = stderr;
			_tmp27_ = absolute_path;
			fprintf (_tmp26_, "Failed to read AUR data from %s\n", _tmp27_);
		} else {
			JsonArray* array = NULL;
			JsonNode* _tmp28_;
			JsonArray* _tmp29_;
			JsonArray* _tmp30_;
			_tmp28_ = root;
			_tmp29_ = json_node_get_array (_tmp28_);
			array = _tmp29_;
			_tmp30_ = array;
			if (_tmp30_ == NULL) {
				FILE* _tmp31_;
				const gchar* _tmp32_;
				_tmp31_ = stderr;
				_tmp32_ = absolute_path;
				fprintf (_tmp31_, "Failed to read AUR data from %s\n", _tmp32_);
			} else {
				{
					GHashTable* _tmp33_;
					_tmp33_ = self->priv->search_results;
					g_rec_mutex_lock (&self->priv->__lock_search_results);
					{
						GHashTable* _tmp34_;
						_tmp34_ = self->priv->search_results;
						g_hash_table_remove_all (_tmp34_);
					}
					__finally1:
					{
						GHashTable* _tmp35_;
						_tmp35_ = self->priv->search_results;
						g_rec_mutex_unlock (&self->priv->__lock_search_results);
					}
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (parser);
						_g_object_unref0 (conv_stream);
						_g_object_unref0 (dst_stream);
						_g_object_unref0 (src_stream);
						goto __catch0_g_error;
					}
				}
				{
					GHashTable* _tmp36_;
					_tmp36_ = self->priv->cached_infos;
					g_rec_mutex_lock (&self->priv->__lock_cached_infos);
					{
						GHashTable* _tmp37_;
						guint array_length = 0U;
						JsonArray* _tmp38_;
						_tmp37_ = self->priv->cached_infos;
						g_hash_table_remove_all (_tmp37_);
						_tmp38_ = array;
						array_length = json_array_get_length (_tmp38_);
						{
							guint i = 0U;
							i = (guint) 0;
							{
								gboolean _tmp39_ = FALSE;
								_tmp39_ = TRUE;
								while (TRUE) {
									JsonObject* json_object = NULL;
									JsonArray* _tmp41_;
									JsonObject* _tmp42_;
									PamacAURInfosLinked* data = NULL;
									JsonObject* _tmp43_;
									PamacAURInfosLinked* _tmp44_;
									GHashTable* _tmp45_;
									PamacAURInfosLinked* _tmp46_;
									const gchar* _tmp47_;
									const gchar* _tmp48_;
									gchar* _tmp49_;
									PamacAURInfosLinked* _tmp50_;
									PamacAURInfosLinked* _tmp51_;
									if (!_tmp39_) {
										guint _tmp40_;
										_tmp40_ = i;
										i = _tmp40_ + 1;
									}
									_tmp39_ = FALSE;
									if (!(i < array_length)) {
										break;
									}
									_tmp41_ = array;
									_tmp42_ = json_array_get_object_element (_tmp41_, i);
									json_object = _tmp42_;
									_tmp43_ = json_object;
									_tmp44_ = pamac_aur_infos_linked_new (_tmp43_);
									data = _tmp44_;
									_tmp45_ = self->priv->cached_infos;
									_tmp46_ = data;
									_tmp47_ = pamac_aur_infos_get_name ((PamacAURInfos*) _tmp46_);
									_tmp48_ = _tmp47_;
									_tmp49_ = g_strdup (_tmp48_);
									_tmp50_ = data;
									_tmp51_ = _g_object_ref0 (_tmp50_);
									g_hash_table_insert (_tmp45_, _tmp49_, _tmp51_);
									_g_object_unref0 (data);
								}
							}
						}
						self->priv->db_loaded = TRUE;
					}
					__finally2:
					{
						GHashTable* _tmp52_;
						_tmp52_ = self->priv->cached_infos;
						g_rec_mutex_unlock (&self->priv->__lock_cached_infos);
					}
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_object_unref0 (parser);
						_g_object_unref0 (conv_stream);
						_g_object_unref0 (dst_stream);
						_g_object_unref0 (src_stream);
						goto __catch0_g_error;
					}
				}
			}
		}
		_g_object_unref0 (parser);
		_g_object_unref0 (conv_stream);
		_g_object_unref0 (dst_stream);
		_g_object_unref0 (src_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		FILE* _tmp53_;
		const gchar* _tmp54_;
		GError* _tmp55_;
		const gchar* _tmp56_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp53_ = stderr;
		_tmp54_ = absolute_path;
		_tmp55_ = e;
		_tmp56_ = _tmp55_->message;
		fprintf (_tmp53_, "Failed to read AUR data from %s : %s\n", _tmp54_, _tmp56_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (zipfile);
		_g_free0 (absolute_path);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_g_object_unref0 (zipfile);
	_g_free0 (absolute_path);
}

static PamacAURInfos*
pamac_aur_real_get_infos (PamacAURPlugin* base,
                          const gchar* pkgname)
{
	PamacAUR * self;
	PamacAURInfosLinked* data = NULL;
	GError* _inner_error0_ = NULL;
	PamacAURInfos* result;
	self = (PamacAUR*) base;
	g_return_val_if_fail (pkgname != NULL, NULL);
	data = NULL;
	pamac_aur_parse_db (self, FALSE);
	{
		GHashTable* _tmp0_;
		_tmp0_ = self->priv->cached_infos;
		g_rec_mutex_lock (&self->priv->__lock_cached_infos);
		{
			GHashTable* _tmp1_;
			gconstpointer _tmp2_;
			PamacAURInfosLinked* _tmp3_;
			_tmp1_ = self->priv->cached_infos;
			_tmp2_ = g_hash_table_lookup (_tmp1_, pkgname);
			_tmp3_ = _g_object_ref0 ((PamacAURInfosLinked*) _tmp2_);
			_g_object_unref0 (data);
			data = _tmp3_;
		}
		__finally0:
		{
			GHashTable* _tmp4_;
			_tmp4_ = self->priv->cached_infos;
			g_rec_mutex_unlock (&self->priv->__lock_cached_infos);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (data);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = (PamacAURInfos*) data;
	return result;
}

static GPtrArray*
pamac_aur_real_get_multi_infos (PamacAURPlugin* base,
                                GPtrArray* pkgnames)
{
	PamacAUR * self;
	GPtrArray* _result_ = NULL;
	GPtrArray* _tmp0_;
	GError* _inner_error0_ = NULL;
	GPtrArray* result;
	self = (PamacAUR*) base;
	g_return_val_if_fail (pkgnames != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_result_ = _tmp0_;
	pamac_aur_parse_db (self, FALSE);
	{
		GHashTable* _tmp1_;
		_tmp1_ = self->priv->cached_infos;
		g_rec_mutex_lock (&self->priv->__lock_cached_infos);
		{
			{
				GPtrArray* pkgname_collection = NULL;
				guint pkgname_index = 0U;
				pkgname_collection = pkgnames;
				for (pkgname_index = 0; pkgname_index < pkgname_collection->len; pkgname_index = pkgname_index + 1) {
					const gchar* pkgname = NULL;
					pkgname = (const gchar*) g_ptr_array_index (pkgname_collection, pkgname_index);
					{
						PamacAURInfosLinked* data = NULL;
						GHashTable* _tmp2_;
						const gchar* _tmp3_;
						gconstpointer _tmp4_;
						PamacAURInfosLinked* _tmp5_;
						_tmp2_ = self->priv->cached_infos;
						_tmp3_ = pkgname;
						_tmp4_ = g_hash_table_lookup (_tmp2_, _tmp3_);
						data = (PamacAURInfosLinked*) _tmp4_;
						_tmp5_ = data;
						if (_tmp5_ != NULL) {
							GPtrArray* _tmp6_;
							PamacAURInfosLinked* _tmp7_;
							_tmp6_ = _result_;
							_tmp7_ = data;
							g_ptr_array_add (_tmp6_, _tmp7_);
						}
					}
				}
			}
		}
		__finally0:
		{
			GHashTable* _tmp8_;
			_tmp8_ = self->priv->cached_infos;
			g_rec_mutex_unlock (&self->priv->__lock_cached_infos);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_ptr_array_unref0 (_result_);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = _result_;
	return result;
}

static GPtrArray*
pamac_aur_real_get_providers (PamacAURPlugin* base,
                              const gchar* depend)
{
	PamacAUR * self;
	GPtrArray* _result_ = NULL;
	GPtrArray* _tmp0_;
	GError* _inner_error0_ = NULL;
	GPtrArray* result;
	self = (PamacAUR*) base;
	g_return_val_if_fail (depend != NULL, NULL);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, NULL);
	_result_ = _tmp0_;
	pamac_aur_parse_db (self, FALSE);
	{
		GHashTable* _tmp1_;
		_tmp1_ = self->priv->cached_infos;
		g_rec_mutex_lock (&self->priv->__lock_cached_infos);
		{
			GHashTableIter iter = {0};
			GHashTable* _tmp2_;
			PamacAURInfosLinked* data = NULL;
			_tmp2_ = self->priv->cached_infos;
			g_hash_table_iter_init (&iter, _tmp2_);
			while (TRUE) {
				gconstpointer _tmp3_ = NULL;
				gboolean _tmp4_;
				PamacAURInfosLinked* _tmp5_;
				GPtrArray* _tmp6_;
				GPtrArray* _tmp7_;
				_tmp4_ = g_hash_table_iter_next (&iter, (gpointer*) NULL, (gpointer*) (&_tmp3_));
				data = (PamacAURInfosLinked*) _tmp3_;
				if (!_tmp4_) {
					break;
				}
				_tmp5_ = data;
				_tmp6_ = pamac_aur_infos_get_provides ((PamacAURInfos*) _tmp5_);
				_tmp7_ = _tmp6_;
				{
					GPtrArray* provide_collection = NULL;
					guint provide_index = 0U;
					provide_collection = _tmp7_;
					for (provide_index = 0; provide_index < provide_collection->len; provide_index = provide_index + 1) {
						const gchar* provide = NULL;
						provide = (const gchar*) g_ptr_array_index (provide_collection, provide_index);
						{
							const gchar* _tmp8_;
							_tmp8_ = provide;
							if (g_str_has_prefix (_tmp8_, depend)) {
								GPtrArray* _tmp9_;
								PamacAURInfosLinked* _tmp10_;
								_tmp9_ = _result_;
								_tmp10_ = data;
								g_ptr_array_add (_tmp9_, _tmp10_);
							}
						}
					}
				}
			}
		}
		__finally0:
		{
			GHashTable* _tmp11_;
			_tmp11_ = self->priv->cached_infos;
			g_rec_mutex_unlock (&self->priv->__lock_cached_infos);
		}
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_ptr_array_unref0 (_result_);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	result = _result_;
	return result;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static gpointer
_g_ptr_array_ref0 (gpointer self)
{
	return self ? g_ptr_array_ref (self) : NULL;
}

static GPtrArray*
pamac_aur_real_search (PamacAURPlugin* base,
                       const gchar* search_string)
{
	PamacAUR * self;
	GPtrArray* needle_match = NULL;
	GPtrArray* _tmp0_;
	gchar** needles = NULL;
	gchar** _tmp1_;
	gchar** _tmp2_;
	gint needles_length1;
	gint _needles_size_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	GError* _inner_error0_ = NULL;
	GPtrArray* result;
	self = (PamacAUR*) base;
	g_return_val_if_fail (search_string != NULL, NULL);
	pamac_aur_parse_db (self, FALSE);
	_tmp0_ = g_ptr_array_new_full ((guint) 0, _g_object_unref0_);
	needle_match = _tmp0_;
	_tmp2_ = _tmp1_ = g_strsplit (search_string, " ", 0);
	needles = _tmp2_;
	needles_length1 = _vala_array_length (_tmp1_);
	_needles_size_ = needles_length1;
	_tmp3_ = needles;
	_tmp3__length1 = needles_length1;
	if (_tmp3__length1 == 0) {
		GPtrArray* _tmp4_;
		_tmp4_ = g_ptr_array_new_full ((guint) 0, _g_object_unref0_);
		result = _tmp4_;
		needles = (_vala_array_free (needles, needles_length1, (GDestroyNotify) g_free), NULL);
		_g_ptr_array_unref0 (needle_match);
		return result;
	} else {
		const gchar* targ = NULL;
		gchar** _tmp5_;
		gint _tmp5__length1;
		const gchar* _tmp6_;
		GRegex* regex = NULL;
		guint needles_length = 0U;
		gchar** _tmp24_;
		gint _tmp24__length1;
		_tmp5_ = needles;
		_tmp5__length1 = needles_length1;
		_tmp6_ = _tmp5_[0];
		targ = _tmp6_;
		regex = NULL;
		{
			GRegex* _tmp7_ = NULL;
			const gchar* _tmp8_;
			GRegex* _tmp9_;
			GRegex* _tmp10_;
			_tmp8_ = targ;
			_tmp9_ = g_regex_new (_tmp8_, 0, 0, &_inner_error0_);
			_tmp7_ = _tmp9_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_tmp10_ = _tmp7_;
			_tmp7_ = NULL;
			_g_regex_unref0 (regex);
			regex = _tmp10_;
			_g_regex_unref0 (_tmp7_);
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp11_;
			const gchar* _tmp12_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp11_ = e;
			_tmp12_ = _tmp11_->message;
			g_warning ("aur_plugin.vala:410: %s", _tmp12_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			needles = (_vala_array_free (needles, needles_length1, (GDestroyNotify) g_free), NULL);
			_g_ptr_array_unref0 (needle_match);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		{
			GHashTable* _tmp13_;
			_tmp13_ = self->priv->cached_infos;
			g_rec_mutex_lock (&self->priv->__lock_cached_infos);
			{
				GHashTableIter iter = {0};
				GHashTable* _tmp14_;
				PamacAURInfosLinked* data = NULL;
				_tmp14_ = self->priv->cached_infos;
				g_hash_table_iter_init (&iter, _tmp14_);
				while (TRUE) {
					gconstpointer _tmp15_ = NULL;
					gboolean _tmp16_;
					PamacAURInfosLinked* _tmp17_;
					const gchar* _tmp18_;
					GRegex* _tmp19_;
					_tmp16_ = g_hash_table_iter_next (&iter, (gpointer*) NULL, (gpointer*) (&_tmp15_));
					data = (PamacAURInfosLinked*) _tmp15_;
					if (!_tmp16_) {
						break;
					}
					_tmp17_ = data;
					_tmp18_ = targ;
					_tmp19_ = regex;
					if (pamac_aur_find_match (self, _tmp17_, _tmp18_, _tmp19_)) {
						GPtrArray* _tmp20_;
						PamacAURInfosLinked* _tmp21_;
						PamacAURInfosLinked* _tmp22_;
						_tmp20_ = needle_match;
						_tmp21_ = data;
						_tmp22_ = _g_object_ref0 (_tmp21_);
						g_ptr_array_add (_tmp20_, _tmp22_);
					}
				}
			}
			__finally1:
			{
				GHashTable* _tmp23_;
				_tmp23_ = self->priv->cached_infos;
				g_rec_mutex_unlock (&self->priv->__lock_cached_infos);
			}
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				_g_regex_unref0 (regex);
				needles = (_vala_array_free (needles, needles_length1, (GDestroyNotify) g_free), NULL);
				_g_ptr_array_unref0 (needle_match);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
				g_clear_error (&_inner_error0_);
				return NULL;
			}
		}
		_tmp24_ = needles;
		_tmp24__length1 = needles_length1;
		needles_length = (guint) _tmp24__length1;
		if (needles_length > ((guint) 1)) {
			GPtrArray* all_match = NULL;
			GPtrArray* _tmp25_;
			GPtrArray* _tmp26_;
			guint i = 0U;
			_tmp25_ = needle_match;
			_tmp26_ = _g_ptr_array_ref0 (_tmp25_);
			all_match = _tmp26_;
			{
				gboolean _tmp27_ = FALSE;
				i = (guint) 1;
				_tmp27_ = TRUE;
				while (TRUE) {
					GPtrArray* _tmp29_;
					gchar** _tmp30_;
					gint _tmp30__length1;
					const gchar* _tmp31_;
					GPtrArray* _tmp38_;
					GPtrArray* _tmp45_;
					GPtrArray* _tmp46_;
					if (!_tmp27_) {
						guint _tmp28_;
						_tmp28_ = i;
						i = _tmp28_ + 1;
					}
					_tmp27_ = FALSE;
					if (!(i < needles_length)) {
						break;
					}
					_tmp29_ = g_ptr_array_new_full ((guint) 0, _g_object_unref0_);
					_g_ptr_array_unref0 (needle_match);
					needle_match = _tmp29_;
					_tmp30_ = needles;
					_tmp30__length1 = needles_length1;
					_tmp31_ = _tmp30_[i];
					targ = _tmp31_;
					{
						GRegex* _tmp32_ = NULL;
						const gchar* _tmp33_;
						GRegex* _tmp34_;
						GRegex* _tmp35_;
						_tmp33_ = targ;
						_tmp34_ = g_regex_new (_tmp33_, 0, 0, &_inner_error0_);
						_tmp32_ = _tmp34_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							goto __catch2_g_error;
						}
						_tmp35_ = _tmp32_;
						_tmp32_ = NULL;
						_g_regex_unref0 (regex);
						regex = _tmp35_;
						_g_regex_unref0 (_tmp32_);
					}
					goto __finally2;
					__catch2_g_error:
					{
						GError* e = NULL;
						GError* _tmp36_;
						const gchar* _tmp37_;
						e = _inner_error0_;
						_inner_error0_ = NULL;
						_tmp36_ = e;
						_tmp37_ = _tmp36_->message;
						g_warning ("aur_plugin.vala:431: %s", _tmp37_);
						_g_error_free0 (e);
					}
					__finally2:
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						_g_ptr_array_unref0 (all_match);
						_g_regex_unref0 (regex);
						needles = (_vala_array_free (needles, needles_length1, (GDestroyNotify) g_free), NULL);
						_g_ptr_array_unref0 (needle_match);
						g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
						g_clear_error (&_inner_error0_);
						return NULL;
					}
					_tmp38_ = all_match;
					{
						GPtrArray* data_collection = NULL;
						guint data_index = 0U;
						data_collection = _tmp38_;
						for (data_index = 0; data_index < data_collection->len; data_index = data_index + 1) {
							PamacAURInfosLinked* data = NULL;
							data = (PamacAURInfosLinked*) g_ptr_array_index (data_collection, data_index);
							{
								PamacAURInfosLinked* _tmp39_;
								const gchar* _tmp40_;
								GRegex* _tmp41_;
								_tmp39_ = data;
								_tmp40_ = targ;
								_tmp41_ = regex;
								if (pamac_aur_find_match (self, _tmp39_, _tmp40_, _tmp41_)) {
									GPtrArray* _tmp42_;
									PamacAURInfosLinked* _tmp43_;
									PamacAURInfosLinked* _tmp44_;
									_tmp42_ = needle_match;
									_tmp43_ = data;
									_tmp44_ = _g_object_ref0 (_tmp43_);
									g_ptr_array_add (_tmp42_, _tmp44_);
								}
							}
						}
					}
					_tmp45_ = needle_match;
					_tmp46_ = _g_ptr_array_ref0 (_tmp45_);
					_g_ptr_array_unref0 (all_match);
					all_match = _tmp46_;
				}
			}
			result = all_match;
			_g_regex_unref0 (regex);
			needles = (_vala_array_free (needles, needles_length1, (GDestroyNotify) g_free), NULL);
			_g_ptr_array_unref0 (needle_match);
			return result;
		} else {
			result = needle_match;
			_g_regex_unref0 (regex);
			needles = (_vala_array_free (needles, needles_length1, (GDestroyNotify) g_free), NULL);
			return result;
		}
		_g_regex_unref0 (regex);
	}
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
pamac_aur_find_match (PamacAUR* self,
                      PamacAURInfosLinked* data,
                      const gchar* targ,
                      GRegex* regex)
{
	gboolean matched = FALSE;
	const gchar* name = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* desc = NULL;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gboolean _tmp4_ = FALSE;
	const gchar* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (data != NULL, FALSE);
	g_return_val_if_fail (targ != NULL, FALSE);
	g_return_val_if_fail (regex != NULL, FALSE);
	matched = FALSE;
	_tmp0_ = pamac_aur_infos_get_name ((PamacAURInfos*) data);
	_tmp1_ = _tmp0_;
	name = _tmp1_;
	_tmp2_ = pamac_aur_infos_get_desc ((PamacAURInfos*) data);
	_tmp3_ = _tmp2_;
	desc = _tmp3_;
	_tmp5_ = name;
	if (_tmp5_ != NULL) {
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		const gchar* _tmp8_;
		_tmp8_ = name;
		if (g_strcmp0 (targ, _tmp8_) == 0) {
			_tmp7_ = TRUE;
		} else {
			const gchar* _tmp9_;
			gchar* _tmp10_;
			gchar* _tmp11_;
			_tmp9_ = name;
			_tmp10_ = g_utf8_strdown (_tmp9_, (gssize) -1);
			_tmp11_ = _tmp10_;
			_tmp7_ = g_strcmp0 (targ, _tmp11_) == 0;
			_g_free0 (_tmp11_);
		}
		if (_tmp7_) {
			_tmp6_ = TRUE;
		} else {
			gboolean _tmp12_ = FALSE;
			if (regex != NULL) {
				const gchar* _tmp13_;
				_tmp13_ = name;
				_tmp12_ = g_regex_match (regex, _tmp13_, 0, NULL);
			} else {
				_tmp12_ = FALSE;
			}
			_tmp6_ = _tmp12_;
		}
		_tmp4_ = _tmp6_;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		matched = TRUE;
	} else {
		gboolean _tmp14_ = FALSE;
		const gchar* _tmp15_;
		_tmp15_ = desc;
		if (_tmp15_ != NULL) {
			const gchar* _tmp16_;
			_tmp16_ = desc;
			_tmp14_ = string_contains (_tmp16_, targ);
		} else {
			_tmp14_ = FALSE;
		}
		if (_tmp14_) {
			matched = TRUE;
		}
	}
	if (!matched) {
		GPtrArray* _tmp17_;
		GPtrArray* _tmp18_;
		_tmp17_ = pamac_aur_infos_get_provides ((PamacAURInfos*) data);
		_tmp18_ = _tmp17_;
		{
			GPtrArray* provide_collection = NULL;
			guint provide_index = 0U;
			provide_collection = _tmp18_;
			for (provide_index = 0; provide_index < provide_collection->len; provide_index = provide_index + 1) {
				const gchar* provide = NULL;
				provide = (const gchar*) g_ptr_array_index (provide_collection, provide_index);
				{
					gboolean _tmp19_ = FALSE;
					const gchar* _tmp20_;
					_tmp20_ = provide;
					if (g_strcmp0 (targ, _tmp20_) == 0) {
						_tmp19_ = TRUE;
					} else {
						gboolean _tmp21_ = FALSE;
						if (regex != NULL) {
							const gchar* _tmp22_;
							_tmp22_ = provide;
							_tmp21_ = g_regex_match (regex, _tmp22_, 0, NULL);
						} else {
							_tmp21_ = FALSE;
						}
						_tmp19_ = _tmp21_;
					}
					if (_tmp19_) {
						matched = TRUE;
						break;
					}
				}
			}
		}
	}
	if (!matched) {
		GPtrArray* _tmp23_;
		GPtrArray* _tmp24_;
		_tmp23_ = pamac_aur_infos_get_groups ((PamacAURInfos*) data);
		_tmp24_ = _tmp23_;
		{
			GPtrArray* group_collection = NULL;
			guint group_index = 0U;
			group_collection = _tmp24_;
			for (group_index = 0; group_index < group_collection->len; group_index = group_index + 1) {
				const gchar* group = NULL;
				group = (const gchar*) g_ptr_array_index (group_collection, group_index);
				{
					gboolean _tmp25_ = FALSE;
					const gchar* _tmp26_;
					_tmp26_ = group;
					if (g_strcmp0 (targ, _tmp26_) == 0) {
						_tmp25_ = TRUE;
					} else {
						gboolean _tmp27_ = FALSE;
						if (regex != NULL) {
							const gchar* _tmp28_;
							_tmp28_ = group;
							_tmp27_ = g_regex_match (regex, _tmp28_, 0, NULL);
						} else {
							_tmp27_ = FALSE;
						}
						_tmp25_ = _tmp27_;
					}
					if (_tmp25_) {
						matched = TRUE;
						break;
					}
				}
			}
		}
	}
	result = matched;
	return result;
}

static void
_g_ptr_array_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL));
}

static GObject *
pamac_aur_constructor (GType type,
                       guint n_construct_properties,
                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	PamacAUR * self;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	GHashFunc _tmp3_;
	GEqualFunc _tmp4_;
	GHashTable* _tmp5_;
	gchar* user_agent = NULL;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	AlpmConfig* _tmp8_;
	AlpmConfig* _tmp9_;
	alpm_handle_t* _tmp10_;
	alpm_handle_t* _tmp11_;
	parent_class = G_OBJECT_CLASS (pamac_aur_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PAMAC_TYPE_AUR, PamacAUR);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->cached_infos);
	self->priv->cached_infos = _tmp2_;
	_tmp3_ = g_str_hash;
	_tmp4_ = g_str_equal;
	_tmp5_ = g_hash_table_new_full (_tmp3_, _tmp4_, _g_free0_, _g_ptr_array_unref0_);
	_g_hash_table_unref0 (self->priv->search_results);
	self->priv->search_results = _tmp5_;
	_tmp6_ = get_user_agent ();
	user_agent = _tmp6_;
	_tmp7_ = user_agent;
	g_setenv ("HTTP_USER_AGENT", _tmp7_, TRUE);
	_tmp8_ = alpm_config_new ("/etc/pacman.conf");
	_alpm_config_unref0 (self->priv->alpm_config);
	self->priv->alpm_config = _tmp8_;
	_tmp9_ = self->priv->alpm_config;
	_tmp10_ = alpm_config_get_handle (_tmp9_, FALSE, FALSE, FALSE);
	_alpm_release0 (self->alpm_handle);
	self->alpm_handle = _tmp10_;
	_tmp11_ = self->alpm_handle;
	if (_tmp11_ != NULL) {
		alpm_handle_t* _tmp12_;
		alpm_db_t* db = NULL;
		alpm_handle_t* _tmp13_;
		alpm_db_t* _tmp14_;
		const gchar* server = NULL;
		gchar* id = NULL;
		gchar* _tmp15_;
		gboolean _tmp16_ = FALSE;
		const gchar* _tmp17_;
		alpm_db_t* _tmp19_;
		const gchar* _tmp20_;
		alpm_db_t* _tmp21_;
		_tmp12_ = self->alpm_handle;
		alpm_option_set_dbext (_tmp12_, PAMAC_AUR_db_ext);
		_tmp13_ = self->alpm_handle;
		_tmp14_ = alpm_register_syncdb (_tmp13_, PAMAC_AUR_db_name, (gint) ALPM_SIG_USE_DEFAULT);
		db = _tmp14_;
		_tmp15_ = get_os_id ();
		id = _tmp15_;
		_tmp17_ = id;
		if (_tmp17_ == NULL) {
			_tmp16_ = TRUE;
		} else {
			const gchar* _tmp18_;
			_tmp18_ = id;
			_tmp16_ = g_strcmp0 (_tmp18_, "manjaro") != 0;
		}
		if (_tmp16_) {
			server = PAMAC_AUR_aur_url;
		} else {
			server = PAMAC_AUR_manjaro_url;
		}
		_tmp19_ = db;
		_tmp20_ = server;
		alpm_db_add_server (_tmp19_, _tmp20_);
		_tmp21_ = db;
		alpm_db_set_usage (_tmp21_, (gint) ALPM_DB_USAGE_ALL);
		_g_free0 (id);
	}
	_g_free0 (user_agent);
	return obj;
}

static void
pamac_aur_class_init (PamacAURClass * klass,
                      gpointer klass_data)
{
	pamac_aur_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PamacAUR_private_offset);
	G_OBJECT_CLASS (klass)->constructor = pamac_aur_constructor;
	G_OBJECT_CLASS (klass)->finalize = pamac_aur_finalize;
}

static void
pamac_aur_pamac_aur_plugin_interface_init (PamacAURPluginIface * iface,
                                           gpointer iface_data)
{
	pamac_aur_pamac_aur_plugin_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_real_build_dir = (const gchar* (*) (PamacAURPlugin*)) pamac_aur_real_get_real_build_dir;
	iface->set_real_build_dir = (void (*) (PamacAURPlugin*, const gchar*)) pamac_aur_real_set_real_build_dir;
	iface->get_infos = (PamacAURInfos* (*) (PamacAURPlugin*, const gchar*)) pamac_aur_real_get_infos;
	iface->get_multi_infos = (GPtrArray* (*) (PamacAURPlugin*, GPtrArray*)) pamac_aur_real_get_multi_infos;
	iface->get_providers = (GPtrArray* (*) (PamacAURPlugin*, const gchar*)) pamac_aur_real_get_providers;
	iface->search = (GPtrArray* (*) (PamacAURPlugin*, const gchar*)) pamac_aur_real_search;
}

static void
pamac_aur_instance_init (PamacAUR * self,
                         gpointer klass)
{
	self->priv = pamac_aur_get_instance_private (self);
	g_rec_mutex_init (&self->priv->__lock_cached_infos);
	g_rec_mutex_init (&self->priv->__lock_search_results);
}

static void
pamac_aur_finalize (GObject * obj)
{
	PamacAUR * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PAMAC_TYPE_AUR, PamacAUR);
	_alpm_config_unref0 (self->priv->alpm_config);
	_alpm_release0 (self->alpm_handle);
	g_rec_mutex_clear (&self->priv->__lock_cached_infos);
	_g_hash_table_unref0 (self->priv->cached_infos);
	g_rec_mutex_clear (&self->priv->__lock_search_results);
	_g_hash_table_unref0 (self->priv->search_results);
	_g_free0 (self->priv->real_build_dir);
	G_OBJECT_CLASS (pamac_aur_parent_class)->finalize (obj);
}

static GType
pamac_aur_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PamacAURClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) pamac_aur_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PamacAUR), 0, (GInstanceInitFunc) pamac_aur_instance_init, NULL };
	static const GInterfaceInfo pamac_aur_plugin_info = { (GInterfaceInitFunc) pamac_aur_pamac_aur_plugin_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType pamac_aur_type_id;
	pamac_aur_type_id = g_type_register_static (G_TYPE_OBJECT, "PamacAUR", &g_define_type_info, 0);
	g_type_add_interface_static (pamac_aur_type_id, PAMAC_TYPE_AUR_PLUGIN, &pamac_aur_plugin_info);
	PamacAUR_private_offset = g_type_add_instance_private (pamac_aur_type_id, sizeof (PamacAURPrivate));
	return pamac_aur_type_id;
}

GType
pamac_aur_get_type (void)
{
	static volatile gsize pamac_aur_type_id__once = 0;
	if (g_once_init_enter (&pamac_aur_type_id__once)) {
		GType pamac_aur_type_id;
		pamac_aur_type_id = pamac_aur_get_type_once ();
		g_once_init_leave (&pamac_aur_type_id__once, pamac_aur_type_id);
	}
	return pamac_aur_type_id__once;
}

GType
register_plugin (GModule* module)
{
	GType result;
	g_return_val_if_fail (module != NULL, 0UL);
	result = PAMAC_TYPE_AUR;
	return result;
}

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);
}

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

