/* steam-registry.c generated by valac 0.36.9, the Vala compiler
 * generated from steam-registry.vala, do not modify */

/* This file is part of GNOME Games. License: GPL-3.0+.*/

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <gobject/gvaluecollector.h>


#define GAMES_TYPE_STEAM_REGISTRY (games_steam_registry_get_type ())
#define GAMES_STEAM_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_STEAM_REGISTRY, GamesSteamRegistry))
#define GAMES_STEAM_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_STEAM_REGISTRY, GamesSteamRegistryClass))
#define GAMES_IS_STEAM_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_STEAM_REGISTRY))
#define GAMES_IS_STEAM_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_STEAM_REGISTRY))
#define GAMES_STEAM_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_STEAM_REGISTRY, GamesSteamRegistryClass))

typedef struct _GamesSteamRegistry GamesSteamRegistry;
typedef struct _GamesSteamRegistryClass GamesSteamRegistryClass;
typedef struct _GamesSteamRegistryPrivate GamesSteamRegistryPrivate;

#define GAMES_TYPE_STEAM_REGISTRY_VALUE (games_steam_registry_value_get_type ())
#define GAMES_STEAM_REGISTRY_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValue))
#define GAMES_STEAM_REGISTRY_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValueClass))
#define GAMES_IS_STEAM_REGISTRY_VALUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_STEAM_REGISTRY_VALUE))
#define GAMES_IS_STEAM_REGISTRY_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_STEAM_REGISTRY_VALUE))
#define GAMES_STEAM_REGISTRY_VALUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValueClass))

typedef struct _GamesSteamRegistryValue GamesSteamRegistryValue;
typedef struct _GamesSteamRegistryValueClass GamesSteamRegistryValueClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _games_steam_registry_unref0(var) ((var == NULL) ? NULL : (var = (games_steam_registry_unref (var), NULL)))

#define GAMES_TYPE_STEAM_REGISTRY_NODE (games_steam_registry_node_get_type ())
#define GAMES_STEAM_REGISTRY_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_STEAM_REGISTRY_NODE, GamesSteamRegistryNode))
#define GAMES_STEAM_REGISTRY_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_STEAM_REGISTRY_NODE, GamesSteamRegistryNodeClass))
#define GAMES_IS_STEAM_REGISTRY_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_STEAM_REGISTRY_NODE))
#define GAMES_IS_STEAM_REGISTRY_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_STEAM_REGISTRY_NODE))
#define GAMES_STEAM_REGISTRY_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_STEAM_REGISTRY_NODE, GamesSteamRegistryNodeClass))

typedef struct _GamesSteamRegistryNode GamesSteamRegistryNode;
typedef struct _GamesSteamRegistryNodeClass GamesSteamRegistryNodeClass;

#define GAMES_TYPE_STEAM_REGISTRY_DATA (games_steam_registry_data_get_type ())
#define GAMES_STEAM_REGISTRY_DATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryData))
#define GAMES_STEAM_REGISTRY_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryDataClass))
#define GAMES_IS_STEAM_REGISTRY_DATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAMES_TYPE_STEAM_REGISTRY_DATA))
#define GAMES_IS_STEAM_REGISTRY_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAMES_TYPE_STEAM_REGISTRY_DATA))
#define GAMES_STEAM_REGISTRY_DATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryDataClass))

typedef struct _GamesSteamRegistryData GamesSteamRegistryData;
typedef struct _GamesSteamRegistryDataClass GamesSteamRegistryDataClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_match_info_unref0(var) ((var == NULL) ? NULL : (var = (g_match_info_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _GamesParamSpecSteamRegistry GamesParamSpecSteamRegistry;
typedef struct _GamesSteamRegistryValuePrivate GamesSteamRegistryValuePrivate;
typedef struct _GamesSteamRegistryNodePrivate GamesSteamRegistryNodePrivate;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
typedef struct _GamesSteamRegistryDataPrivate GamesSteamRegistryDataPrivate;

struct _GamesSteamRegistry {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GamesSteamRegistryPrivate * priv;
};

struct _GamesSteamRegistryClass {
	GTypeClass parent_class;
	void (*finalize) (GamesSteamRegistry *self);
};

struct _GamesSteamRegistryPrivate {
	GamesSteamRegistryValue* tree;
};

typedef enum  {
	GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_TOKEN,
	GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_END
} GamesSteamRegistryError;
#define GAMES_STEAM_REGISTRY_ERROR games_steam_registry_error_quark ()
struct _GamesParamSpecSteamRegistry {
	GParamSpec parent_instance;
};

struct _GamesSteamRegistryValue {
	GObject parent_instance;
	GamesSteamRegistryValuePrivate * priv;
};

struct _GamesSteamRegistryValueClass {
	GObjectClass parent_class;
};

struct _GamesSteamRegistryValuePrivate {
	gchar* _tag;
};

struct _GamesSteamRegistryNode {
	GamesSteamRegistryValue parent_instance;
	GamesSteamRegistryNodePrivate * priv;
};

struct _GamesSteamRegistryNodeClass {
	GamesSteamRegistryValueClass parent_class;
};

struct _GamesSteamRegistryNodePrivate {
	GList* children;
};

struct _GamesSteamRegistryData {
	GamesSteamRegistryValue parent_instance;
	GamesSteamRegistryDataPrivate * priv;
};

struct _GamesSteamRegistryDataClass {
	GamesSteamRegistryValueClass parent_class;
};

struct _GamesSteamRegistryDataPrivate {
	gchar* _data;
};


static gpointer games_steam_registry_parent_class = NULL;
static GType games_steam_registry_type_id = 0;
static gpointer games_steam_registry_value_parent_class = NULL;
static GType games_steam_registry_value_type_id = 0;
static gpointer games_steam_registry_node_parent_class = NULL;
static GType games_steam_registry_node_type_id = 0;
static gpointer games_steam_registry_data_parent_class = NULL;
static GType games_steam_registry_data_type_id = 0;

gpointer games_steam_registry_ref (gpointer instance);
void games_steam_registry_unref (gpointer instance);
GParamSpec* games_param_spec_steam_registry (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void games_value_set_steam_registry (GValue* value, gpointer v_object);
void games_value_take_steam_registry (GValue* value, gpointer v_object);
gpointer games_value_get_steam_registry (const GValue* value);
GType games_steam_registry_get_type (void) G_GNUC_CONST;
GType games_steam_registry_value_get_type (void) G_GNUC_CONST;
#define GAMES_STEAM_REGISTRY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_STEAM_REGISTRY, GamesSteamRegistryPrivate))
enum  {
	GAMES_STEAM_REGISTRY_0_PROPERTY
};
GamesSteamRegistry* games_steam_registry_new (const gchar* appmanifest_path, GError** error);
GamesSteamRegistry* games_steam_registry_construct (GType object_type, const gchar* appmanifest_path, GError** error);
static gchar** games_steam_registry_tokenize (GamesSteamRegistry* self, const gchar* appmanifest_path, int* result_length1, GError** error);
GType games_steam_registry_node_get_type (void) G_GNUC_CONST;
GQuark games_steam_registry_error_quark (void);
static GamesSteamRegistryValue* games_steam_registry_parse_tokens (GamesSteamRegistry* self, GamesSteamRegistryNode* parent, gchar** tokens, int tokens_length1, gsize* index, GError** error);
gchar** games_steam_registry_get_children (GamesSteamRegistry* self, gchar** path, int path_length1, int* result_length1);
const gchar* games_steam_registry_value_get_tag (GamesSteamRegistryValue* self);
GamesSteamRegistryValue* games_steam_registry_node_get_child (GamesSteamRegistryNode* self, const gchar* tag);
gchar** games_steam_registry_node_get_children (GamesSteamRegistryNode* self, int* result_length1);
gchar* games_steam_registry_get_data (GamesSteamRegistry* self, gchar** path, int path_length1);
GType games_steam_registry_data_get_type (void) G_GNUC_CONST;
const gchar* games_steam_registry_data_get_data (GamesSteamRegistryData* self);
static void _vala_array_add1 (gchar** * array, int* length, int* size, gchar* value);
GamesSteamRegistryNode* games_steam_registry_node_new (const gchar* tag);
GamesSteamRegistryNode* games_steam_registry_node_construct (GType object_type, const gchar* tag);
void games_steam_registry_node_add_child (GamesSteamRegistryNode* self, GamesSteamRegistryValue* child);
GamesSteamRegistryData* games_steam_registry_data_new (const gchar* tag, const gchar* data);
GamesSteamRegistryData* games_steam_registry_data_construct (GType object_type, const gchar* tag, const gchar* data);
static void games_steam_registry_finalize (GamesSteamRegistry * obj);
#define GAMES_STEAM_REGISTRY_VALUE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValuePrivate))
enum  {
	GAMES_STEAM_REGISTRY_VALUE_0_PROPERTY,
	GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY
};
GamesSteamRegistryValue* games_steam_registry_value_construct (GType object_type);
static void games_steam_registry_value_set_tag (GamesSteamRegistryValue* self, const gchar* value);
static void games_steam_registry_value_finalize (GObject * obj);
static void _vala_games_steam_registry_value_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_games_steam_registry_value_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
#define GAMES_STEAM_REGISTRY_NODE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_STEAM_REGISTRY_NODE, GamesSteamRegistryNodePrivate))
enum  {
	GAMES_STEAM_REGISTRY_NODE_0_PROPERTY
};
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
static void _vala_array_add2 (gchar** * array, int* length, int* size, gchar* value);
static void games_steam_registry_node_finalize (GObject * obj);
#define GAMES_STEAM_REGISTRY_DATA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryDataPrivate))
enum  {
	GAMES_STEAM_REGISTRY_DATA_0_PROPERTY,
	GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY
};
static void games_steam_registry_data_set_data (GamesSteamRegistryData* self, const gchar* value);
static void games_steam_registry_data_finalize (GObject * obj);
static void _vala_games_steam_registry_data_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_games_steam_registry_data_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
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 GRegex* _tmp_regex_0 = NULL;

GamesSteamRegistry* games_steam_registry_construct (GType object_type, const gchar* appmanifest_path, GError** error) {
	GamesSteamRegistry* self = NULL;
	gchar** tokens = NULL;
	const gchar* _tmp0_;
	gint _tmp1_;
	gchar** _tmp2_;
	gint tokens_length1;
	gint _tokens_size_;
	gsize index = 0UL;
	GamesSteamRegistryValue* _tmp3_ = NULL;
	gchar** _tmp4_;
	gint _tmp4__length1;
	GamesSteamRegistryValue* _tmp5_;
	GamesSteamRegistryValue* _tmp6_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (appmanifest_path != NULL, NULL);
	self = (GamesSteamRegistry*) g_type_create_instance (object_type);
	_tmp0_ = appmanifest_path;
	_tmp2_ = games_steam_registry_tokenize (self, _tmp0_, &_tmp1_, &_inner_error_);
	tokens = _tmp2_;
	tokens_length1 = _tmp1_;
	_tokens_size_ = tokens_length1;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		_games_steam_registry_unref0 (self);
		return NULL;
	}
	index = (gsize) 0;
	_tmp4_ = tokens;
	_tmp4__length1 = tokens_length1;
	_tmp5_ = games_steam_registry_parse_tokens (self, NULL, _tmp4_, _tmp4__length1, &index, &_inner_error_);
	_tmp3_ = _tmp5_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
		_games_steam_registry_unref0 (self);
		return NULL;
	}
	_tmp6_ = _tmp3_;
	_tmp3_ = NULL;
	_g_object_unref0 (self->priv->tree);
	self->priv->tree = _tmp6_;
	_g_object_unref0 (_tmp3_);
	tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
	return self;
}


GamesSteamRegistry* games_steam_registry_new (const gchar* appmanifest_path, GError** error) {
	return games_steam_registry_construct (GAMES_TYPE_STEAM_REGISTRY, appmanifest_path, error);
}


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


gchar** games_steam_registry_get_children (GamesSteamRegistry* self, gchar** path, int path_length1, int* result_length1) {
	gchar** result = NULL;
	GamesSteamRegistryValue* current_value = NULL;
	GamesSteamRegistryValue* _tmp0_;
	GamesSteamRegistryValue* _tmp1_;
	gchar** _tmp33_;
	gchar** _tmp34_;
	gint _tmp34__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->tree;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	current_value = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_;
				gchar** _tmp5_;
				gint _tmp5__length1;
				GamesSteamRegistryValue* _tmp6_;
				GamesSteamRegistryValue* _tmp9_;
				const gchar* _tmp10_;
				const gchar* _tmp11_;
				gchar** _tmp12_;
				gint _tmp12__length1;
				gint _tmp13_;
				const gchar* _tmp14_;
				GamesSteamRegistryNode* node = NULL;
				GamesSteamRegistryValue* _tmp17_;
				GamesSteamRegistryNode* _tmp18_;
				GamesSteamRegistryNode* _tmp19_;
				gint _tmp22_;
				gchar** _tmp23_;
				gint _tmp23__length1;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				_tmp5_ = path;
				_tmp5__length1 = path_length1;
				if (!(_tmp4_ < _tmp5__length1)) {
					break;
				}
				_tmp6_ = current_value;
				if (_tmp6_ == NULL) {
					gchar** _tmp7_;
					gchar** _tmp8_;
					gint _tmp8__length1;
					_tmp7_ = g_new0 (gchar*, 0 + 1);
					_tmp8_ = _tmp7_;
					_tmp8__length1 = 0;
					if (result_length1) {
						*result_length1 = _tmp8__length1;
					}
					result = _tmp8_;
					_g_object_unref0 (current_value);
					return result;
				}
				_tmp9_ = current_value;
				_tmp10_ = games_steam_registry_value_get_tag (_tmp9_);
				_tmp11_ = _tmp10_;
				_tmp12_ = path;
				_tmp12__length1 = path_length1;
				_tmp13_ = i;
				_tmp14_ = _tmp12_[_tmp13_];
				if (g_strcmp0 (_tmp11_, _tmp14_) != 0) {
					gchar** _tmp15_;
					gchar** _tmp16_;
					gint _tmp16__length1;
					_tmp15_ = g_new0 (gchar*, 0 + 1);
					_tmp16_ = _tmp15_;
					_tmp16__length1 = 0;
					if (result_length1) {
						*result_length1 = _tmp16__length1;
					}
					result = _tmp16_;
					_g_object_unref0 (current_value);
					return result;
				}
				_tmp17_ = current_value;
				_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, GAMES_TYPE_STEAM_REGISTRY_NODE) ? ((GamesSteamRegistryNode*) _tmp17_) : NULL);
				node = _tmp18_;
				_tmp19_ = node;
				if (_tmp19_ == NULL) {
					gchar** _tmp20_;
					gchar** _tmp21_;
					gint _tmp21__length1;
					_tmp20_ = g_new0 (gchar*, 0 + 1);
					_tmp21_ = _tmp20_;
					_tmp21__length1 = 0;
					if (result_length1) {
						*result_length1 = _tmp21__length1;
					}
					result = _tmp21_;
					_g_object_unref0 (node);
					_g_object_unref0 (current_value);
					return result;
				}
				_tmp22_ = i;
				_tmp23_ = path;
				_tmp23__length1 = path_length1;
				if (_tmp22_ < (_tmp23__length1 - 1)) {
					GamesSteamRegistryNode* _tmp24_;
					gchar** _tmp25_;
					gint _tmp25__length1;
					gint _tmp26_;
					const gchar* _tmp27_;
					GamesSteamRegistryValue* _tmp28_;
					_tmp24_ = node;
					_tmp25_ = path;
					_tmp25__length1 = path_length1;
					_tmp26_ = i;
					_tmp27_ = _tmp25_[_tmp26_ + 1];
					_tmp28_ = games_steam_registry_node_get_child (_tmp24_, _tmp27_);
					_g_object_unref0 (current_value);
					current_value = _tmp28_;
				} else {
					GamesSteamRegistryNode* _tmp29_;
					gint _tmp30_;
					gchar** _tmp31_;
					gchar** _tmp32_;
					gint _tmp32__length1;
					_tmp29_ = node;
					_tmp31_ = games_steam_registry_node_get_children (_tmp29_, &_tmp30_);
					_tmp32_ = _tmp31_;
					_tmp32__length1 = _tmp30_;
					if (result_length1) {
						*result_length1 = _tmp32__length1;
					}
					result = _tmp32_;
					_g_object_unref0 (node);
					_g_object_unref0 (current_value);
					return result;
				}
				_g_object_unref0 (node);
			}
		}
	}
	_tmp33_ = g_new0 (gchar*, 0 + 1);
	_tmp34_ = _tmp33_;
	_tmp34__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp34__length1;
	}
	result = _tmp34_;
	_g_object_unref0 (current_value);
	return result;
}


gchar* games_steam_registry_get_data (GamesSteamRegistry* self, gchar** path, int path_length1) {
	gchar* result = NULL;
	GamesSteamRegistryValue* current_value = NULL;
	GamesSteamRegistryValue* _tmp0_;
	GamesSteamRegistryValue* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->tree;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	current_value = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_;
				gchar** _tmp5_;
				gint _tmp5__length1;
				GamesSteamRegistryValue* _tmp6_;
				GamesSteamRegistryValue* _tmp7_;
				const gchar* _tmp8_;
				const gchar* _tmp9_;
				gchar** _tmp10_;
				gint _tmp10__length1;
				gint _tmp11_;
				const gchar* _tmp12_;
				gint _tmp13_;
				gchar** _tmp14_;
				gint _tmp14__length1;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				_tmp5_ = path;
				_tmp5__length1 = path_length1;
				if (!(_tmp4_ < _tmp5__length1)) {
					break;
				}
				_tmp6_ = current_value;
				if (_tmp6_ == NULL) {
					result = NULL;
					_g_object_unref0 (current_value);
					return result;
				}
				_tmp7_ = current_value;
				_tmp8_ = games_steam_registry_value_get_tag (_tmp7_);
				_tmp9_ = _tmp8_;
				_tmp10_ = path;
				_tmp10__length1 = path_length1;
				_tmp11_ = i;
				_tmp12_ = _tmp10_[_tmp11_];
				if (g_strcmp0 (_tmp9_, _tmp12_) != 0) {
					result = NULL;
					_g_object_unref0 (current_value);
					return result;
				}
				_tmp13_ = i;
				_tmp14_ = path;
				_tmp14__length1 = path_length1;
				if (_tmp13_ < (_tmp14__length1 - 1)) {
					GamesSteamRegistryNode* node = NULL;
					GamesSteamRegistryValue* _tmp15_;
					GamesSteamRegistryNode* _tmp16_;
					GamesSteamRegistryNode* _tmp17_;
					GamesSteamRegistryNode* _tmp18_;
					gchar** _tmp19_;
					gint _tmp19__length1;
					gint _tmp20_;
					const gchar* _tmp21_;
					GamesSteamRegistryValue* _tmp22_;
					_tmp15_ = current_value;
					_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, GAMES_TYPE_STEAM_REGISTRY_NODE) ? ((GamesSteamRegistryNode*) _tmp15_) : NULL);
					node = _tmp16_;
					_tmp17_ = node;
					if (_tmp17_ == NULL) {
						result = NULL;
						_g_object_unref0 (node);
						_g_object_unref0 (current_value);
						return result;
					}
					_tmp18_ = node;
					_tmp19_ = path;
					_tmp19__length1 = path_length1;
					_tmp20_ = i;
					_tmp21_ = _tmp19_[_tmp20_ + 1];
					_tmp22_ = games_steam_registry_node_get_child (_tmp18_, _tmp21_);
					_g_object_unref0 (current_value);
					current_value = _tmp22_;
					_g_object_unref0 (node);
				} else {
					GamesSteamRegistryData* data = NULL;
					GamesSteamRegistryValue* _tmp23_;
					GamesSteamRegistryData* _tmp24_;
					GamesSteamRegistryData* _tmp25_;
					GamesSteamRegistryData* _tmp26_;
					const gchar* _tmp27_;
					const gchar* _tmp28_;
					gchar* _tmp29_;
					_tmp23_ = current_value;
					_tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, GAMES_TYPE_STEAM_REGISTRY_DATA) ? ((GamesSteamRegistryData*) _tmp23_) : NULL);
					data = _tmp24_;
					_tmp25_ = data;
					if (_tmp25_ == NULL) {
						result = NULL;
						_g_object_unref0 (data);
						_g_object_unref0 (current_value);
						return result;
					}
					_tmp26_ = data;
					_tmp27_ = games_steam_registry_data_get_data (_tmp26_);
					_tmp28_ = _tmp27_;
					_tmp29_ = g_strdup (_tmp28_);
					result = _tmp29_;
					_g_object_unref0 (data);
					_g_object_unref0 (current_value);
					return result;
				}
			}
		}
	}
	result = NULL;
	_g_object_unref0 (current_value);
	return result;
}


static inline GRegex* _thread_safe_regex_init (GRegex** re, const gchar * pattern, GRegexMatchFlags match_options) {
	if (g_once_init_enter ((volatile gsize*) re)) {
		GRegex* val = g_regex_new (pattern, match_options, 0, NULL);
		g_once_init_leave ((volatile gsize*) re, (gsize) val);
	}
	return *re;
}


static gpointer _g_regex_ref0 (gpointer self) {
	return self ? g_regex_ref (self) : NULL;
}


static void _vala_array_add1 (gchar** * array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


static gchar** games_steam_registry_tokenize (GamesSteamRegistry* self, const gchar* appmanifest_path, int* result_length1, GError** error) {
	gchar** result = NULL;
	GFile* file = NULL;
	const gchar* _tmp0_;
	GFile* _tmp1_;
	gboolean _tmp2_;
	GFileInputStream* _tmp7_ = NULL;
	GFileInputStream* _tmp8_;
	GDataInputStream* dis = NULL;
	GDataInputStream* _tmp9_;
	gchar** tokens = NULL;
	gchar** _tmp10_;
	gint tokens_length1;
	gint _tokens_size_;
	GRegex* regex = NULL;
	GRegex* _tmp11_;
	gchar* line = NULL;
	GMatchInfo* match_info = NULL;
	gchar** _tmp29_;
	gint _tmp29__length1;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (appmanifest_path != NULL, NULL);
	_tmp0_ = appmanifest_path;
	_tmp1_ = g_file_new_for_path (_tmp0_);
	file = _tmp1_;
	_tmp2_ = g_file_query_exists (file, NULL);
	if (!_tmp2_) {
		gchar* _tmp3_;
		gchar* _tmp4_;
		GError* _tmp5_;
		GError* _tmp6_;
		_tmp3_ = g_file_get_path (file);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_error_new (G_IO_ERROR, G_IO_ERROR_NOT_FOUND, _ ("File “%s” doesn’t exist."), _tmp4_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		_inner_error_ = _tmp6_;
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (file);
		return NULL;
	}
	_tmp8_ = g_file_read (file, NULL, &_inner_error_);
	_tmp7_ = _tmp8_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		_g_object_unref0 (file);
		return NULL;
	}
	_tmp9_ = g_data_input_stream_new ((GInputStream*) _tmp7_);
	dis = _tmp9_;
	_tmp10_ = g_new0 (gchar*, 0 + 1);
	tokens = _tmp10_;
	tokens_length1 = 0;
	_tokens_size_ = tokens_length1;
	_tmp11_ = _g_regex_ref0 (_thread_safe_regex_init (&_tmp_regex_0, "({|}|(?:\".*?\"))", 0));
	regex = _tmp11_;
	while (TRUE) {
		gchar* _tmp12_ = NULL;
		GDataInputStream* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		const gchar* _tmp16_;
		gint start_position = 0;
		_tmp13_ = dis;
		_tmp14_ = g_data_input_stream_read_line (_tmp13_, NULL, NULL, &_inner_error_);
		_tmp12_ = _tmp14_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			g_propagate_error (error, _inner_error_);
			_g_match_info_unref0 (match_info);
			_g_free0 (line);
			_g_regex_unref0 (regex);
			tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (dis);
			_g_object_unref0 (_tmp7_);
			_g_object_unref0 (file);
			return NULL;
		}
		_tmp15_ = _tmp12_;
		_tmp12_ = NULL;
		_g_free0 (line);
		line = _tmp15_;
		_tmp16_ = line;
		if (!(_tmp16_ != NULL)) {
			_g_free0 (_tmp12_);
			break;
		}
		start_position = 0;
		while (TRUE) {
			gboolean _tmp17_ = FALSE;
			GRegex* _tmp18_;
			const gchar* _tmp19_;
			gint _tmp20_;
			GMatchInfo* _tmp21_ = NULL;
			gboolean _tmp22_;
			gchar** _tmp23_;
			gint _tmp23__length1;
			GMatchInfo* _tmp24_;
			gchar* _tmp25_;
			gint dummy = 0;
			GMatchInfo* _tmp26_;
			gint _tmp27_ = 0;
			gint _tmp28_ = 0;
			_tmp18_ = regex;
			_tmp19_ = line;
			_tmp20_ = start_position;
			_tmp22_ = g_regex_match_full (_tmp18_, _tmp19_, (gssize) -1, _tmp20_, 0, &_tmp21_, &_inner_error_);
			_g_match_info_unref0 (match_info);
			match_info = _tmp21_;
			_tmp17_ = _tmp22_;
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				g_propagate_error (error, _inner_error_);
				_g_free0 (_tmp12_);
				_g_match_info_unref0 (match_info);
				_g_free0 (line);
				_g_regex_unref0 (regex);
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
				_g_object_unref0 (dis);
				_g_object_unref0 (_tmp7_);
				_g_object_unref0 (file);
				return NULL;
			}
			if (!_tmp17_) {
				break;
			}
			_tmp23_ = tokens;
			_tmp23__length1 = tokens_length1;
			_tmp24_ = match_info;
			_tmp25_ = g_match_info_fetch (_tmp24_, 1);
			_vala_array_add1 (&tokens, &tokens_length1, &_tokens_size_, _tmp25_);
			dummy = 0;
			_tmp26_ = match_info;
			g_match_info_fetch_pos (_tmp26_, 1, &_tmp27_, &_tmp28_);
			dummy = _tmp27_;
			start_position = _tmp28_;
		}
		_g_free0 (_tmp12_);
	}
	_tmp29_ = tokens;
	_tmp29__length1 = tokens_length1;
	if (result_length1) {
		*result_length1 = _tmp29__length1;
	}
	result = _tmp29_;
	_g_match_info_unref0 (match_info);
	_g_free0 (line);
	_g_regex_unref0 (regex);
	_g_object_unref0 (dis);
	_g_object_unref0 (_tmp7_);
	_g_object_unref0 (file);
	return result;
}


static gchar* string_slice (const gchar* self, glong start, glong end) {
	gchar* result = NULL;
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	glong _tmp2_;
	glong _tmp5_;
	gboolean _tmp8_ = FALSE;
	glong _tmp9_;
	gboolean _tmp12_ = FALSE;
	glong _tmp13_;
	glong _tmp16_;
	glong _tmp17_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	gchar* _tmp21_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	_tmp2_ = start;
	if (_tmp2_ < ((glong) 0)) {
		glong _tmp3_;
		glong _tmp4_;
		_tmp3_ = string_length;
		_tmp4_ = start;
		start = _tmp3_ + _tmp4_;
	}
	_tmp5_ = end;
	if (_tmp5_ < ((glong) 0)) {
		glong _tmp6_;
		glong _tmp7_;
		_tmp6_ = string_length;
		_tmp7_ = end;
		end = _tmp6_ + _tmp7_;
	}
	_tmp9_ = start;
	if (_tmp9_ >= ((glong) 0)) {
		glong _tmp10_;
		glong _tmp11_;
		_tmp10_ = start;
		_tmp11_ = string_length;
		_tmp8_ = _tmp10_ <= _tmp11_;
	} else {
		_tmp8_ = FALSE;
	}
	g_return_val_if_fail (_tmp8_, NULL);
	_tmp13_ = end;
	if (_tmp13_ >= ((glong) 0)) {
		glong _tmp14_;
		glong _tmp15_;
		_tmp14_ = end;
		_tmp15_ = string_length;
		_tmp12_ = _tmp14_ <= _tmp15_;
	} else {
		_tmp12_ = FALSE;
	}
	g_return_val_if_fail (_tmp12_, NULL);
	_tmp16_ = start;
	_tmp17_ = end;
	g_return_val_if_fail (_tmp16_ <= _tmp17_, NULL);
	_tmp18_ = start;
	_tmp19_ = end;
	_tmp20_ = start;
	_tmp21_ = g_strndup (((gchar*) self) + _tmp18_, (gsize) (_tmp19_ - _tmp20_));
	result = _tmp21_;
	return result;
}


static GamesSteamRegistryValue* games_steam_registry_parse_tokens (GamesSteamRegistry* self, GamesSteamRegistryNode* parent, gchar** tokens, int tokens_length1, gsize* index, GError** error) {
	GamesSteamRegistryValue* result = NULL;
	GamesSteamRegistryValue* to_return = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	to_return = NULL;
	while (TRUE) {
		gsize _tmp0_;
		gchar** _tmp1_;
		gint _tmp1__length1;
		gchar** _tmp2_;
		gint _tmp2__length1;
		gsize _tmp3_;
		const gchar* _tmp4_;
		gchar** _tmp6_;
		gint _tmp6__length1;
		gsize _tmp7_;
		const gchar* _tmp8_;
		gchar* tag = NULL;
		gchar** _tmp10_;
		gint _tmp10__length1;
		gsize _tmp11_;
		const gchar* _tmp12_;
		gchar* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		gsize _tmp16_;
		gsize _tmp17_;
		gchar** _tmp18_;
		gint _tmp18__length1;
		gchar** _tmp20_;
		gint _tmp20__length1;
		gsize _tmp21_;
		const gchar* _tmp22_;
		gchar** _tmp24_;
		gint _tmp24__length1;
		gsize _tmp25_;
		const gchar* _tmp26_;
		_tmp0_ = *index;
		_tmp1_ = tokens;
		_tmp1__length1 = tokens_length1;
		if (!(_tmp0_ < ((gsize) _tmp1__length1))) {
			break;
		}
		_tmp2_ = tokens;
		_tmp2__length1 = tokens_length1;
		_tmp3_ = *index;
		_tmp4_ = _tmp2_[_tmp3_];
		if (g_strcmp0 (_tmp4_, "{") == 0) {
			GError* _tmp5_;
			_tmp5_ = g_error_new_literal (GAMES_STEAM_REGISTRY_ERROR, GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_TOKEN, _ ("Unexpected token '{'."));
			_inner_error_ = _tmp5_;
			if (_inner_error_->domain == GAMES_STEAM_REGISTRY_ERROR) {
				g_propagate_error (error, _inner_error_);
				_g_object_unref0 (to_return);
				return NULL;
			} else {
				_g_object_unref0 (to_return);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
				return NULL;
			}
		}
		_tmp6_ = tokens;
		_tmp6__length1 = tokens_length1;
		_tmp7_ = *index;
		_tmp8_ = _tmp6_[_tmp7_];
		if (g_strcmp0 (_tmp8_, "}") == 0) {
			gsize _tmp9_;
			_tmp9_ = *index;
			*index = _tmp9_ + 1;
			continue;
		}
		_tmp10_ = tokens;
		_tmp10__length1 = tokens_length1;
		_tmp11_ = *index;
		_tmp12_ = _tmp10_[_tmp11_];
		_tmp13_ = g_strdup (_tmp12_);
		tag = _tmp13_;
		_tmp14_ = tag;
		_tmp15_ = string_slice (_tmp14_, (glong) 1, (glong) -1);
		_g_free0 (tag);
		tag = _tmp15_;
		_tmp16_ = *index;
		*index = _tmp16_ + 1;
		_tmp17_ = *index;
		_tmp18_ = tokens;
		_tmp18__length1 = tokens_length1;
		if (_tmp17_ >= ((gsize) _tmp18__length1)) {
			GError* _tmp19_;
			_tmp19_ = g_error_new_literal (GAMES_STEAM_REGISTRY_ERROR, GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_END, _ ("Unexpected end of tokens."));
			_inner_error_ = _tmp19_;
			if (_inner_error_->domain == GAMES_STEAM_REGISTRY_ERROR) {
				g_propagate_error (error, _inner_error_);
				_g_free0 (tag);
				_g_object_unref0 (to_return);
				return NULL;
			} else {
				_g_free0 (tag);
				_g_object_unref0 (to_return);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
				return NULL;
			}
		}
		_tmp20_ = tokens;
		_tmp20__length1 = tokens_length1;
		_tmp21_ = *index;
		_tmp22_ = _tmp20_[_tmp21_];
		if (g_strcmp0 (_tmp22_, "}") == 0) {
			GError* _tmp23_;
			_tmp23_ = g_error_new_literal (GAMES_STEAM_REGISTRY_ERROR, GAMES_STEAM_REGISTRY_ERROR_UNEXPECTED_TOKEN, _ ("Unexpected token '}'."));
			_inner_error_ = _tmp23_;
			if (_inner_error_->domain == GAMES_STEAM_REGISTRY_ERROR) {
				g_propagate_error (error, _inner_error_);
				_g_free0 (tag);
				_g_object_unref0 (to_return);
				return NULL;
			} else {
				_g_free0 (tag);
				_g_object_unref0 (to_return);
				g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
				return NULL;
			}
		}
		_tmp24_ = tokens;
		_tmp24__length1 = tokens_length1;
		_tmp25_ = *index;
		_tmp26_ = _tmp24_[_tmp25_];
		if (g_strcmp0 (_tmp26_, "{") == 0) {
			gsize _tmp27_;
			GamesSteamRegistryNode* node = NULL;
			const gchar* _tmp28_;
			GamesSteamRegistryNode* _tmp29_;
			GamesSteamRegistryNode* _tmp30_;
			gchar** _tmp31_;
			gint _tmp31__length1;
			GamesSteamRegistryValue* _tmp32_;
			GamesSteamRegistryValue* _tmp33_;
			GamesSteamRegistryNode* _tmp34_;
			GamesSteamRegistryNode* _tmp37_;
			GamesSteamRegistryValue* _tmp38_;
			_tmp27_ = *index;
			*index = _tmp27_ + 1;
			_tmp28_ = tag;
			_tmp29_ = games_steam_registry_node_new (_tmp28_);
			node = _tmp29_;
			_tmp30_ = node;
			_tmp31_ = tokens;
			_tmp31__length1 = tokens_length1;
			_tmp32_ = games_steam_registry_parse_tokens (self, _tmp30_, _tmp31_, _tmp31__length1, index, &_inner_error_);
			_tmp33_ = _tmp32_;
			_g_object_unref0 (_tmp33_);
			if (G_UNLIKELY (_inner_error_ != NULL)) {
				if (_inner_error_->domain == GAMES_STEAM_REGISTRY_ERROR) {
					g_propagate_error (error, _inner_error_);
					_g_object_unref0 (node);
					_g_free0 (tag);
					_g_object_unref0 (to_return);
					return NULL;
				} else {
					_g_object_unref0 (node);
					_g_free0 (tag);
					_g_object_unref0 (to_return);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
					g_clear_error (&_inner_error_);
					return NULL;
				}
			}
			_tmp34_ = parent;
			if (_tmp34_ != NULL) {
				GamesSteamRegistryNode* _tmp35_;
				GamesSteamRegistryNode* _tmp36_;
				_tmp35_ = parent;
				_tmp36_ = node;
				games_steam_registry_node_add_child (_tmp35_, (GamesSteamRegistryValue*) _tmp36_);
			}
			_tmp37_ = node;
			_tmp38_ = _g_object_ref0 ((GamesSteamRegistryValue*) _tmp37_);
			_g_object_unref0 (to_return);
			to_return = _tmp38_;
			_g_object_unref0 (node);
		} else {
			gchar* data = NULL;
			gchar** _tmp39_;
			gint _tmp39__length1;
			gsize _tmp40_;
			const gchar* _tmp41_;
			gchar* _tmp42_;
			const gchar* _tmp43_;
			gchar* _tmp44_;
			gsize _tmp45_;
			GamesSteamRegistryData* node = NULL;
			const gchar* _tmp46_;
			const gchar* _tmp47_;
			GamesSteamRegistryData* _tmp48_;
			GamesSteamRegistryNode* _tmp49_;
			GamesSteamRegistryData* _tmp52_;
			GamesSteamRegistryValue* _tmp53_;
			_tmp39_ = tokens;
			_tmp39__length1 = tokens_length1;
			_tmp40_ = *index;
			_tmp41_ = _tmp39_[_tmp40_];
			_tmp42_ = g_strdup (_tmp41_);
			data = _tmp42_;
			_tmp43_ = data;
			_tmp44_ = string_slice (_tmp43_, (glong) 1, (glong) -1);
			_g_free0 (data);
			data = _tmp44_;
			_tmp45_ = *index;
			*index = _tmp45_ + 1;
			_tmp46_ = tag;
			_tmp47_ = data;
			_tmp48_ = games_steam_registry_data_new (_tmp46_, _tmp47_);
			node = _tmp48_;
			_tmp49_ = parent;
			if (_tmp49_ != NULL) {
				GamesSteamRegistryNode* _tmp50_;
				GamesSteamRegistryData* _tmp51_;
				_tmp50_ = parent;
				_tmp51_ = node;
				games_steam_registry_node_add_child (_tmp50_, (GamesSteamRegistryValue*) _tmp51_);
			}
			_tmp52_ = node;
			_tmp53_ = _g_object_ref0 ((GamesSteamRegistryValue*) _tmp52_);
			_g_object_unref0 (to_return);
			to_return = _tmp53_;
			_g_object_unref0 (node);
			_g_free0 (data);
		}
		_g_free0 (tag);
	}
	result = to_return;
	return result;
}


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


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


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


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


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


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


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


void games_value_set_steam_registry (GValue* value, gpointer v_object) {
	GamesSteamRegistry * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GAMES_TYPE_STEAM_REGISTRY));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GAMES_TYPE_STEAM_REGISTRY));
		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;
		games_steam_registry_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		games_steam_registry_unref (old);
	}
}


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


static void games_steam_registry_class_init (GamesSteamRegistryClass * klass) {
	games_steam_registry_parent_class = g_type_class_peek_parent (klass);
	((GamesSteamRegistryClass *) klass)->finalize = games_steam_registry_finalize;
	g_type_class_add_private (klass, sizeof (GamesSteamRegistryPrivate));
}


static void games_steam_registry_instance_init (GamesSteamRegistry * self) {
	self->priv = GAMES_STEAM_REGISTRY_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void games_steam_registry_finalize (GamesSteamRegistry * obj) {
	GamesSteamRegistry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_STEAM_REGISTRY, GamesSteamRegistry);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->tree);
}


GType games_steam_registry_get_type (void) {
	return games_steam_registry_type_id;
}


GType games_steam_registry_register_type (GTypeModule * module) {
	static const GTypeValueTable g_define_type_value_table = { games_value_steam_registry_init, games_value_steam_registry_free_value, games_value_steam_registry_copy_value, games_value_steam_registry_peek_pointer, "p", games_value_steam_registry_collect_value, "p", games_value_steam_registry_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (GamesSteamRegistryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_steam_registry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesSteamRegistry), 0, (GInstanceInitFunc) games_steam_registry_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) };
	games_steam_registry_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GamesSteamRegistry", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return games_steam_registry_type_id;
}


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


void games_steam_registry_unref (gpointer instance) {
	GamesSteamRegistry * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GAMES_STEAM_REGISTRY_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


GamesSteamRegistryValue* games_steam_registry_value_construct (GType object_type) {
	GamesSteamRegistryValue * self = NULL;
	self = (GamesSteamRegistryValue*) g_object_new (object_type, NULL);
	return self;
}


const gchar* games_steam_registry_value_get_tag (GamesSteamRegistryValue* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tag;
	result = _tmp0_;
	return result;
}


static void games_steam_registry_value_set_tag (GamesSteamRegistryValue* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, games_steam_registry_value_get_tag (self)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_tag);
		self->priv->_tag = _tmp1_;
		g_object_notify ((GObject *) self, "tag");
	}
}


static void games_steam_registry_value_class_init (GamesSteamRegistryValueClass * klass) {
	games_steam_registry_value_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesSteamRegistryValuePrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_games_steam_registry_value_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_steam_registry_value_set_property;
	G_OBJECT_CLASS (klass)->finalize = games_steam_registry_value_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY, g_param_spec_string ("tag", "tag", "tag", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void games_steam_registry_value_instance_init (GamesSteamRegistryValue * self) {
	self->priv = GAMES_STEAM_REGISTRY_VALUE_GET_PRIVATE (self);
}


static void games_steam_registry_value_finalize (GObject * obj) {
	GamesSteamRegistryValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValue);
	_g_free0 (self->priv->_tag);
	G_OBJECT_CLASS (games_steam_registry_value_parent_class)->finalize (obj);
}


GType games_steam_registry_value_get_type (void) {
	return games_steam_registry_value_type_id;
}


GType games_steam_registry_value_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (GamesSteamRegistryValueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_steam_registry_value_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesSteamRegistryValue), 0, (GInstanceInitFunc) games_steam_registry_value_instance_init, NULL };
	games_steam_registry_value_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "GamesSteamRegistryValue", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return games_steam_registry_value_type_id;
}


static void _vala_games_steam_registry_value_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GamesSteamRegistryValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValue);
	switch (property_id) {
		case GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY:
		g_value_set_string (value, games_steam_registry_value_get_tag (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_games_steam_registry_value_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GamesSteamRegistryValue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_STEAM_REGISTRY_VALUE, GamesSteamRegistryValue);
	switch (property_id) {
		case GAMES_STEAM_REGISTRY_VALUE_TAG_PROPERTY:
		games_steam_registry_value_set_tag (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


static void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_list_free (self);
}


GamesSteamRegistryNode* games_steam_registry_node_construct (GType object_type, const gchar* tag) {
	GamesSteamRegistryNode * self = NULL;
	const gchar* _tmp0_;
	g_return_val_if_fail (tag != NULL, NULL);
	_tmp0_ = tag;
	self = (GamesSteamRegistryNode*) g_object_new (object_type, "tag", _tmp0_, NULL);
	return self;
}


GamesSteamRegistryNode* games_steam_registry_node_new (const gchar* tag) {
	return games_steam_registry_node_construct (GAMES_TYPE_STEAM_REGISTRY_NODE, tag);
}


void games_steam_registry_node_add_child (GamesSteamRegistryNode* self, GamesSteamRegistryValue* child) {
	GamesSteamRegistryValue* _tmp0_;
	GamesSteamRegistryValue* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (child != NULL);
	_tmp0_ = child;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	self->priv->children = g_list_append (self->priv->children, _tmp1_);
}


GamesSteamRegistryValue* games_steam_registry_node_get_child (GamesSteamRegistryNode* self, const gchar* tag) {
	GamesSteamRegistryValue* result = NULL;
	GList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (tag != NULL, NULL);
	_tmp0_ = self->priv->children;
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp0_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GamesSteamRegistryValue* _tmp1_;
			GamesSteamRegistryValue* child = NULL;
			_tmp1_ = _g_object_ref0 ((GamesSteamRegistryValue*) child_it->data);
			child = _tmp1_;
			{
				GamesSteamRegistryValue* _tmp2_;
				const gchar* _tmp3_;
				const gchar* _tmp4_;
				const gchar* _tmp5_;
				_tmp2_ = child;
				_tmp3_ = games_steam_registry_value_get_tag (_tmp2_);
				_tmp4_ = _tmp3_;
				_tmp5_ = tag;
				if (g_strcmp0 (_tmp4_, _tmp5_) == 0) {
					result = child;
					return result;
				}
				_g_object_unref0 (child);
			}
		}
	}
	result = NULL;
	return result;
}


static void _vala_array_add2 (gchar** * array, int* length, int* size, gchar* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}


gchar** games_steam_registry_node_get_children (GamesSteamRegistryNode* self, int* result_length1) {
	gchar** result = NULL;
	gchar** children_tags = NULL;
	gchar** _tmp0_;
	gint children_tags_length1;
	gint _children_tags_size_;
	GList* _tmp1_;
	gchar** _tmp8_;
	gint _tmp8__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	children_tags = _tmp0_;
	children_tags_length1 = 0;
	_children_tags_size_ = children_tags_length1;
	_tmp1_ = self->priv->children;
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp1_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GamesSteamRegistryValue* _tmp2_;
			GamesSteamRegistryValue* child = NULL;
			_tmp2_ = _g_object_ref0 ((GamesSteamRegistryValue*) child_it->data);
			child = _tmp2_;
			{
				gchar** _tmp3_;
				gint _tmp3__length1;
				GamesSteamRegistryValue* _tmp4_;
				const gchar* _tmp5_;
				const gchar* _tmp6_;
				gchar* _tmp7_;
				_tmp3_ = children_tags;
				_tmp3__length1 = children_tags_length1;
				_tmp4_ = child;
				_tmp5_ = games_steam_registry_value_get_tag (_tmp4_);
				_tmp6_ = _tmp5_;
				_tmp7_ = g_strdup (_tmp6_);
				_vala_array_add2 (&children_tags, &children_tags_length1, &_children_tags_size_, _tmp7_);
				_g_object_unref0 (child);
			}
		}
	}
	_tmp8_ = children_tags;
	_tmp8__length1 = children_tags_length1;
	if (result_length1) {
		*result_length1 = _tmp8__length1;
	}
	result = _tmp8_;
	return result;
}


static void games_steam_registry_node_class_init (GamesSteamRegistryNodeClass * klass) {
	games_steam_registry_node_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesSteamRegistryNodePrivate));
	G_OBJECT_CLASS (klass)->finalize = games_steam_registry_node_finalize;
}


static void games_steam_registry_node_instance_init (GamesSteamRegistryNode * self) {
	self->priv = GAMES_STEAM_REGISTRY_NODE_GET_PRIVATE (self);
}


static void games_steam_registry_node_finalize (GObject * obj) {
	GamesSteamRegistryNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_STEAM_REGISTRY_NODE, GamesSteamRegistryNode);
	__g_list_free__g_object_unref0_0 (self->priv->children);
	G_OBJECT_CLASS (games_steam_registry_node_parent_class)->finalize (obj);
}


GType games_steam_registry_node_get_type (void) {
	return games_steam_registry_node_type_id;
}


GType games_steam_registry_node_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (GamesSteamRegistryNodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_steam_registry_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesSteamRegistryNode), 0, (GInstanceInitFunc) games_steam_registry_node_instance_init, NULL };
	games_steam_registry_node_type_id = g_type_module_register_type (module, GAMES_TYPE_STEAM_REGISTRY_VALUE, "GamesSteamRegistryNode", &g_define_type_info, 0);
	return games_steam_registry_node_type_id;
}


GamesSteamRegistryData* games_steam_registry_data_construct (GType object_type, const gchar* tag, const gchar* data) {
	GamesSteamRegistryData * self = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (tag != NULL, NULL);
	g_return_val_if_fail (data != NULL, NULL);
	_tmp0_ = tag;
	_tmp1_ = data;
	self = (GamesSteamRegistryData*) g_object_new (object_type, "tag", _tmp0_, "data", _tmp1_, NULL);
	return self;
}


GamesSteamRegistryData* games_steam_registry_data_new (const gchar* tag, const gchar* data) {
	return games_steam_registry_data_construct (GAMES_TYPE_STEAM_REGISTRY_DATA, tag, data);
}


const gchar* games_steam_registry_data_get_data (GamesSteamRegistryData* self) {
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_data;
	result = _tmp0_;
	return result;
}


static void games_steam_registry_data_set_data (GamesSteamRegistryData* self, const gchar* value) {
	g_return_if_fail (self != NULL);
	if (g_strcmp0 (value, games_steam_registry_data_get_data (self)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_data);
		self->priv->_data = _tmp1_;
		g_object_notify ((GObject *) self, "data");
	}
}


static void games_steam_registry_data_class_init (GamesSteamRegistryDataClass * klass) {
	games_steam_registry_data_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GamesSteamRegistryDataPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_games_steam_registry_data_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_games_steam_registry_data_set_property;
	G_OBJECT_CLASS (klass)->finalize = games_steam_registry_data_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY, g_param_spec_string ("data", "data", "data", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
}


static void games_steam_registry_data_instance_init (GamesSteamRegistryData * self) {
	self->priv = GAMES_STEAM_REGISTRY_DATA_GET_PRIVATE (self);
}


static void games_steam_registry_data_finalize (GObject * obj) {
	GamesSteamRegistryData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryData);
	_g_free0 (self->priv->_data);
	G_OBJECT_CLASS (games_steam_registry_data_parent_class)->finalize (obj);
}


GType games_steam_registry_data_get_type (void) {
	return games_steam_registry_data_type_id;
}


GType games_steam_registry_data_register_type (GTypeModule * module) {
	static const GTypeInfo g_define_type_info = { sizeof (GamesSteamRegistryDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) games_steam_registry_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GamesSteamRegistryData), 0, (GInstanceInitFunc) games_steam_registry_data_instance_init, NULL };
	games_steam_registry_data_type_id = g_type_module_register_type (module, GAMES_TYPE_STEAM_REGISTRY_VALUE, "GamesSteamRegistryData", &g_define_type_info, 0);
	return games_steam_registry_data_type_id;
}


static void _vala_games_steam_registry_data_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GamesSteamRegistryData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryData);
	switch (property_id) {
		case GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY:
		g_value_set_string (value, games_steam_registry_data_get_data (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_games_steam_registry_data_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GamesSteamRegistryData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GAMES_TYPE_STEAM_REGISTRY_DATA, GamesSteamRegistryData);
	switch (property_id) {
		case GAMES_STEAM_REGISTRY_DATA_DATA_PROPERTY:
		games_steam_registry_data_set_data (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


GQuark games_steam_registry_error_quark (void) {
	return g_quark_from_static_string ("games_steam_registry_error-quark");
}


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



