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

/*
 * Copyright (C) 2008-2012 Robert Ancell.
 *
 * 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. See http://www.gnu.org/copyleft/gpl.html the full text of the
 * license.
 */

#include "calculator.h"
#include <glib.h>
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>

enum  {
	UNIT_MANAGER_0_PROPERTY,
	UNIT_MANAGER_NUM_PROPERTIES
};
static GParamSpec* unit_manager_properties[UNIT_MANAGER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	UNIT_CATEGORY_0_PROPERTY,
	UNIT_CATEGORY_NAME_PROPERTY,
	UNIT_CATEGORY_DISPLAY_NAME_PROPERTY,
	UNIT_CATEGORY_NUM_PROPERTIES
};
static GParamSpec* unit_category_properties[UNIT_CATEGORY_NUM_PROPERTIES];
enum  {
	UNIT_0_PROPERTY,
	UNIT_NAME_PROPERTY,
	UNIT_DISPLAY_NAME_PROPERTY,
	UNIT_NUM_PROPERTIES
};
static GParamSpec* unit_properties[UNIT_NUM_PROPERTIES];

#define TYPE_UNIT_SOLVE_EQUATION (unit_solve_equation_get_type ())
#define UNIT_SOLVE_EQUATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNIT_SOLVE_EQUATION, UnitSolveEquation))
#define UNIT_SOLVE_EQUATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNIT_SOLVE_EQUATION, UnitSolveEquationClass))
#define IS_UNIT_SOLVE_EQUATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNIT_SOLVE_EQUATION))
#define IS_UNIT_SOLVE_EQUATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNIT_SOLVE_EQUATION))
#define UNIT_SOLVE_EQUATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNIT_SOLVE_EQUATION, UnitSolveEquationClass))

typedef struct _UnitSolveEquation UnitSolveEquation;
typedef struct _UnitSolveEquationClass UnitSolveEquationClass;
typedef struct _UnitSolveEquationPrivate UnitSolveEquationPrivate;
enum  {
	UNIT_SOLVE_EQUATION_0_PROPERTY,
	UNIT_SOLVE_EQUATION_NUM_PROPERTIES
};
static GParamSpec* unit_solve_equation_properties[UNIT_SOLVE_EQUATION_NUM_PROPERTIES];

struct _UnitManagerPrivate {
	GList* categories;
};

struct _UnitCategoryPrivate {
	GList* units;
	gchar* _name;
	gchar* _display_name;
};

struct _UnitPrivate {
	gchar* _name;
	gchar* _display_name;
	gchar* _format;
	GList* _symbols;
	gchar* from_function;
	gchar* to_function;
	Serializer* serializer;
};

struct _UnitSolveEquation {
	Equation parent_instance;
	UnitSolveEquationPrivate * priv;
};

struct _UnitSolveEquationClass {
	EquationClass parent_class;
};

struct _UnitSolveEquationPrivate {
	Number* x;
};

VALA_EXTERN UnitManager* default_unit_manager;
UnitManager* default_unit_manager = NULL;
static gint UnitManager_private_offset;
static gpointer unit_manager_parent_class = NULL;
static gint UnitCategory_private_offset;
static gpointer unit_category_parent_class = NULL;
static gint Unit_private_offset;
static gpointer unit_parent_class = NULL;
static gint UnitSolveEquation_private_offset;
static gpointer unit_solve_equation_parent_class = NULL;

static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static gint __lambda10_ (Currency* a,
                  Currency* b);
static gint ___lambda10__gcompare_func (gconstpointer a,
                                 gconstpointer b);
static void unit_manager_finalize (GObject * obj);
static GType unit_manager_get_type_once (void);
static void unit_category_finalize (GObject * obj);
static GType unit_category_get_type_once (void);
static void _vala_unit_category_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec);
static void _g_free0_ (gpointer var);
static inline void _g_list_free__g_free0_ (GList* self);
static Number* unit_solve_function (Unit* self,
                             const gchar* function,
                             Number* x);
VALA_EXTERN GType unit_solve_equation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN UnitSolveEquation* unit_solve_equation_new (const gchar* function,
                                            Number* x);
VALA_EXTERN UnitSolveEquation* unit_solve_equation_construct (GType object_type,
                                                  const gchar* function,
                                                  Number* x);
static void unit_finalize (GObject * obj);
static GType unit_get_type_once (void);
static void _vala_unit_get_property (GObject * object,
                              guint property_id,
                              GValue * value,
                              GParamSpec * pspec);
static gboolean unit_solve_equation_real_variable_is_defined (Equation* base,
                                                       const gchar* name);
static Number* unit_solve_equation_real_get_variable (Equation* base,
                                               const gchar* name);
static void unit_solve_equation_finalize (GObject * obj);
static GType unit_solve_equation_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
unit_manager_get_instance_private (UnitManager* self)
{
	return G_STRUCT_MEMBER_P (self, UnitManager_private_offset);
}

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

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

UnitManager*
unit_manager_construct (GType object_type)
{
	UnitManager * self = NULL;
	self = (UnitManager*) g_object_new (object_type, NULL);
	(self->priv->categories == NULL) ? NULL : (self->priv->categories = (_g_list_free__g_object_unref0_ (self->priv->categories), NULL));
	self->priv->categories = NULL;
	return self;
}

UnitManager*
unit_manager_new (void)
{
	return unit_manager_construct (TYPE_UNIT_MANAGER);
}

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

static gint
__lambda10_ (Currency* a,
             Currency* b)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gint _tmp6_;
	gint result;
	g_return_val_if_fail (a != NULL, 0);
	g_return_val_if_fail (b != NULL, 0);
	_tmp0_ = currency_get_display_name (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = currency_get_display_name (b);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = g_utf8_collate (_tmp2_, _tmp5_);
	_g_free0 (_tmp5_);
	_g_free0 (_tmp2_);
	result = _tmp6_;
	return result;
}

static gint
___lambda10__gcompare_func (gconstpointer a,
                            gconstpointer b)
{
	gint result;
	result = __lambda10_ ((Currency*) a, (Currency*) b);
	return result;
}

UnitManager*
unit_manager_get_default (void)
{
	UnitManager* _tmp0_;
	UnitManager* _tmp3_;
	UnitCategory* angle_category = NULL;
	UnitManager* _tmp4_;
	UnitCategory* _tmp5_;
	UnitCategory* length_category = NULL;
	UnitManager* _tmp6_;
	UnitCategory* _tmp7_;
	UnitCategory* speed_category = NULL;
	UnitManager* _tmp8_;
	UnitCategory* _tmp9_;
	UnitCategory* area_category = NULL;
	UnitManager* _tmp10_;
	UnitCategory* _tmp11_;
	UnitCategory* volume_category = NULL;
	UnitManager* _tmp12_;
	UnitCategory* _tmp13_;
	UnitCategory* weight_category = NULL;
	UnitManager* _tmp14_;
	UnitCategory* _tmp15_;
	UnitCategory* duration_category = NULL;
	UnitManager* _tmp16_;
	UnitCategory* _tmp17_;
	UnitCategory* frequency_category = NULL;
	UnitManager* _tmp18_;
	UnitCategory* _tmp19_;
	UnitCategory* temperature_category = NULL;
	UnitManager* _tmp20_;
	UnitCategory* _tmp21_;
	UnitCategory* digitalstorage_category = NULL;
	UnitManager* _tmp22_;
	UnitCategory* _tmp23_;
	UnitCategory* _tmp24_;
	Unit* _tmp25_;
	Unit* _tmp26_;
	UnitCategory* _tmp27_;
	Unit* _tmp28_;
	Unit* _tmp29_;
	UnitCategory* _tmp30_;
	Unit* _tmp31_;
	Unit* _tmp32_;
	UnitCategory* _tmp33_;
	Unit* _tmp34_;
	Unit* _tmp35_;
	UnitCategory* _tmp36_;
	Unit* _tmp37_;
	Unit* _tmp38_;
	UnitCategory* _tmp39_;
	Unit* _tmp40_;
	Unit* _tmp41_;
	UnitCategory* _tmp42_;
	Unit* _tmp43_;
	Unit* _tmp44_;
	UnitCategory* _tmp45_;
	Unit* _tmp46_;
	Unit* _tmp47_;
	UnitCategory* _tmp48_;
	Unit* _tmp49_;
	Unit* _tmp50_;
	UnitCategory* _tmp51_;
	Unit* _tmp52_;
	Unit* _tmp53_;
	UnitCategory* _tmp54_;
	Unit* _tmp55_;
	Unit* _tmp56_;
	UnitCategory* _tmp57_;
	Unit* _tmp58_;
	Unit* _tmp59_;
	UnitCategory* _tmp60_;
	Unit* _tmp61_;
	Unit* _tmp62_;
	UnitCategory* _tmp63_;
	Unit* _tmp64_;
	Unit* _tmp65_;
	UnitCategory* _tmp66_;
	Unit* _tmp67_;
	Unit* _tmp68_;
	UnitCategory* _tmp69_;
	Unit* _tmp70_;
	Unit* _tmp71_;
	UnitCategory* _tmp72_;
	Unit* _tmp73_;
	Unit* _tmp74_;
	UnitCategory* _tmp75_;
	Unit* _tmp76_;
	Unit* _tmp77_;
	UnitCategory* _tmp78_;
	Unit* _tmp79_;
	Unit* _tmp80_;
	UnitCategory* _tmp81_;
	Unit* _tmp82_;
	Unit* _tmp83_;
	UnitCategory* _tmp84_;
	Unit* _tmp85_;
	Unit* _tmp86_;
	UnitCategory* _tmp87_;
	Unit* _tmp88_;
	Unit* _tmp89_;
	UnitCategory* _tmp90_;
	Unit* _tmp91_;
	Unit* _tmp92_;
	UnitCategory* _tmp93_;
	Unit* _tmp94_;
	Unit* _tmp95_;
	UnitCategory* _tmp96_;
	Unit* _tmp97_;
	Unit* _tmp98_;
	UnitCategory* _tmp99_;
	Unit* _tmp100_;
	Unit* _tmp101_;
	UnitCategory* _tmp102_;
	Unit* _tmp103_;
	Unit* _tmp104_;
	UnitCategory* _tmp105_;
	Unit* _tmp106_;
	Unit* _tmp107_;
	UnitCategory* _tmp108_;
	Unit* _tmp109_;
	Unit* _tmp110_;
	UnitCategory* _tmp111_;
	Unit* _tmp112_;
	Unit* _tmp113_;
	UnitCategory* _tmp114_;
	Unit* _tmp115_;
	Unit* _tmp116_;
	UnitCategory* _tmp117_;
	Unit* _tmp118_;
	Unit* _tmp119_;
	UnitCategory* _tmp120_;
	Unit* _tmp121_;
	Unit* _tmp122_;
	UnitCategory* _tmp123_;
	Unit* _tmp124_;
	Unit* _tmp125_;
	UnitCategory* _tmp126_;
	Unit* _tmp127_;
	Unit* _tmp128_;
	UnitCategory* _tmp129_;
	Unit* _tmp130_;
	Unit* _tmp131_;
	UnitCategory* _tmp132_;
	Unit* _tmp133_;
	Unit* _tmp134_;
	UnitCategory* _tmp135_;
	Unit* _tmp136_;
	Unit* _tmp137_;
	UnitCategory* _tmp138_;
	Unit* _tmp139_;
	Unit* _tmp140_;
	UnitCategory* _tmp141_;
	Unit* _tmp142_;
	Unit* _tmp143_;
	UnitCategory* _tmp144_;
	Unit* _tmp145_;
	Unit* _tmp146_;
	UnitCategory* _tmp147_;
	Unit* _tmp148_;
	Unit* _tmp149_;
	UnitCategory* _tmp150_;
	Unit* _tmp151_;
	Unit* _tmp152_;
	UnitCategory* _tmp153_;
	Unit* _tmp154_;
	Unit* _tmp155_;
	UnitCategory* _tmp156_;
	Unit* _tmp157_;
	Unit* _tmp158_;
	UnitCategory* _tmp159_;
	Unit* _tmp160_;
	Unit* _tmp161_;
	UnitCategory* _tmp162_;
	Unit* _tmp163_;
	Unit* _tmp164_;
	UnitCategory* _tmp165_;
	Unit* _tmp166_;
	Unit* _tmp167_;
	UnitCategory* _tmp168_;
	Unit* _tmp169_;
	Unit* _tmp170_;
	UnitCategory* _tmp171_;
	Unit* _tmp172_;
	Unit* _tmp173_;
	UnitCategory* _tmp174_;
	Unit* _tmp175_;
	Unit* _tmp176_;
	UnitCategory* _tmp177_;
	Unit* _tmp178_;
	Unit* _tmp179_;
	UnitCategory* _tmp180_;
	Unit* _tmp181_;
	Unit* _tmp182_;
	UnitCategory* _tmp183_;
	Unit* _tmp184_;
	Unit* _tmp185_;
	UnitCategory* _tmp186_;
	Unit* _tmp187_;
	Unit* _tmp188_;
	UnitCategory* _tmp189_;
	Unit* _tmp190_;
	Unit* _tmp191_;
	UnitCategory* _tmp192_;
	Unit* _tmp193_;
	Unit* _tmp194_;
	UnitCategory* _tmp195_;
	Unit* _tmp196_;
	Unit* _tmp197_;
	UnitCategory* _tmp198_;
	Unit* _tmp199_;
	Unit* _tmp200_;
	UnitCategory* _tmp201_;
	Unit* _tmp202_;
	Unit* _tmp203_;
	UnitCategory* _tmp204_;
	Unit* _tmp205_;
	Unit* _tmp206_;
	UnitCategory* _tmp207_;
	Unit* _tmp208_;
	Unit* _tmp209_;
	UnitCategory* _tmp210_;
	Unit* _tmp211_;
	Unit* _tmp212_;
	UnitCategory* _tmp213_;
	Unit* _tmp214_;
	Unit* _tmp215_;
	UnitCategory* _tmp216_;
	Unit* _tmp217_;
	Unit* _tmp218_;
	UnitCategory* _tmp219_;
	Unit* _tmp220_;
	Unit* _tmp221_;
	UnitCategory* _tmp222_;
	Unit* _tmp223_;
	Unit* _tmp224_;
	UnitCategory* _tmp225_;
	Unit* _tmp226_;
	Unit* _tmp227_;
	UnitCategory* _tmp228_;
	Unit* _tmp229_;
	Unit* _tmp230_;
	UnitCategory* _tmp231_;
	Unit* _tmp232_;
	Unit* _tmp233_;
	UnitCategory* _tmp234_;
	Unit* _tmp235_;
	Unit* _tmp236_;
	UnitCategory* _tmp237_;
	Unit* _tmp238_;
	Unit* _tmp239_;
	UnitCategory* _tmp240_;
	Unit* _tmp241_;
	Unit* _tmp242_;
	UnitCategory* _tmp243_;
	Unit* _tmp244_;
	Unit* _tmp245_;
	UnitCategory* _tmp246_;
	Unit* _tmp247_;
	Unit* _tmp248_;
	UnitCategory* _tmp249_;
	Unit* _tmp250_;
	Unit* _tmp251_;
	UnitCategory* _tmp252_;
	Unit* _tmp253_;
	Unit* _tmp254_;
	UnitCategory* _tmp255_;
	Unit* _tmp256_;
	Unit* _tmp257_;
	UnitCategory* _tmp258_;
	Unit* _tmp259_;
	Unit* _tmp260_;
	UnitCategory* _tmp261_;
	Unit* _tmp262_;
	Unit* _tmp263_;
	UnitCategory* _tmp264_;
	Unit* _tmp265_;
	Unit* _tmp266_;
	UnitCategory* _tmp267_;
	Unit* _tmp268_;
	Unit* _tmp269_;
	UnitCategory* _tmp270_;
	Unit* _tmp271_;
	Unit* _tmp272_;
	UnitCategory* _tmp273_;
	Unit* _tmp274_;
	Unit* _tmp275_;
	UnitCategory* _tmp276_;
	Unit* _tmp277_;
	Unit* _tmp278_;
	UnitCategory* _tmp279_;
	Unit* _tmp280_;
	Unit* _tmp281_;
	UnitCategory* _tmp282_;
	Unit* _tmp283_;
	Unit* _tmp284_;
	UnitCategory* _tmp285_;
	Unit* _tmp286_;
	Unit* _tmp287_;
	UnitCategory* _tmp288_;
	Unit* _tmp289_;
	Unit* _tmp290_;
	UnitCategory* _tmp291_;
	Unit* _tmp292_;
	Unit* _tmp293_;
	UnitCategory* _tmp294_;
	Unit* _tmp295_;
	Unit* _tmp296_;
	UnitCategory* _tmp297_;
	Unit* _tmp298_;
	Unit* _tmp299_;
	UnitCategory* _tmp300_;
	Unit* _tmp301_;
	Unit* _tmp302_;
	UnitCategory* _tmp303_;
	Unit* _tmp304_;
	Unit* _tmp305_;
	UnitCategory* _tmp306_;
	Unit* _tmp307_;
	Unit* _tmp308_;
	UnitCategory* _tmp309_;
	Unit* _tmp310_;
	Unit* _tmp311_;
	UnitCategory* _tmp312_;
	Unit* _tmp313_;
	Unit* _tmp314_;
	UnitCategory* _tmp315_;
	Unit* _tmp316_;
	Unit* _tmp317_;
	UnitCategory* _tmp318_;
	Unit* _tmp319_;
	Unit* _tmp320_;
	UnitCategory* _tmp321_;
	Unit* _tmp322_;
	Unit* _tmp323_;
	UnitCategory* _tmp324_;
	Unit* _tmp325_;
	Unit* _tmp326_;
	UnitCategory* currency_category = NULL;
	UnitManager* _tmp327_;
	UnitCategory* _tmp328_;
	GList* currencies = NULL;
	CurrencyManager* _tmp329_;
	CurrencyManager* _tmp330_;
	GList* _tmp331_;
	GList* _tmp332_;
	GList* _tmp333_;
	UnitManager* _tmp358_;
	UnitManager* _tmp359_;
	UnitManager* result;
	_tmp0_ = default_unit_manager;
	if (_tmp0_ != NULL) {
		UnitManager* _tmp1_;
		UnitManager* _tmp2_;
		_tmp1_ = default_unit_manager;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		result = _tmp2_;
		return result;
	}
	_tmp3_ = unit_manager_new ();
	_g_object_unref0 (default_unit_manager);
	default_unit_manager = _tmp3_;
	_tmp4_ = default_unit_manager;
	_tmp5_ = unit_manager_add_category (_tmp4_, "angle", _ ("Angle"));
	angle_category = _tmp5_;
	_tmp6_ = default_unit_manager;
	_tmp7_ = unit_manager_add_category (_tmp6_, "length", _ ("Length"));
	length_category = _tmp7_;
	_tmp8_ = default_unit_manager;
	_tmp9_ = unit_manager_add_category (_tmp8_, "speed", _ ("Speed"));
	speed_category = _tmp9_;
	_tmp10_ = default_unit_manager;
	_tmp11_ = unit_manager_add_category (_tmp10_, "area", _ ("Area"));
	area_category = _tmp11_;
	_tmp12_ = default_unit_manager;
	_tmp13_ = unit_manager_add_category (_tmp12_, "volume", _ ("Volume"));
	volume_category = _tmp13_;
	_tmp14_ = default_unit_manager;
	_tmp15_ = unit_manager_add_category (_tmp14_, "weight", _ ("Mass"));
	weight_category = _tmp15_;
	_tmp16_ = default_unit_manager;
	_tmp17_ = unit_manager_add_category (_tmp16_, "duration", _ ("Duration"));
	duration_category = _tmp17_;
	_tmp18_ = default_unit_manager;
	_tmp19_ = unit_manager_add_category (_tmp18_, "frequency", _ ("Frequency"));
	frequency_category = _tmp19_;
	_tmp20_ = default_unit_manager;
	_tmp21_ = unit_manager_add_category (_tmp20_, "temperature", _ ("Temperature"));
	temperature_category = _tmp21_;
	_tmp22_ = default_unit_manager;
	_tmp23_ = unit_manager_add_category (_tmp22_, "digitalstorage", _ ("Digital Storage"));
	digitalstorage_category = _tmp23_;
	_tmp24_ = angle_category;
	_tmp25_ = unit_new ("degree", _ ("Degrees"), g_dpgettext2 (NULL, "unit-format", "%s degrees"), "π*x/180", "180x/π", g_dpgettext2 (NULL, "unit-symbols", "degree,degrees,deg"));
	_tmp26_ = _tmp25_;
	unit_category_add_unit (_tmp24_, _tmp26_);
	_g_object_unref0 (_tmp26_);
	_tmp27_ = angle_category;
	_tmp28_ = unit_new ("radian", _ ("Radians"), g_dpgettext2 (NULL, "unit-format", "%s radians"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "radian,radians,rad"));
	_tmp29_ = _tmp28_;
	unit_category_add_unit (_tmp27_, _tmp29_);
	_g_object_unref0 (_tmp29_);
	_tmp30_ = angle_category;
	_tmp31_ = unit_new ("gradian", _ ("Gradians"), g_dpgettext2 (NULL, "unit-format", "%s gradians"), "π*x/200", "200x/π", g_dpgettext2 (NULL, "unit-symbols", "gradian,gradians,grad"));
	_tmp32_ = _tmp31_;
	unit_category_add_unit (_tmp30_, _tmp32_);
	_g_object_unref0 (_tmp32_);
	_tmp33_ = length_category;
	_tmp34_ = unit_new ("parsec", _ ("Parsecs"), g_dpgettext2 (NULL, "unit-format", "%s pc"), "30857000000000000x", "x/30857000000000000", g_dpgettext2 (NULL, "unit-symbols", "parsec,parsecs,pc"));
	_tmp35_ = _tmp34_;
	unit_category_add_unit (_tmp33_, _tmp35_);
	_g_object_unref0 (_tmp35_);
	_tmp36_ = length_category;
	_tmp37_ = unit_new ("lightyear", _ ("Light Years"), g_dpgettext2 (NULL, "unit-format", "%s ly"), "9460730472580800x", "x/9460730472580800", g_dpgettext2 (NULL, "unit-symbols", "lightyear,lightyears,ly"));
	_tmp38_ = _tmp37_;
	unit_category_add_unit (_tmp36_, _tmp38_);
	_g_object_unref0 (_tmp38_);
	_tmp39_ = length_category;
	_tmp40_ = unit_new ("astronomical-unit", _ ("Astronomical Units"), g_dpgettext2 (NULL, "unit-format", "%s au"), "149597870700x", "x/149597870700", g_dpgettext2 (NULL, "unit-symbols", "au"));
	_tmp41_ = _tmp40_;
	unit_category_add_unit (_tmp39_, _tmp41_);
	_g_object_unref0 (_tmp41_);
	_tmp42_ = length_category;
	_tmp43_ = unit_new ("rack-unit", _ ("Rack Units"), g_dpgettext2 (NULL, "unit-format", "%sU"), "x/22.49718785151856", "22.49718785151856x", g_dpgettext2 (NULL, "unit-symbols", "U"));
	_tmp44_ = _tmp43_;
	unit_category_add_unit (_tmp42_, _tmp44_);
	_g_object_unref0 (_tmp44_);
	_tmp45_ = length_category;
	_tmp46_ = unit_new ("nautical-mile", _ ("Nautical Miles"), g_dpgettext2 (NULL, "unit-format", "%s nmi"), "1852x", "x/1852", g_dpgettext2 (NULL, "unit-symbols", "nmi"));
	_tmp47_ = _tmp46_;
	unit_category_add_unit (_tmp45_, _tmp47_);
	_g_object_unref0 (_tmp47_);
	_tmp48_ = length_category;
	_tmp49_ = unit_new ("mile", _ ("Miles"), g_dpgettext2 (NULL, "unit-format", "%s mi"), "1609.344x", "x/1609.344", g_dpgettext2 (NULL, "unit-symbols", "mile,miles,mi"));
	_tmp50_ = _tmp49_;
	unit_category_add_unit (_tmp48_, _tmp50_);
	_g_object_unref0 (_tmp50_);
	_tmp51_ = length_category;
	_tmp52_ = unit_new ("kilometer", _ ("Kilometers"), g_dpgettext2 (NULL, "unit-format", "%s km"), "1000x", "x/1000", g_dpgettext2 (NULL, "unit-symbols", "kilometer,kilometers,km,kms"));
	_tmp53_ = _tmp52_;
	unit_category_add_unit (_tmp51_, _tmp53_);
	_g_object_unref0 (_tmp53_);
	_tmp54_ = length_category;
	_tmp55_ = unit_new ("cable", _ ("Cables"), g_dpgettext2 (NULL, "unit-format", "%s cb"), "219.456x", "x/219.456", g_dpgettext2 (NULL, "unit-symbols", "cable,cables,cb"));
	_tmp56_ = _tmp55_;
	unit_category_add_unit (_tmp54_, _tmp56_);
	_g_object_unref0 (_tmp56_);
	_tmp57_ = length_category;
	_tmp58_ = unit_new ("fathom", _ ("Fathoms"), g_dpgettext2 (NULL, "unit-format", "%s ftm"), "1.8288x", "x/1.8288", g_dpgettext2 (NULL, "unit-symbols", "fathom,fathoms,ftm"));
	_tmp59_ = _tmp58_;
	unit_category_add_unit (_tmp57_, _tmp59_);
	_g_object_unref0 (_tmp59_);
	_tmp60_ = length_category;
	_tmp61_ = unit_new ("meter", _ ("Meters"), g_dpgettext2 (NULL, "unit-format", "%s m"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "meter,meters,m"));
	_tmp62_ = _tmp61_;
	unit_category_add_unit (_tmp60_, _tmp62_);
	_g_object_unref0 (_tmp62_);
	_tmp63_ = length_category;
	_tmp64_ = unit_new ("yard", _ ("Yards"), g_dpgettext2 (NULL, "unit-format", "%s yd"), "0.9144x", "x/0.9144", g_dpgettext2 (NULL, "unit-symbols", "yard,yards,yd"));
	_tmp65_ = _tmp64_;
	unit_category_add_unit (_tmp63_, _tmp65_);
	_g_object_unref0 (_tmp65_);
	_tmp66_ = length_category;
	_tmp67_ = unit_new ("foot", _ ("Feet"), g_dpgettext2 (NULL, "unit-format", "%s ft"), "0.3048x", "x/0.3048", g_dpgettext2 (NULL, "unit-symbols", "foot,feet,ft"));
	_tmp68_ = _tmp67_;
	unit_category_add_unit (_tmp66_, _tmp68_);
	_g_object_unref0 (_tmp68_);
	_tmp69_ = length_category;
	_tmp70_ = unit_new ("inch", _ ("Inches"), g_dpgettext2 (NULL, "unit-format", "%s in"), "0.0254x", "x/0.0254", g_dpgettext2 (NULL, "unit-symbols", "inch,inches,in"));
	_tmp71_ = _tmp70_;
	unit_category_add_unit (_tmp69_, _tmp71_);
	_g_object_unref0 (_tmp71_);
	_tmp72_ = length_category;
	_tmp73_ = unit_new ("centimeter", _ ("Centimeters"), g_dpgettext2 (NULL, "unit-format", "%s cm"), "x/100", "100x", g_dpgettext2 (NULL, "unit-symbols", "centimeter,centimeters,cm,cms"));
	_tmp74_ = _tmp73_;
	unit_category_add_unit (_tmp72_, _tmp74_);
	_g_object_unref0 (_tmp74_);
	_tmp75_ = length_category;
	_tmp76_ = unit_new ("millimeter", _ ("Millimeters"), g_dpgettext2 (NULL, "unit-format", "%s mm"), "x/1000", "1000x", g_dpgettext2 (NULL, "unit-symbols", "millimeter,millimeters,mm"));
	_tmp77_ = _tmp76_;
	unit_category_add_unit (_tmp75_, _tmp77_);
	_g_object_unref0 (_tmp77_);
	_tmp78_ = length_category;
	_tmp79_ = unit_new ("micrometer", _ ("Micrometers"), g_dpgettext2 (NULL, "unit-format", "%s μm"), "x/1000000", "1000000x", g_dpgettext2 (NULL, "unit-symbols", "micrometer,micrometers,um"));
	_tmp80_ = _tmp79_;
	unit_category_add_unit (_tmp78_, _tmp80_);
	_g_object_unref0 (_tmp80_);
	_tmp81_ = length_category;
	_tmp82_ = unit_new ("nanometer", _ ("Nanometers"), g_dpgettext2 (NULL, "unit-format", "%s nm"), "x/1000000000", "1000000000x", g_dpgettext2 (NULL, "unit-symbols", "nanometer,nanometers,nm"));
	_tmp83_ = _tmp82_;
	unit_category_add_unit (_tmp81_, _tmp83_);
	_g_object_unref0 (_tmp83_);
	_tmp84_ = length_category;
	_tmp85_ = unit_new ("point", _ ("Desktop Publishing Point"), g_dpgettext2 (NULL, "unit-format", "%s pt"), "0.000352777778x", "x/0.000352777778", g_dpgettext2 (NULL, "unit-symbols", "point,pt,points,pts"));
	_tmp86_ = _tmp85_;
	unit_category_add_unit (_tmp84_, _tmp86_);
	_g_object_unref0 (_tmp86_);
	_tmp87_ = speed_category;
	_tmp88_ = unit_new ("kilometers-hour", _ ("Kilometers per hour"), g_dpgettext2 (NULL, "unit-format", "%s km/h"), "x/3.6", "3.6x", g_dpgettext2 (NULL, "unit-symbols", "kilometers per hour,kmph,kmh,kph"));
	_tmp89_ = _tmp88_;
	unit_category_add_unit (_tmp87_, _tmp89_);
	_g_object_unref0 (_tmp89_);
	_tmp90_ = speed_category;
	_tmp91_ = unit_new ("miles-hour", _ ("Miles per hour"), g_dpgettext2 (NULL, "unit-format", "%s miles/h"), "x/2.23693629", "2.23693629x", g_dpgettext2 (NULL, "unit-symbols", "milesph,miles per hour,mi/h,miph,mph"));
	_tmp92_ = _tmp91_;
	unit_category_add_unit (_tmp90_, _tmp92_);
	_g_object_unref0 (_tmp92_);
	_tmp93_ = speed_category;
	_tmp94_ = unit_new ("meters-second", _ ("Meters per second"), g_dpgettext2 (NULL, "unit-format", "%s m/s"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "meters per second,mps"));
	_tmp95_ = _tmp94_;
	unit_category_add_unit (_tmp93_, _tmp95_);
	_g_object_unref0 (_tmp95_);
	_tmp96_ = speed_category;
	_tmp97_ = unit_new ("feet-second", _ ("Feet per second"), g_dpgettext2 (NULL, "unit-format", "%s feet/s"), "x/3.28084", "3.28084x", g_dpgettext2 (NULL, "unit-symbols", "fps,feet per second,feetps"));
	_tmp98_ = _tmp97_;
	unit_category_add_unit (_tmp96_, _tmp98_);
	_g_object_unref0 (_tmp98_);
	_tmp99_ = speed_category;
	_tmp100_ = unit_new ("knot", _ ("Knots"), g_dpgettext2 (NULL, "unit-format", "%s kt"), "x/1.94384449", "1.94384449x", g_dpgettext2 (NULL, "unit-symbols", "kt,kn,nd,knot,knots"));
	_tmp101_ = _tmp100_;
	unit_category_add_unit (_tmp99_, _tmp101_);
	_g_object_unref0 (_tmp101_);
	_tmp102_ = area_category;
	_tmp103_ = unit_new ("hectare", _ ("Hectares"), g_dpgettext2 (NULL, "unit-format", "%s ha"), "10000x", "x/10000", g_dpgettext2 (NULL, "unit-symbols", "hectare,hectares,ha"));
	_tmp104_ = _tmp103_;
	unit_category_add_unit (_tmp102_, _tmp104_);
	_g_object_unref0 (_tmp104_);
	_tmp105_ = area_category;
	_tmp106_ = unit_new ("acre", _ ("Acres"), g_dpgettext2 (NULL, "unit-format", "%s acres"), "4046.8564224x", "x/4046.8564224", g_dpgettext2 (NULL, "unit-symbols", "acre,acres"));
	_tmp107_ = _tmp106_;
	unit_category_add_unit (_tmp105_, _tmp107_);
	_g_object_unref0 (_tmp107_);
	_tmp108_ = area_category;
	_tmp109_ = unit_new ("square-foot", _ ("Square Foot"), g_dpgettext2 (NULL, "unit-format", "%s ft²"), "x/10.763910417", "10.763910417x", g_dpgettext2 (NULL, "unit-symbols", "ft²"));
	_tmp110_ = _tmp109_;
	unit_category_add_unit (_tmp108_, _tmp110_);
	_g_object_unref0 (_tmp110_);
	_tmp111_ = area_category;
	_tmp112_ = unit_new ("square-meter", _ ("Square Meters"), g_dpgettext2 (NULL, "unit-format", "%s m²"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "m²"));
	_tmp113_ = _tmp112_;
	unit_category_add_unit (_tmp111_, _tmp113_);
	_g_object_unref0 (_tmp113_);
	_tmp114_ = area_category;
	_tmp115_ = unit_new ("square-centimeter", _ ("Square Centimeters"), g_dpgettext2 (NULL, "unit-format", "%s cm²"), "0.0001x", "10000x", g_dpgettext2 (NULL, "unit-symbols", "cm²"));
	_tmp116_ = _tmp115_;
	unit_category_add_unit (_tmp114_, _tmp116_);
	_g_object_unref0 (_tmp116_);
	_tmp117_ = area_category;
	_tmp118_ = unit_new ("square-millimeter", _ ("Square Millimeters"), g_dpgettext2 (NULL, "unit-format", "%s mm²"), "0.000001x", "1000000x", g_dpgettext2 (NULL, "unit-symbols", "mm²"));
	_tmp119_ = _tmp118_;
	unit_category_add_unit (_tmp117_, _tmp119_);
	_g_object_unref0 (_tmp119_);
	_tmp120_ = volume_category;
	_tmp121_ = unit_new ("cubic-meter", _ ("Cubic Meters"), g_dpgettext2 (NULL, "unit-format", "%s m³"), "1000x", "x/1000", g_dpgettext2 (NULL, "unit-symbols", "m³"));
	_tmp122_ = _tmp121_;
	unit_category_add_unit (_tmp120_, _tmp122_);
	_g_object_unref0 (_tmp122_);
	_tmp123_ = volume_category;
	_tmp124_ = unit_new ("gallon", _ ("US Gallons"), g_dpgettext2 (NULL, "unit-format", "%s gal"), "3.785412x", "x/3.785412", g_dpgettext2 (NULL, "unit-symbols", "gallon,gallons,gal"));
	_tmp125_ = _tmp124_;
	unit_category_add_unit (_tmp123_, _tmp125_);
	_g_object_unref0 (_tmp125_);
	_tmp126_ = volume_category;
	_tmp127_ = unit_new ("litre", _ ("Liters"), g_dpgettext2 (NULL, "unit-format", "%s L"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "litre,litres,liter,liters,L"));
	_tmp128_ = _tmp127_;
	unit_category_add_unit (_tmp126_, _tmp128_);
	_g_object_unref0 (_tmp128_);
	_tmp129_ = volume_category;
	_tmp130_ = unit_new ("quart", _ ("US Quarts"), g_dpgettext2 (NULL, "unit-format", "%s qt"), "0.9463529x", "x/0.9463529", g_dpgettext2 (NULL, "unit-symbols", "quart,quarts,qt"));
	_tmp131_ = _tmp130_;
	unit_category_add_unit (_tmp129_, _tmp131_);
	_g_object_unref0 (_tmp131_);
	_tmp132_ = volume_category;
	_tmp133_ = unit_new ("pint", _ ("US Pints"), g_dpgettext2 (NULL, "unit-format", "%s pt"), "0.4731765x", "x/0.4731765", g_dpgettext2 (NULL, "unit-symbols", "pint,pints,pt"));
	_tmp134_ = _tmp133_;
	unit_category_add_unit (_tmp132_, _tmp134_);
	_g_object_unref0 (_tmp134_);
	_tmp135_ = volume_category;
	_tmp136_ = unit_new ("cup", _ ("Metric Cups"), g_dpgettext2 (NULL, "unit-format", "%s cup"), "0.25x", "4x", g_dpgettext2 (NULL, "unit-symbols", "cup,cups,cp"));
	_tmp137_ = _tmp136_;
	unit_category_add_unit (_tmp135_, _tmp137_);
	_g_object_unref0 (_tmp137_);
	_tmp138_ = volume_category;
	_tmp139_ = unit_new ("millilitre", _ ("Milliliters"), g_dpgettext2 (NULL, "unit-format", "%s mL"), "0.001x", "1000x", g_dpgettext2 (NULL, "unit-symbols", "millilitre,millilitres,milliliter,milliliters,mL,cm³"));
	_tmp140_ = _tmp139_;
	unit_category_add_unit (_tmp138_, _tmp140_);
	_g_object_unref0 (_tmp140_);
	_tmp141_ = volume_category;
	_tmp142_ = unit_new ("microlitre", _ ("Microliters"), g_dpgettext2 (NULL, "unit-format", "%s μL"), "0.000001x", "1000000x", g_dpgettext2 (NULL, "unit-symbols", "mm³,μL,uL"));
	_tmp143_ = _tmp142_;
	unit_category_add_unit (_tmp141_, _tmp143_);
	_g_object_unref0 (_tmp143_);
	_tmp144_ = weight_category;
	_tmp145_ = unit_new ("tonne", _ ("Tonnes"), g_dpgettext2 (NULL, "unit-format", "%s T"), "1000x", "x/1000", g_dpgettext2 (NULL, "unit-symbols", "tonne,tonnes"));
	_tmp146_ = _tmp145_;
	unit_category_add_unit (_tmp144_, _tmp146_);
	_g_object_unref0 (_tmp146_);
	_tmp147_ = weight_category;
	_tmp148_ = unit_new ("kilograms", _ ("Kilograms"), g_dpgettext2 (NULL, "unit-format", "%s kg"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "kilogram,kilograms,kilogramme,kilogrammes,kg,kgs"));
	_tmp149_ = _tmp148_;
	unit_category_add_unit (_tmp147_, _tmp149_);
	_g_object_unref0 (_tmp149_);
	_tmp150_ = weight_category;
	_tmp151_ = unit_new ("pound", _ ("Pounds"), g_dpgettext2 (NULL, "unit-format", "%s lb"), "0.45359237x", "x/0.45359237", g_dpgettext2 (NULL, "unit-symbols", "pound,pounds,lb,lbs"));
	_tmp152_ = _tmp151_;
	unit_category_add_unit (_tmp150_, _tmp152_);
	_g_object_unref0 (_tmp152_);
	_tmp153_ = weight_category;
	_tmp154_ = unit_new ("ounce", _ ("Ounces"), g_dpgettext2 (NULL, "unit-format", "%s oz"), "0.02834952x", "x/0.02834952", g_dpgettext2 (NULL, "unit-symbols", "ounce,ounces,oz"));
	_tmp155_ = _tmp154_;
	unit_category_add_unit (_tmp153_, _tmp155_);
	_g_object_unref0 (_tmp155_);
	_tmp156_ = weight_category;
	_tmp157_ = unit_new ("gram", _ ("Grams"), g_dpgettext2 (NULL, "unit-format", "%s g"), "0.001x", "1000x", g_dpgettext2 (NULL, "unit-symbols", "gram,grams,gramme,grammes,g"));
	_tmp158_ = _tmp157_;
	unit_category_add_unit (_tmp156_, _tmp158_);
	_g_object_unref0 (_tmp158_);
	_tmp159_ = weight_category;
	_tmp160_ = unit_new ("stone", _ ("Stone"), g_dpgettext2 (NULL, "unit-format", "%s st"), "6.350293x", "x/6.350293", g_dpgettext2 (NULL, "unit-symbols", "stone,st,stones"));
	_tmp161_ = _tmp160_;
	unit_category_add_unit (_tmp159_, _tmp161_);
	_g_object_unref0 (_tmp161_);
	_tmp162_ = duration_category;
	_tmp163_ = unit_new ("century", _ ("Centuries"), g_dpgettext2 (NULL, "unit-format", "%s centuries"), "3155760000x", "x/3155760000", g_dpgettext2 (NULL, "unit-symbols", "century,centuries"));
	_tmp164_ = _tmp163_;
	unit_category_add_unit (_tmp162_, _tmp164_);
	_g_object_unref0 (_tmp164_);
	_tmp165_ = duration_category;
	_tmp166_ = unit_new ("decade", _ ("Decades"), g_dpgettext2 (NULL, "unit-format", "%s decades"), "315576000x", "x/315576000", g_dpgettext2 (NULL, "unit-symbols", "decade,decades"));
	_tmp167_ = _tmp166_;
	unit_category_add_unit (_tmp165_, _tmp167_);
	_g_object_unref0 (_tmp167_);
	_tmp168_ = duration_category;
	_tmp169_ = unit_new ("year", _ ("Years"), g_dpgettext2 (NULL, "unit-format", "%s years"), "31557600x", "x/31557600", g_dpgettext2 (NULL, "unit-symbols", "year,years"));
	_tmp170_ = _tmp169_;
	unit_category_add_unit (_tmp168_, _tmp170_);
	_g_object_unref0 (_tmp170_);
	_tmp171_ = duration_category;
	_tmp172_ = unit_new ("month", _ ("Months"), g_dpgettext2 (NULL, "unit-format", "%s months"), "2629800x", "x/2629800", g_dpgettext2 (NULL, "unit-symbols", "month,months"));
	_tmp173_ = _tmp172_;
	unit_category_add_unit (_tmp171_, _tmp173_);
	_g_object_unref0 (_tmp173_);
	_tmp174_ = duration_category;
	_tmp175_ = unit_new ("week", _ ("Weeks"), g_dpgettext2 (NULL, "unit-format", "%s weeks"), "604800x", "x/604800", g_dpgettext2 (NULL, "unit-symbols", "week,weeks"));
	_tmp176_ = _tmp175_;
	unit_category_add_unit (_tmp174_, _tmp176_);
	_g_object_unref0 (_tmp176_);
	_tmp177_ = duration_category;
	_tmp178_ = unit_new ("day", _ ("Days"), g_dpgettext2 (NULL, "unit-format", "%s days"), "86400x", "x/86400", g_dpgettext2 (NULL, "unit-symbols", "day,days"));
	_tmp179_ = _tmp178_;
	unit_category_add_unit (_tmp177_, _tmp179_);
	_g_object_unref0 (_tmp179_);
	_tmp180_ = duration_category;
	_tmp181_ = unit_new ("hour", _ ("Hours"), g_dpgettext2 (NULL, "unit-format", "%s hours"), "3600x", "x/3600", g_dpgettext2 (NULL, "unit-symbols", "hour,hours"));
	_tmp182_ = _tmp181_;
	unit_category_add_unit (_tmp180_, _tmp182_);
	_g_object_unref0 (_tmp182_);
	_tmp183_ = duration_category;
	_tmp184_ = unit_new ("minute", _ ("Minutes"), g_dpgettext2 (NULL, "unit-format", "%s minutes"), "60x", "x/60", g_dpgettext2 (NULL, "unit-symbols", "minute,minutes"));
	_tmp185_ = _tmp184_;
	unit_category_add_unit (_tmp183_, _tmp185_);
	_g_object_unref0 (_tmp185_);
	_tmp186_ = duration_category;
	_tmp187_ = unit_new ("second", _ ("Seconds"), g_dpgettext2 (NULL, "unit-format", "%s s"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "second,seconds,s"));
	_tmp188_ = _tmp187_;
	unit_category_add_unit (_tmp186_, _tmp188_);
	_g_object_unref0 (_tmp188_);
	_tmp189_ = duration_category;
	_tmp190_ = unit_new ("millisecond", _ ("Milliseconds"), g_dpgettext2 (NULL, "unit-format", "%s ms"), "0.001x", "1000x", g_dpgettext2 (NULL, "unit-symbols", "millisecond,milliseconds,ms"));
	_tmp191_ = _tmp190_;
	unit_category_add_unit (_tmp189_, _tmp191_);
	_g_object_unref0 (_tmp191_);
	_tmp192_ = duration_category;
	_tmp193_ = unit_new ("microsecond", _ ("Microseconds"), g_dpgettext2 (NULL, "unit-format", "%s μs"), "0.000001x", "1000000x", g_dpgettext2 (NULL, "unit-symbols", "microsecond,microseconds,us,μs"));
	_tmp194_ = _tmp193_;
	unit_category_add_unit (_tmp192_, _tmp194_);
	_g_object_unref0 (_tmp194_);
	_tmp195_ = temperature_category;
	_tmp196_ = unit_new ("degree-celsius", _ ("Celsius"), g_dpgettext2 (NULL, "unit-format", "%s ˚C"), "x+273.15", "x-273.15", g_dpgettext2 (NULL, "unit-symbols", "degC,˚C,C,c,Celsius,celsius"));
	_tmp197_ = _tmp196_;
	unit_category_add_unit (_tmp195_, _tmp197_);
	_g_object_unref0 (_tmp197_);
	_tmp198_ = temperature_category;
	_tmp199_ = unit_new ("degree-fahrenheit", _ ("Fahrenheit"), g_dpgettext2 (NULL, "unit-format", "%s ˚F"), "(x+459.67)*5/9", "x*9/5-459.67", g_dpgettext2 (NULL, "unit-symbols", "degF,˚F,F,f,Fahrenheit,fahrenheit"));
	_tmp200_ = _tmp199_;
	unit_category_add_unit (_tmp198_, _tmp200_);
	_g_object_unref0 (_tmp200_);
	_tmp201_ = temperature_category;
	_tmp202_ = unit_new ("degree-kelvin", _ ("Kelvin"), g_dpgettext2 (NULL, "unit-format", "%s K"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "k,K,Kelvin,kelvin"));
	_tmp203_ = _tmp202_;
	unit_category_add_unit (_tmp201_, _tmp203_);
	_g_object_unref0 (_tmp203_);
	_tmp204_ = temperature_category;
	_tmp205_ = unit_new ("degree-rankine", _ ("Rankine"), g_dpgettext2 (NULL, "unit-format", "%s ˚R"), "x*5/9", "x*9/5", g_dpgettext2 (NULL, "unit-symbols", "degR,˚R,˚Ra,r,R,Rankine,rankine"));
	_tmp206_ = _tmp205_;
	unit_category_add_unit (_tmp204_, _tmp206_);
	_g_object_unref0 (_tmp206_);
	_tmp207_ = digitalstorage_category;
	_tmp208_ = unit_new ("bit", _ ("Bits"), g_dpgettext2 (NULL, "unit-format", "%s b"), "x/8", "8x", g_dpgettext2 (NULL, "unit-symbols", "bit,bits,b"));
	_tmp209_ = _tmp208_;
	unit_category_add_unit (_tmp207_, _tmp209_);
	_g_object_unref0 (_tmp209_);
	_tmp210_ = digitalstorage_category;
	_tmp211_ = unit_new ("byte", _ ("Bytes"), g_dpgettext2 (NULL, "unit-format", "%s B"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "byte,bytes,B"));
	_tmp212_ = _tmp211_;
	unit_category_add_unit (_tmp210_, _tmp212_);
	_g_object_unref0 (_tmp212_);
	_tmp213_ = digitalstorage_category;
	_tmp214_ = unit_new ("nibble", _ ("Nibbles"), g_dpgettext2 (NULL, "unit-format", "%s nibble"), "x/2", "2x", g_dpgettext2 (NULL, "unit-symbols", "nibble,nibbles"));
	_tmp215_ = _tmp214_;
	unit_category_add_unit (_tmp213_, _tmp215_);
	_g_object_unref0 (_tmp215_);
	_tmp216_ = digitalstorage_category;
	_tmp217_ = unit_new ("kilobit", _ ("Kilobits"), g_dpgettext2 (NULL, "unit-format", "%s kb"), "1000x/8", "8x/1000", g_dpgettext2 (NULL, "unit-symbols", "kilobit,kilobits,kb,Kb"));
	_tmp218_ = _tmp217_;
	unit_category_add_unit (_tmp216_, _tmp218_);
	_g_object_unref0 (_tmp218_);
	_tmp219_ = digitalstorage_category;
	_tmp220_ = unit_new ("kilobyte", _ ("Kilobytes"), g_dpgettext2 (NULL, "unit-format", "%s kB"), "1000x", "x/1000", g_dpgettext2 (NULL, "unit-symbols", "kilobyte,kilobytes,kB,KB"));
	_tmp221_ = _tmp220_;
	unit_category_add_unit (_tmp219_, _tmp221_);
	_g_object_unref0 (_tmp221_);
	_tmp222_ = digitalstorage_category;
	_tmp223_ = unit_new ("kibibit", _ ("Kibibits"), g_dpgettext2 (NULL, "unit-format", "%s Kib"), "1024x/8", "8x/1024", g_dpgettext2 (NULL, "unit-symbols", "kibibit,kibibits,Kib"));
	_tmp224_ = _tmp223_;
	unit_category_add_unit (_tmp222_, _tmp224_);
	_g_object_unref0 (_tmp224_);
	_tmp225_ = digitalstorage_category;
	_tmp226_ = unit_new ("kibibyte", _ ("Kibibytes"), g_dpgettext2 (NULL, "unit-format", "%s KiB"), "1024x", "x/1024", g_dpgettext2 (NULL, "unit-symbols", "kibibyte,kibibytes,KiB"));
	_tmp227_ = _tmp226_;
	unit_category_add_unit (_tmp225_, _tmp227_);
	_g_object_unref0 (_tmp227_);
	_tmp228_ = digitalstorage_category;
	_tmp229_ = unit_new ("megabit", _ ("Megabits"), g_dpgettext2 (NULL, "unit-format", "%s Mb"), "1000000x/8", "8x/1000000", g_dpgettext2 (NULL, "unit-symbols", "megabit,megabits,Mb"));
	_tmp230_ = _tmp229_;
	unit_category_add_unit (_tmp228_, _tmp230_);
	_g_object_unref0 (_tmp230_);
	_tmp231_ = digitalstorage_category;
	_tmp232_ = unit_new ("megabyte", _ ("Megabytes"), g_dpgettext2 (NULL, "unit-format", "%s MB"), "1000000x", "x/1000000", g_dpgettext2 (NULL, "unit-symbols", "megabyte,megabytes,MB"));
	_tmp233_ = _tmp232_;
	unit_category_add_unit (_tmp231_, _tmp233_);
	_g_object_unref0 (_tmp233_);
	_tmp234_ = digitalstorage_category;
	_tmp235_ = unit_new ("mebibit", _ ("Mebibits"), g_dpgettext2 (NULL, "unit-format", "%s Mib"), "1048576x/8", "8x/1048576", g_dpgettext2 (NULL, "unit-symbols", "mebibit,mebibits,Mib"));
	_tmp236_ = _tmp235_;
	unit_category_add_unit (_tmp234_, _tmp236_);
	_g_object_unref0 (_tmp236_);
	_tmp237_ = digitalstorage_category;
	_tmp238_ = unit_new ("mebibyte", _ ("Mebibytes"), g_dpgettext2 (NULL, "unit-format", "%s MiB"), "1048576x", "x/1048576", g_dpgettext2 (NULL, "unit-symbols", "mebibyte,mebibytes,MiB"));
	_tmp239_ = _tmp238_;
	unit_category_add_unit (_tmp237_, _tmp239_);
	_g_object_unref0 (_tmp239_);
	_tmp240_ = digitalstorage_category;
	_tmp241_ = unit_new ("gigabit", _ ("Gigabits"), g_dpgettext2 (NULL, "unit-format", "%s Gb"), "1000000000x/8", "8x/1000000000", g_dpgettext2 (NULL, "unit-symbols", "gigabit,gigabits,Gb"));
	_tmp242_ = _tmp241_;
	unit_category_add_unit (_tmp240_, _tmp242_);
	_g_object_unref0 (_tmp242_);
	_tmp243_ = digitalstorage_category;
	_tmp244_ = unit_new ("gigabyte", _ ("Gigabytes"), g_dpgettext2 (NULL, "unit-format", "%s GB"), "1000000000x", "x/1000000000", g_dpgettext2 (NULL, "unit-symbols", "gigabyte,gigabytes,GB"));
	_tmp245_ = _tmp244_;
	unit_category_add_unit (_tmp243_, _tmp245_);
	_g_object_unref0 (_tmp245_);
	_tmp246_ = digitalstorage_category;
	_tmp247_ = unit_new ("gibibit", _ ("Gibibits"), g_dpgettext2 (NULL, "unit-format", "%s Gib"), "1073741824x/8", "8x/1073741824", g_dpgettext2 (NULL, "unit-symbols", "gibibit,gibibits,Gib"));
	_tmp248_ = _tmp247_;
	unit_category_add_unit (_tmp246_, _tmp248_);
	_g_object_unref0 (_tmp248_);
	_tmp249_ = digitalstorage_category;
	_tmp250_ = unit_new ("gibibyte", _ ("Gibibytes"), g_dpgettext2 (NULL, "unit-format", "%s GiB"), "1073741824x", "x/1073741824", g_dpgettext2 (NULL, "unit-symbols", "gibibyte,gibibytes,GiB"));
	_tmp251_ = _tmp250_;
	unit_category_add_unit (_tmp249_, _tmp251_);
	_g_object_unref0 (_tmp251_);
	_tmp252_ = digitalstorage_category;
	_tmp253_ = unit_new ("terabit", _ ("Terabits"), g_dpgettext2 (NULL, "unit-format", "%s Tb"), "1000000000000x/8", "8x/1000000000000", g_dpgettext2 (NULL, "unit-symbols", "terabit,terabits,Tb"));
	_tmp254_ = _tmp253_;
	unit_category_add_unit (_tmp252_, _tmp254_);
	_g_object_unref0 (_tmp254_);
	_tmp255_ = digitalstorage_category;
	_tmp256_ = unit_new ("terabyte", _ ("Terabytes"), g_dpgettext2 (NULL, "unit-format", "%s TB"), "1000000000000x", "x/1000000000000", g_dpgettext2 (NULL, "unit-symbols", "terabyte,terabytes,TB"));
	_tmp257_ = _tmp256_;
	unit_category_add_unit (_tmp255_, _tmp257_);
	_g_object_unref0 (_tmp257_);
	_tmp258_ = digitalstorage_category;
	_tmp259_ = unit_new ("tebibit", _ ("Tebibits"), g_dpgettext2 (NULL, "unit-format", "%s Tib"), "1099511627776x/8", "8x/1099511627776", g_dpgettext2 (NULL, "unit-symbols", "tebibit,tebibits,Tib"));
	_tmp260_ = _tmp259_;
	unit_category_add_unit (_tmp258_, _tmp260_);
	_g_object_unref0 (_tmp260_);
	_tmp261_ = digitalstorage_category;
	_tmp262_ = unit_new ("tebibyte", _ ("Tebibytes"), g_dpgettext2 (NULL, "unit-format", "%s TiB"), "1099511627776x", "x/1099511627776", g_dpgettext2 (NULL, "unit-symbols", "tebibyte,tebibytes,TiB"));
	_tmp263_ = _tmp262_;
	unit_category_add_unit (_tmp261_, _tmp263_);
	_g_object_unref0 (_tmp263_);
	_tmp264_ = digitalstorage_category;
	_tmp265_ = unit_new ("petabit", _ ("Petabits"), g_dpgettext2 (NULL, "unit-format", "%s Pb"), "1000000000000000x/8", "8x/1000000000000000", g_dpgettext2 (NULL, "unit-symbols", "petabit,petabits,Pb"));
	_tmp266_ = _tmp265_;
	unit_category_add_unit (_tmp264_, _tmp266_);
	_g_object_unref0 (_tmp266_);
	_tmp267_ = digitalstorage_category;
	_tmp268_ = unit_new ("petabyte", _ ("Petabytes"), g_dpgettext2 (NULL, "unit-format", "%s PB"), "1000000000000000x", "x/1000000000000000", g_dpgettext2 (NULL, "unit-symbols", "petabyte,petabytes,PB"));
	_tmp269_ = _tmp268_;
	unit_category_add_unit (_tmp267_, _tmp269_);
	_g_object_unref0 (_tmp269_);
	_tmp270_ = digitalstorage_category;
	_tmp271_ = unit_new ("pebibit", _ ("Pebibits"), g_dpgettext2 (NULL, "unit-format", "%s Pib"), "1125899906842624x/8", "8x/1125899906842624", g_dpgettext2 (NULL, "unit-symbols", "pebibit,pebibits,Pib"));
	_tmp272_ = _tmp271_;
	unit_category_add_unit (_tmp270_, _tmp272_);
	_g_object_unref0 (_tmp272_);
	_tmp273_ = digitalstorage_category;
	_tmp274_ = unit_new ("pebibyte", _ ("Pebibytes"), g_dpgettext2 (NULL, "unit-format", "%s PiB"), "1125899906842624x", "x/1125899906842624", g_dpgettext2 (NULL, "unit-symbols", "pebibyte,pebibytes,PiB"));
	_tmp275_ = _tmp274_;
	unit_category_add_unit (_tmp273_, _tmp275_);
	_g_object_unref0 (_tmp275_);
	_tmp276_ = digitalstorage_category;
	_tmp277_ = unit_new ("exabit", _ ("Exabits"), g_dpgettext2 (NULL, "unit-format", "%s Eb"), "1000000000000000000x/8", "8x/1000000000000000000", g_dpgettext2 (NULL, "unit-symbols", "exabit,exabits,Eb"));
	_tmp278_ = _tmp277_;
	unit_category_add_unit (_tmp276_, _tmp278_);
	_g_object_unref0 (_tmp278_);
	_tmp279_ = digitalstorage_category;
	_tmp280_ = unit_new ("exabyte", _ ("Exabytes"), g_dpgettext2 (NULL, "unit-format", "%s EB"), "1000000000000000000x", "x/1000000000000000000", g_dpgettext2 (NULL, "unit-symbols", "exabyte,exabytes,EB"));
	_tmp281_ = _tmp280_;
	unit_category_add_unit (_tmp279_, _tmp281_);
	_g_object_unref0 (_tmp281_);
	_tmp282_ = digitalstorage_category;
	_tmp283_ = unit_new ("exbibit", _ ("Exbibits"), g_dpgettext2 (NULL, "unit-format", "%s Eib"), "1152921504606846976x/8", "8x/1152921504606846976", g_dpgettext2 (NULL, "unit-symbols", "exbibit,exbibits,Eib"));
	_tmp284_ = _tmp283_;
	unit_category_add_unit (_tmp282_, _tmp284_);
	_g_object_unref0 (_tmp284_);
	_tmp285_ = digitalstorage_category;
	_tmp286_ = unit_new ("exbibyte", _ ("Exbibytes"), g_dpgettext2 (NULL, "unit-format", "%s EiB"), "1152921504606846976x", "x/1152921504606846976", g_dpgettext2 (NULL, "unit-symbols", "exbibyte,exbibytes,EiB"));
	_tmp287_ = _tmp286_;
	unit_category_add_unit (_tmp285_, _tmp287_);
	_g_object_unref0 (_tmp287_);
	_tmp288_ = digitalstorage_category;
	_tmp289_ = unit_new ("zettabit", _ ("Zettabits"), g_dpgettext2 (NULL, "unit-format", "%s Eb"), "1000000000000000000000x/8", "8x/1000000000000000000000", g_dpgettext2 (NULL, "unit-symbols", "zettabit,zettabits,Zb"));
	_tmp290_ = _tmp289_;
	unit_category_add_unit (_tmp288_, _tmp290_);
	_g_object_unref0 (_tmp290_);
	_tmp291_ = digitalstorage_category;
	_tmp292_ = unit_new ("zettabyte", _ ("Zettabytes"), g_dpgettext2 (NULL, "unit-format", "%s EB"), "1000000000000000000000x", "x/1000000000000000000000", g_dpgettext2 (NULL, "unit-symbols", "zettabyte,zettabytes,ZB"));
	_tmp293_ = _tmp292_;
	unit_category_add_unit (_tmp291_, _tmp293_);
	_g_object_unref0 (_tmp293_);
	_tmp294_ = digitalstorage_category;
	_tmp295_ = unit_new ("zebibit", _ ("Zebibits"), g_dpgettext2 (NULL, "unit-format", "%s Zib"), "1180591620717411303424x/8", "8x/1180591620717411303424", g_dpgettext2 (NULL, "unit-symbols", "zebibit,zebibits,Zib"));
	_tmp296_ = _tmp295_;
	unit_category_add_unit (_tmp294_, _tmp296_);
	_g_object_unref0 (_tmp296_);
	_tmp297_ = digitalstorage_category;
	_tmp298_ = unit_new ("zebibyte", _ ("Zebibytes"), g_dpgettext2 (NULL, "unit-format", "%s ZiB"), "1180591620717411303424x", "x/1180591620717411303424", g_dpgettext2 (NULL, "unit-symbols", "zebibyte,zebibytes,ZiB"));
	_tmp299_ = _tmp298_;
	unit_category_add_unit (_tmp297_, _tmp299_);
	_g_object_unref0 (_tmp299_);
	_tmp300_ = digitalstorage_category;
	_tmp301_ = unit_new ("yottabit", _ ("Yottabits"), g_dpgettext2 (NULL, "unit-format", "%s Yb"), "1000000000000000000000000x/8", "8x/1000000000000000000000000", g_dpgettext2 (NULL, "unit-symbols", "yottabit,yottabits,Yb"));
	_tmp302_ = _tmp301_;
	unit_category_add_unit (_tmp300_, _tmp302_);
	_g_object_unref0 (_tmp302_);
	_tmp303_ = digitalstorage_category;
	_tmp304_ = unit_new ("yottabyte", _ ("Yottabytes"), g_dpgettext2 (NULL, "unit-format", "%s YB"), "1000000000000000000000000x", "x/1000000000000000000000000", g_dpgettext2 (NULL, "unit-symbols", "yottabyte,yottabytes,YB"));
	_tmp305_ = _tmp304_;
	unit_category_add_unit (_tmp303_, _tmp305_);
	_g_object_unref0 (_tmp305_);
	_tmp306_ = digitalstorage_category;
	_tmp307_ = unit_new ("yobibit", _ ("Yobibits"), g_dpgettext2 (NULL, "unit-format", "%s Yib"), "1208925819614629174706176x/8", "8x/1208925819614629174706176", g_dpgettext2 (NULL, "unit-symbols", "yobibit,yobibits,Yib"));
	_tmp308_ = _tmp307_;
	unit_category_add_unit (_tmp306_, _tmp308_);
	_g_object_unref0 (_tmp308_);
	_tmp309_ = digitalstorage_category;
	_tmp310_ = unit_new ("yobibyte", _ ("Yobibytes"), g_dpgettext2 (NULL, "unit-format", "%s YiB"), "1208925819614629174706176x", "x/1208925819614629174706176", g_dpgettext2 (NULL, "unit-symbols", "yobibyte,yobibytes,YiB"));
	_tmp311_ = _tmp310_;
	unit_category_add_unit (_tmp309_, _tmp311_);
	_g_object_unref0 (_tmp311_);
	_tmp312_ = frequency_category;
	_tmp313_ = unit_new ("hertz", _ ("Hertz"), g_dpgettext2 (NULL, "unit-format", "%s Hz"), "x", "x", g_dpgettext2 (NULL, "unit-symbols", "hertz,Hz"));
	_tmp314_ = _tmp313_;
	unit_category_add_unit (_tmp312_, _tmp314_);
	_g_object_unref0 (_tmp314_);
	_tmp315_ = frequency_category;
	_tmp316_ = unit_new ("kilohertz", _ ("Kilohertz"), g_dpgettext2 (NULL, "unit-format", "%s kHz"), "1000x", "x/1000", g_dpgettext2 (NULL, "unit-symbols", "kilohertz,kHz"));
	_tmp317_ = _tmp316_;
	unit_category_add_unit (_tmp315_, _tmp317_);
	_g_object_unref0 (_tmp317_);
	_tmp318_ = frequency_category;
	_tmp319_ = unit_new ("megahertz", _ ("Megahertz"), g_dpgettext2 (NULL, "unit-format", "%s MHz"), "1000000x", "x/1000000", g_dpgettext2 (NULL, "unit-symbols", "megahertz,MHz"));
	_tmp320_ = _tmp319_;
	unit_category_add_unit (_tmp318_, _tmp320_);
	_g_object_unref0 (_tmp320_);
	_tmp321_ = frequency_category;
	_tmp322_ = unit_new ("gigahertz", _ ("Gigahertz"), g_dpgettext2 (NULL, "unit-format", "%s GHz"), "1000000000x", "x/1000000000", g_dpgettext2 (NULL, "unit-symbols", "gigahertz,GHz"));
	_tmp323_ = _tmp322_;
	unit_category_add_unit (_tmp321_, _tmp323_);
	_g_object_unref0 (_tmp323_);
	_tmp324_ = frequency_category;
	_tmp325_ = unit_new ("terahertz", _ ("Terahertz"), g_dpgettext2 (NULL, "unit-format", "%s THz"), "1000000000000x", "x/1000000000000", g_dpgettext2 (NULL, "unit-symbols", "terahertz,THz"));
	_tmp326_ = _tmp325_;
	unit_category_add_unit (_tmp324_, _tmp326_);
	_g_object_unref0 (_tmp326_);
	_tmp327_ = default_unit_manager;
	_tmp328_ = unit_manager_add_category (_tmp327_, "currency", _ ("Currency"));
	currency_category = _tmp328_;
	_tmp329_ = currency_manager_get_default (TRUE, TRUE);
	_tmp330_ = _tmp329_;
	_tmp331_ = currency_manager_get_currencies (_tmp330_);
	_tmp332_ = _tmp331_;
	_g_object_unref0 (_tmp330_);
	currencies = _tmp332_;
	currencies = g_list_sort (currencies, ___lambda10__gcompare_func);
	_tmp333_ = currencies;
	{
		GList* currency_collection = NULL;
		GList* currency_it = NULL;
		currency_collection = _tmp333_;
		for (currency_it = currency_collection; currency_it != NULL; currency_it = currency_it->next) {
			Currency* _tmp334_;
			Currency* currency = NULL;
			_tmp334_ = _g_object_ref0 ((Currency*) currency_it->data);
			currency = _tmp334_;
			{
				gchar* format = NULL;
				Currency* _tmp335_;
				gchar* _tmp336_;
				gchar* _tmp337_;
				gchar* _tmp338_;
				gchar* _tmp339_;
				gchar* _tmp340_;
				Unit* unit = NULL;
				Currency* _tmp341_;
				gchar* _tmp342_;
				gchar* _tmp343_;
				gchar* _tmp344_;
				Currency* _tmp345_;
				gchar* _tmp346_;
				gchar* _tmp347_;
				gchar* _tmp348_;
				const gchar* _tmp349_;
				Currency* _tmp350_;
				gchar* _tmp351_;
				gchar* _tmp352_;
				gchar* _tmp353_;
				Unit* _tmp354_;
				Unit* _tmp355_;
				UnitCategory* _tmp356_;
				Unit* _tmp357_;
				_tmp335_ = currency;
				_tmp336_ = currency_get_symbol (_tmp335_);
				_tmp337_ = _tmp336_;
				_tmp338_ = _tmp337_;
				_tmp339_ = g_strdup_printf (_ ("%s%%s"), _tmp338_);
				_tmp340_ = _tmp339_;
				_g_free0 (_tmp338_);
				format = _tmp340_;
				_tmp341_ = currency;
				_tmp342_ = currency_get_name (_tmp341_);
				_tmp343_ = _tmp342_;
				_tmp344_ = _tmp343_;
				_tmp345_ = currency;
				_tmp346_ = currency_get_display_name (_tmp345_);
				_tmp347_ = _tmp346_;
				_tmp348_ = _tmp347_;
				_tmp349_ = format;
				_tmp350_ = currency;
				_tmp351_ = currency_get_name (_tmp350_);
				_tmp352_ = _tmp351_;
				_tmp353_ = _tmp352_;
				_tmp354_ = unit_new (_tmp344_, _tmp348_, _tmp349_, NULL, NULL, _tmp353_);
				_tmp355_ = _tmp354_;
				_g_free0 (_tmp353_);
				_g_free0 (_tmp348_);
				_g_free0 (_tmp344_);
				unit = _tmp355_;
				_tmp356_ = currency_category;
				_tmp357_ = unit;
				unit_category_add_unit (_tmp356_, _tmp357_);
				_g_object_unref0 (unit);
				_g_free0 (format);
				_g_object_unref0 (currency);
			}
		}
	}
	_tmp358_ = default_unit_manager;
	_tmp359_ = _g_object_ref0 (_tmp358_);
	result = _tmp359_;
	(currencies == NULL) ? NULL : (currencies = (_g_list_free__g_object_unref0_ (currencies), NULL));
	_g_object_unref0 (currency_category);
	_g_object_unref0 (digitalstorage_category);
	_g_object_unref0 (temperature_category);
	_g_object_unref0 (frequency_category);
	_g_object_unref0 (duration_category);
	_g_object_unref0 (weight_category);
	_g_object_unref0 (volume_category);
	_g_object_unref0 (area_category);
	_g_object_unref0 (speed_category);
	_g_object_unref0 (length_category);
	_g_object_unref0 (angle_category);
	return result;
}

UnitCategory*
unit_manager_add_category (UnitManager* self,
                           const gchar* name,
                           const gchar* display_name)
{
	UnitCategory* category = NULL;
	UnitCategory* _tmp0_;
	UnitCategory* _tmp1_;
	UnitCategory* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (display_name != NULL, NULL);
	_tmp0_ = unit_category_new (name, display_name);
	category = _tmp0_;
	_tmp1_ = _g_object_ref0 (category);
	self->priv->categories = g_list_append (self->priv->categories, _tmp1_);
	result = category;
	return result;
}

GList*
unit_manager_get_categories (UnitManager* self)
{
	GList* r = NULL;
	GList* _tmp0_;
	GList* result;
	g_return_val_if_fail (self != NULL, NULL);
	r = NULL;
	_tmp0_ = self->priv->categories;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp0_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			UnitCategory* _tmp1_;
			UnitCategory* c = NULL;
			_tmp1_ = _g_object_ref0 ((UnitCategory*) c_it->data);
			c = _tmp1_;
			{
				UnitCategory* _tmp2_;
				UnitCategory* _tmp3_;
				_tmp2_ = c;
				_tmp3_ = _g_object_ref0 (_tmp2_);
				r = g_list_append (r, _tmp3_);
				_g_object_unref0 (c);
			}
		}
	}
	result = r;
	return result;
}

UnitCategory*
unit_manager_get_category (UnitManager* self,
                           const gchar* category)
{
	GList* _tmp0_;
	UnitCategory* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (category != NULL, NULL);
	_tmp0_ = self->priv->categories;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp0_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			UnitCategory* _tmp1_;
			UnitCategory* c = NULL;
			_tmp1_ = _g_object_ref0 ((UnitCategory*) c_it->data);
			c = _tmp1_;
			{
				UnitCategory* _tmp2_;
				gchar* _tmp3_;
				gchar* _tmp4_;
				gchar* _tmp5_;
				gboolean _tmp6_;
				_tmp2_ = c;
				_tmp3_ = unit_category_get_name (_tmp2_);
				_tmp4_ = _tmp3_;
				_tmp5_ = _tmp4_;
				_tmp6_ = g_strcmp0 (_tmp5_, category) == 0;
				_g_free0 (_tmp5_);
				if (_tmp6_) {
					result = c;
					return result;
				}
				_g_object_unref0 (c);
			}
		}
	}
	result = NULL;
	return result;
}

Unit*
unit_manager_get_unit_by_name (UnitManager* self,
                               const gchar* name)
{
	gint count = 0;
	Unit* return_unit = NULL;
	GList* _tmp0_;
	GList* _tmp8_;
	Unit* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	count = 0;
	return_unit = NULL;
	_tmp0_ = self->priv->categories;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp0_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			UnitCategory* _tmp1_;
			UnitCategory* c = NULL;
			_tmp1_ = _g_object_ref0 ((UnitCategory*) c_it->data);
			c = _tmp1_;
			{
				Unit* u = NULL;
				UnitCategory* _tmp2_;
				Unit* _tmp3_;
				Unit* _tmp4_;
				_tmp2_ = c;
				_tmp3_ = unit_category_get_unit_by_name (_tmp2_, name, TRUE);
				u = _tmp3_;
				_tmp4_ = u;
				if (_tmp4_ != NULL) {
					Unit* _tmp5_;
					Unit* _tmp6_;
					gint _tmp7_;
					_tmp5_ = u;
					_tmp6_ = _g_object_ref0 (_tmp5_);
					_g_object_unref0 (return_unit);
					return_unit = _tmp6_;
					_tmp7_ = count;
					count = _tmp7_ + 1;
				}
				_g_object_unref0 (u);
				_g_object_unref0 (c);
			}
		}
	}
	if (count > 1) {
		result = NULL;
		_g_object_unref0 (return_unit);
		return result;
	} else {
		if (count == 1) {
			result = return_unit;
			return result;
		}
	}
	_tmp8_ = self->priv->categories;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp8_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			UnitCategory* _tmp9_;
			UnitCategory* c = NULL;
			_tmp9_ = _g_object_ref0 ((UnitCategory*) c_it->data);
			c = _tmp9_;
			{
				Unit* u = NULL;
				UnitCategory* _tmp10_;
				Unit* _tmp11_;
				Unit* _tmp12_;
				_tmp10_ = c;
				_tmp11_ = unit_category_get_unit_by_name (_tmp10_, name, FALSE);
				u = _tmp11_;
				_tmp12_ = u;
				if (_tmp12_ != NULL) {
					Unit* _tmp13_;
					Unit* _tmp14_;
					gint _tmp15_;
					_tmp13_ = u;
					_tmp14_ = _g_object_ref0 (_tmp13_);
					_g_object_unref0 (return_unit);
					return_unit = _tmp14_;
					_tmp15_ = count;
					count = _tmp15_ + 1;
				}
				_g_object_unref0 (u);
				_g_object_unref0 (c);
			}
		}
	}
	if (count == 1) {
		result = return_unit;
		return result;
	}
	result = NULL;
	_g_object_unref0 (return_unit);
	return result;
}

Unit*
unit_manager_get_unit_by_symbol (UnitManager* self,
                                 const gchar* symbol)
{
	gint count = 0;
	Unit* return_unit = NULL;
	GList* _tmp0_;
	GList* _tmp8_;
	Unit* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (symbol != NULL, NULL);
	count = 0;
	return_unit = NULL;
	_tmp0_ = self->priv->categories;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp0_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			UnitCategory* _tmp1_;
			UnitCategory* c = NULL;
			_tmp1_ = _g_object_ref0 ((UnitCategory*) c_it->data);
			c = _tmp1_;
			{
				Unit* u = NULL;
				UnitCategory* _tmp2_;
				Unit* _tmp3_;
				Unit* _tmp4_;
				_tmp2_ = c;
				_tmp3_ = unit_category_get_unit_by_symbol (_tmp2_, symbol, TRUE);
				u = _tmp3_;
				_tmp4_ = u;
				if (_tmp4_ != NULL) {
					Unit* _tmp5_;
					Unit* _tmp6_;
					gint _tmp7_;
					_tmp5_ = u;
					_tmp6_ = _g_object_ref0 (_tmp5_);
					_g_object_unref0 (return_unit);
					return_unit = _tmp6_;
					_tmp7_ = count;
					count = _tmp7_ + 1;
				}
				_g_object_unref0 (u);
				_g_object_unref0 (c);
			}
		}
	}
	if (count > 1) {
		result = NULL;
		_g_object_unref0 (return_unit);
		return result;
	} else {
		if (count == 1) {
			result = return_unit;
			return result;
		}
	}
	_tmp8_ = self->priv->categories;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp8_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			UnitCategory* _tmp9_;
			UnitCategory* c = NULL;
			_tmp9_ = _g_object_ref0 ((UnitCategory*) c_it->data);
			c = _tmp9_;
			{
				Unit* u = NULL;
				UnitCategory* _tmp10_;
				Unit* _tmp11_;
				Unit* _tmp12_;
				_tmp10_ = c;
				_tmp11_ = unit_category_get_unit_by_symbol (_tmp10_, symbol, FALSE);
				u = _tmp11_;
				_tmp12_ = u;
				if (_tmp12_ != NULL) {
					Unit* _tmp13_;
					Unit* _tmp14_;
					gint _tmp15_;
					_tmp13_ = u;
					_tmp14_ = _g_object_ref0 (_tmp13_);
					_g_object_unref0 (return_unit);
					return_unit = _tmp14_;
					_tmp15_ = count;
					count = _tmp15_ + 1;
				}
				_g_object_unref0 (u);
				_g_object_unref0 (c);
			}
		}
	}
	if (count == 1) {
		result = return_unit;
		return result;
	}
	result = NULL;
	_g_object_unref0 (return_unit);
	return result;
}

gboolean
unit_manager_unit_is_defined (UnitManager* self,
                              const gchar* name)
{
	Unit* unit = NULL;
	Unit* _tmp0_;
	Unit* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (name != NULL, FALSE);
	_tmp0_ = unit_manager_get_unit_by_symbol (self, name);
	unit = _tmp0_;
	_tmp1_ = unit;
	if (_tmp1_ != NULL) {
		result = TRUE;
		_g_object_unref0 (unit);
		return result;
	} else {
		result = FALSE;
		_g_object_unref0 (unit);
		return result;
	}
}

Number*
unit_manager_convert_by_symbol (UnitManager* self,
                                Number* x,
                                const gchar* x_symbol,
                                const gchar* z_symbol)
{
	GList* _tmp0_;
	Number* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (x != NULL, NULL);
	g_return_val_if_fail (x_symbol != NULL, NULL);
	g_return_val_if_fail (z_symbol != NULL, NULL);
	_tmp0_ = self->priv->categories;
	{
		GList* c_collection = NULL;
		GList* c_it = NULL;
		c_collection = _tmp0_;
		for (c_it = c_collection; c_it != NULL; c_it = c_it->next) {
			UnitCategory* _tmp1_;
			UnitCategory* c = NULL;
			_tmp1_ = _g_object_ref0 ((UnitCategory*) c_it->data);
			c = _tmp1_;
			{
				Unit* x_units = NULL;
				UnitCategory* _tmp2_;
				Unit* _tmp3_;
				Unit* _tmp4_;
				Unit* z_units = NULL;
				UnitCategory* _tmp7_;
				Unit* _tmp8_;
				Unit* _tmp9_;
				gboolean _tmp12_ = FALSE;
				Unit* _tmp13_;
				_tmp2_ = c;
				_tmp3_ = unit_category_get_unit_by_symbol (_tmp2_, x_symbol, TRUE);
				x_units = _tmp3_;
				_tmp4_ = x_units;
				if (_tmp4_ == NULL) {
					UnitCategory* _tmp5_;
					Unit* _tmp6_;
					_tmp5_ = c;
					_tmp6_ = unit_category_get_unit_by_symbol (_tmp5_, x_symbol, FALSE);
					_g_object_unref0 (x_units);
					x_units = _tmp6_;
				}
				_tmp7_ = c;
				_tmp8_ = unit_category_get_unit_by_symbol (_tmp7_, z_symbol, TRUE);
				z_units = _tmp8_;
				_tmp9_ = z_units;
				if (_tmp9_ == NULL) {
					UnitCategory* _tmp10_;
					Unit* _tmp11_;
					_tmp10_ = c;
					_tmp11_ = unit_category_get_unit_by_symbol (_tmp10_, z_symbol, FALSE);
					_g_object_unref0 (z_units);
					z_units = _tmp11_;
				}
				_tmp13_ = x_units;
				if (_tmp13_ != NULL) {
					Unit* _tmp14_;
					_tmp14_ = z_units;
					_tmp12_ = _tmp14_ != NULL;
				} else {
					_tmp12_ = FALSE;
				}
				if (_tmp12_) {
					UnitCategory* _tmp15_;
					Unit* _tmp16_;
					Unit* _tmp17_;
					Number* _tmp18_;
					_tmp15_ = c;
					_tmp16_ = x_units;
					_tmp17_ = z_units;
					_tmp18_ = unit_category_convert (_tmp15_, x, _tmp16_, _tmp17_);
					result = _tmp18_;
					_g_object_unref0 (z_units);
					_g_object_unref0 (x_units);
					_g_object_unref0 (c);
					return result;
				}
				_g_object_unref0 (z_units);
				_g_object_unref0 (x_units);
				_g_object_unref0 (c);
			}
		}
	}
	result = NULL;
	return result;
}

static void
unit_manager_class_init (UnitManagerClass * klass,
                         gpointer klass_data)
{
	unit_manager_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &UnitManager_private_offset);
	G_OBJECT_CLASS (klass)->finalize = unit_manager_finalize;
}

static void
unit_manager_instance_init (UnitManager * self,
                            gpointer klass)
{
	self->priv = unit_manager_get_instance_private (self);
}

static void
unit_manager_finalize (GObject * obj)
{
	UnitManager * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_UNIT_MANAGER, UnitManager);
	(self->priv->categories == NULL) ? NULL : (self->priv->categories = (_g_list_free__g_object_unref0_ (self->priv->categories), NULL));
	G_OBJECT_CLASS (unit_manager_parent_class)->finalize (obj);
}

static GType
unit_manager_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UnitManagerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unit_manager_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnitManager), 0, (GInstanceInitFunc) unit_manager_instance_init, NULL };
	GType unit_manager_type_id;
	unit_manager_type_id = g_type_register_static (G_TYPE_OBJECT, "UnitManager", &g_define_type_info, 0);
	UnitManager_private_offset = g_type_add_instance_private (unit_manager_type_id, sizeof (UnitManagerPrivate));
	return unit_manager_type_id;
}

GType
unit_manager_get_type (void)
{
	static volatile gsize unit_manager_type_id__once = 0;
	if (g_once_init_enter (&unit_manager_type_id__once)) {
		GType unit_manager_type_id;
		unit_manager_type_id = unit_manager_get_type_once ();
		g_once_init_leave (&unit_manager_type_id__once, unit_manager_type_id);
	}
	return unit_manager_type_id__once;
}

static inline gpointer
unit_category_get_instance_private (UnitCategory* self)
{
	return G_STRUCT_MEMBER_P (self, UnitCategory_private_offset);
}

UnitCategory*
unit_category_construct (GType object_type,
                         const gchar* name,
                         const gchar* display_name)
{
	UnitCategory * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (display_name != NULL, NULL);
	self = (UnitCategory*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (name);
	_g_free0 (self->priv->_name);
	self->priv->_name = _tmp0_;
	_tmp1_ = g_strdup (display_name);
	_g_free0 (self->priv->_display_name);
	self->priv->_display_name = _tmp1_;
	(self->priv->units == NULL) ? NULL : (self->priv->units = (_g_list_free__g_object_unref0_ (self->priv->units), NULL));
	self->priv->units = NULL;
	return self;
}

UnitCategory*
unit_category_new (const gchar* name,
                   const gchar* display_name)
{
	return unit_category_construct (TYPE_UNIT_CATEGORY, name, display_name);
}

void
unit_category_add_unit (UnitCategory* self,
                        Unit* unit)
{
	Unit* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (unit != NULL);
	_tmp0_ = _g_object_ref0 (unit);
	self->priv->units = g_list_append (self->priv->units, _tmp0_);
}

Unit*
unit_category_get_unit_by_name (UnitCategory* self,
                                const gchar* name,
                                gboolean case_sensitive)
{
	gint count = 0;
	Unit* return_unit = NULL;
	GList* _tmp0_;
	Unit* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	count = 0;
	return_unit = NULL;
	_tmp0_ = self->priv->units;
	{
		GList* unit_collection = NULL;
		GList* unit_it = NULL;
		unit_collection = _tmp0_;
		for (unit_it = unit_collection; unit_it != NULL; unit_it = unit_it->next) {
			Unit* _tmp1_;
			Unit* unit = NULL;
			_tmp1_ = _g_object_ref0 ((Unit*) unit_it->data);
			unit = _tmp1_;
			{
				gboolean _tmp2_ = FALSE;
				gboolean _tmp3_ = FALSE;
				if (case_sensitive) {
					Unit* _tmp4_;
					gchar* _tmp5_;
					gchar* _tmp6_;
					gchar* _tmp7_;
					_tmp4_ = unit;
					_tmp5_ = unit_get_name (_tmp4_);
					_tmp6_ = _tmp5_;
					_tmp7_ = _tmp6_;
					_tmp3_ = g_strcmp0 (_tmp7_, name) == 0;
					_g_free0 (_tmp7_);
				} else {
					_tmp3_ = FALSE;
				}
				if (_tmp3_) {
					_tmp2_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (!case_sensitive) {
						Unit* _tmp9_;
						gchar* _tmp10_;
						gchar* _tmp11_;
						gchar* _tmp12_;
						gchar* _tmp13_;
						gchar* _tmp14_;
						gchar* _tmp15_;
						gchar* _tmp16_;
						_tmp9_ = unit;
						_tmp10_ = unit_get_name (_tmp9_);
						_tmp11_ = _tmp10_;
						_tmp12_ = _tmp11_;
						_tmp13_ = g_utf8_strdown (_tmp12_, (gssize) -1);
						_tmp14_ = _tmp13_;
						_tmp15_ = g_utf8_strdown (name, (gssize) -1);
						_tmp16_ = _tmp15_;
						_tmp8_ = g_strcmp0 (_tmp14_, _tmp16_) == 0;
						_g_free0 (_tmp16_);
						_g_free0 (_tmp14_);
						_g_free0 (_tmp12_);
					} else {
						_tmp8_ = FALSE;
					}
					_tmp2_ = _tmp8_;
				}
				if (_tmp2_) {
					Unit* _tmp17_;
					Unit* _tmp18_;
					gint _tmp19_;
					_tmp17_ = unit;
					_tmp18_ = _g_object_ref0 (_tmp17_);
					_g_object_unref0 (return_unit);
					return_unit = _tmp18_;
					_tmp19_ = count;
					count = _tmp19_ + 1;
				}
				_g_object_unref0 (unit);
			}
		}
	}
	if (count == 1) {
		result = return_unit;
		return result;
	}
	result = NULL;
	_g_object_unref0 (return_unit);
	return result;
}

Unit*
unit_category_get_unit_by_symbol (UnitCategory* self,
                                  const gchar* symbol,
                                  gboolean case_sensitive)
{
	gint count = 0;
	Unit* return_unit = NULL;
	GList* _tmp0_;
	GList* _tmp6_;
	Unit* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (symbol != NULL, NULL);
	count = 0;
	return_unit = NULL;
	_tmp0_ = self->priv->units;
	{
		GList* unit_collection = NULL;
		GList* unit_it = NULL;
		unit_collection = _tmp0_;
		for (unit_it = unit_collection; unit_it != NULL; unit_it = unit_it->next) {
			Unit* _tmp1_;
			Unit* unit = NULL;
			_tmp1_ = _g_object_ref0 ((Unit*) unit_it->data);
			unit = _tmp1_;
			{
				Unit* _tmp2_;
				_tmp2_ = unit;
				if (unit_matches_symbol (_tmp2_, symbol, TRUE)) {
					Unit* _tmp3_;
					Unit* _tmp4_;
					gint _tmp5_;
					_tmp3_ = unit;
					_tmp4_ = _g_object_ref0 (_tmp3_);
					_g_object_unref0 (return_unit);
					return_unit = _tmp4_;
					_tmp5_ = count;
					count = _tmp5_ + 1;
				}
				_g_object_unref0 (unit);
			}
		}
	}
	if (count > 1) {
		result = NULL;
		_g_object_unref0 (return_unit);
		return result;
	} else {
		if (count == 1) {
			result = return_unit;
			return result;
		}
	}
	_tmp6_ = self->priv->units;
	{
		GList* unit_collection = NULL;
		GList* unit_it = NULL;
		unit_collection = _tmp6_;
		for (unit_it = unit_collection; unit_it != NULL; unit_it = unit_it->next) {
			Unit* _tmp7_;
			Unit* unit = NULL;
			_tmp7_ = _g_object_ref0 ((Unit*) unit_it->data);
			unit = _tmp7_;
			{
				Unit* _tmp8_;
				_tmp8_ = unit;
				if (unit_matches_symbol (_tmp8_, symbol, FALSE)) {
					Unit* _tmp9_;
					Unit* _tmp10_;
					gint _tmp11_;
					_tmp9_ = unit;
					_tmp10_ = _g_object_ref0 (_tmp9_);
					_g_object_unref0 (return_unit);
					return_unit = _tmp10_;
					_tmp11_ = count;
					count = _tmp11_ + 1;
				}
				_g_object_unref0 (unit);
			}
		}
	}
	if (count == 1) {
		result = return_unit;
		return result;
	}
	result = NULL;
	_g_object_unref0 (return_unit);
	return result;
}

GList*
unit_category_get_units (UnitCategory* self)
{
	GList* _tmp0_;
	GList* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->units;
	result = _tmp0_;
	return result;
}

Number*
unit_category_convert (UnitCategory* self,
                       Number* x,
                       Unit* x_units,
                       Unit* z_units)
{
	Number* t = NULL;
	Number* _tmp0_;
	Number* _tmp1_;
	Number* _tmp2_;
	Number* _tmp3_;
	Number* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (x != NULL, NULL);
	g_return_val_if_fail (x_units != NULL, NULL);
	g_return_val_if_fail (z_units != NULL, NULL);
	_tmp0_ = unit_convert_from (x_units, x);
	t = _tmp0_;
	_tmp1_ = t;
	if (_tmp1_ == NULL) {
		result = NULL;
		_g_object_unref0 (t);
		return result;
	}
	_tmp2_ = t;
	_tmp3_ = unit_convert_to (z_units, _tmp2_);
	result = _tmp3_;
	_g_object_unref0 (t);
	return result;
}

gchar*
unit_category_get_name (UnitCategory* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
unit_category_get_display_name (UnitCategory* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
unit_category_class_init (UnitCategoryClass * klass,
                          gpointer klass_data)
{
	unit_category_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &UnitCategory_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_unit_category_get_property;
	G_OBJECT_CLASS (klass)->finalize = unit_category_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), UNIT_CATEGORY_NAME_PROPERTY, unit_category_properties[UNIT_CATEGORY_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), UNIT_CATEGORY_DISPLAY_NAME_PROPERTY, unit_category_properties[UNIT_CATEGORY_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
unit_category_instance_init (UnitCategory * self,
                             gpointer klass)
{
	self->priv = unit_category_get_instance_private (self);
}

static void
unit_category_finalize (GObject * obj)
{
	UnitCategory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_UNIT_CATEGORY, UnitCategory);
	(self->priv->units == NULL) ? NULL : (self->priv->units = (_g_list_free__g_object_unref0_ (self->priv->units), NULL));
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_display_name);
	G_OBJECT_CLASS (unit_category_parent_class)->finalize (obj);
}

static GType
unit_category_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UnitCategoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unit_category_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnitCategory), 0, (GInstanceInitFunc) unit_category_instance_init, NULL };
	GType unit_category_type_id;
	unit_category_type_id = g_type_register_static (G_TYPE_OBJECT, "UnitCategory", &g_define_type_info, 0);
	UnitCategory_private_offset = g_type_add_instance_private (unit_category_type_id, sizeof (UnitCategoryPrivate));
	return unit_category_type_id;
}

GType
unit_category_get_type (void)
{
	static volatile gsize unit_category_type_id__once = 0;
	if (g_once_init_enter (&unit_category_type_id__once)) {
		GType unit_category_type_id;
		unit_category_type_id = unit_category_get_type_once ();
		g_once_init_leave (&unit_category_type_id__once, unit_category_type_id);
	}
	return unit_category_type_id__once;
}

static void
_vala_unit_category_get_property (GObject * object,
                                  guint property_id,
                                  GValue * value,
                                  GParamSpec * pspec)
{
	UnitCategory * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_UNIT_CATEGORY, UnitCategory);
	switch (property_id) {
		case UNIT_CATEGORY_NAME_PROPERTY:
		g_value_take_string (value, unit_category_get_name (self));
		break;
		case UNIT_CATEGORY_DISPLAY_NAME_PROPERTY:
		g_value_take_string (value, unit_category_get_display_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
unit_get_instance_private (Unit* self)
{
	return G_STRUCT_MEMBER_P (self, Unit_private_offset);
}

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

static inline void
_g_list_free__g_free0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_free0_);
}

Unit*
unit_construct (GType object_type,
                const gchar* name,
                const gchar* display_name,
                const gchar* format,
                const gchar* from_function,
                const gchar* to_function,
                const gchar* symbols)
{
	Unit * self = NULL;
	Serializer* _tmp0_;
	Serializer* _tmp1_;
	Serializer* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar** symbol_names = NULL;
	gchar** _tmp8_;
	gchar** _tmp9_;
	gint symbol_names_length1;
	gint _symbol_names_size_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (display_name != NULL, NULL);
	g_return_val_if_fail (format != NULL, NULL);
	g_return_val_if_fail (symbols != NULL, NULL);
	self = (Unit*) g_object_new (object_type, NULL);
	_tmp0_ = serializer_new (DISPLAY_FORMAT_AUTOMATIC, 10, 4);
	_g_object_unref0 (self->priv->serializer);
	self->priv->serializer = _tmp0_;
	_tmp1_ = self->priv->serializer;
	serializer_set_leading_digits (_tmp1_, 6);
	_tmp2_ = self->priv->serializer;
	serializer_set_show_thousands_separators (_tmp2_, TRUE);
	_tmp3_ = g_strdup (name);
	_g_free0 (self->priv->_name);
	self->priv->_name = _tmp3_;
	_tmp4_ = g_strdup (display_name);
	_g_free0 (self->priv->_display_name);
	self->priv->_display_name = _tmp4_;
	_tmp5_ = g_strdup (format);
	_g_free0 (self->priv->_format);
	self->priv->_format = _tmp5_;
	_tmp6_ = g_strdup (from_function);
	_g_free0 (self->priv->from_function);
	self->priv->from_function = _tmp6_;
	_tmp7_ = g_strdup (to_function);
	_g_free0 (self->priv->to_function);
	self->priv->to_function = _tmp7_;
	(self->priv->_symbols == NULL) ? NULL : (self->priv->_symbols = (_g_list_free__g_free0_ (self->priv->_symbols), NULL));
	self->priv->_symbols = NULL;
	_tmp9_ = _tmp8_ = g_strsplit (symbols, ",", 0);
	symbol_names = _tmp9_;
	symbol_names_length1 = _vala_array_length (_tmp8_);
	_symbol_names_size_ = symbol_names_length1;
	_tmp10_ = symbol_names;
	_tmp10__length1 = symbol_names_length1;
	{
		gchar** symbol_name_collection = NULL;
		gint symbol_name_collection_length1 = 0;
		gint _symbol_name_collection_size_ = 0;
		gint symbol_name_it = 0;
		symbol_name_collection = _tmp10_;
		symbol_name_collection_length1 = _tmp10__length1;
		for (symbol_name_it = 0; symbol_name_it < symbol_name_collection_length1; symbol_name_it = symbol_name_it + 1) {
			gchar* _tmp11_;
			gchar* symbol_name = NULL;
			_tmp11_ = g_strdup (symbol_name_collection[symbol_name_it]);
			symbol_name = _tmp11_;
			{
				const gchar* _tmp12_;
				gchar* _tmp13_;
				_tmp12_ = symbol_name;
				_tmp13_ = g_strdup (_tmp12_);
				self->priv->_symbols = g_list_append (self->priv->_symbols, _tmp13_);
				_g_free0 (symbol_name);
			}
		}
	}
	symbol_names = (_vala_array_free (symbol_names, symbol_names_length1, (GDestroyNotify) g_free), NULL);
	return self;
}

Unit*
unit_new (const gchar* name,
          const gchar* display_name,
          const gchar* format,
          const gchar* from_function,
          const gchar* to_function,
          const gchar* symbols)
{
	return unit_construct (TYPE_UNIT, name, display_name, format, from_function, to_function, symbols);
}

gchar*
unit_get_symbol_from_format (Unit* self)
{
	GList* _tmp0_;
	GList* _tmp1_;
	gconstpointer _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_symbols;
	_tmp1_ = g_list_first (_tmp0_);
	_tmp2_ = _tmp1_->data;
	_tmp3_ = g_strdup ((const gchar*) _tmp2_);
	result = _tmp3_;
	return result;
}

gboolean
unit_matches_symbol (Unit* self,
                     const gchar* symbol,
                     gboolean case_sensitive)
{
	GList* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (symbol != NULL, FALSE);
	_tmp0_ = self->priv->_symbols;
	{
		GList* s_collection = NULL;
		GList* s_it = NULL;
		s_collection = _tmp0_;
		for (s_it = s_collection; s_it != NULL; s_it = s_it->next) {
			gchar* _tmp1_;
			gchar* s = NULL;
			_tmp1_ = g_strdup ((const gchar*) s_it->data);
			s = _tmp1_;
			{
				gboolean _tmp2_ = FALSE;
				gboolean _tmp3_ = FALSE;
				if (case_sensitive) {
					const gchar* _tmp4_;
					_tmp4_ = s;
					_tmp3_ = g_strcmp0 (_tmp4_, symbol) == 0;
				} else {
					_tmp3_ = FALSE;
				}
				if (_tmp3_) {
					_tmp2_ = TRUE;
				} else {
					gboolean _tmp5_ = FALSE;
					if (!case_sensitive) {
						const gchar* _tmp6_;
						gchar* _tmp7_;
						gchar* _tmp8_;
						gchar* _tmp9_;
						gchar* _tmp10_;
						_tmp6_ = s;
						_tmp7_ = g_utf8_strdown (_tmp6_, (gssize) -1);
						_tmp8_ = _tmp7_;
						_tmp9_ = g_utf8_strdown (symbol, (gssize) -1);
						_tmp10_ = _tmp9_;
						_tmp5_ = g_strcmp0 (_tmp8_, _tmp10_) == 0;
						_g_free0 (_tmp10_);
						_g_free0 (_tmp8_);
					} else {
						_tmp5_ = FALSE;
					}
					_tmp2_ = _tmp5_;
				}
				if (_tmp2_) {
					result = TRUE;
					_g_free0 (s);
					return result;
				}
				_g_free0 (s);
			}
		}
	}
	result = FALSE;
	return result;
}

GList*
unit_get_symbols (Unit* self)
{
	GList* _tmp0_;
	GList* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_symbols;
	result = _tmp0_;
	return result;
}

Number*
unit_convert_from (Unit* self,
                   Number* x)
{
	const gchar* _tmp0_;
	Number* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (x != NULL, NULL);
	_tmp0_ = self->priv->from_function;
	if (_tmp0_ != NULL) {
		const gchar* _tmp1_;
		Number* _tmp2_;
		_tmp1_ = self->priv->from_function;
		_tmp2_ = unit_solve_function (self, _tmp1_, x);
		result = _tmp2_;
		return result;
	} else {
		Number* r = NULL;
		CurrencyManager* _tmp3_;
		CurrencyManager* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		Number* _tmp8_;
		Number* _tmp9_;
		Number* _tmp10_;
		Number* _tmp11_;
		Number* _tmp12_;
		_tmp3_ = currency_manager_get_default (TRUE, TRUE);
		_tmp4_ = _tmp3_;
		_tmp5_ = unit_get_name (self);
		_tmp6_ = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp8_ = currency_manager_get_value (_tmp4_, _tmp7_);
		_tmp9_ = _tmp8_;
		_g_free0 (_tmp7_);
		_g_object_unref0 (_tmp4_);
		r = _tmp9_;
		_tmp10_ = r;
		if (_tmp10_ == NULL) {
			result = NULL;
			_g_object_unref0 (r);
			return result;
		}
		_tmp11_ = r;
		_tmp12_ = number_divide (x, _tmp11_);
		result = _tmp12_;
		_g_object_unref0 (r);
		return result;
	}
}

Number*
unit_convert_to (Unit* self,
                 Number* x)
{
	const gchar* _tmp0_;
	Number* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (x != NULL, NULL);
	_tmp0_ = self->priv->to_function;
	if (_tmp0_ != NULL) {
		const gchar* _tmp1_;
		Number* _tmp2_;
		_tmp1_ = self->priv->to_function;
		_tmp2_ = unit_solve_function (self, _tmp1_, x);
		result = _tmp2_;
		return result;
	} else {
		Number* r = NULL;
		CurrencyManager* _tmp3_;
		CurrencyManager* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		Number* _tmp8_;
		Number* _tmp9_;
		Number* _tmp10_;
		Number* _tmp11_;
		Number* _tmp12_;
		_tmp3_ = currency_manager_get_default (TRUE, TRUE);
		_tmp4_ = _tmp3_;
		_tmp5_ = unit_get_name (self);
		_tmp6_ = _tmp5_;
		_tmp7_ = _tmp6_;
		_tmp8_ = currency_manager_get_value (_tmp4_, _tmp7_);
		_tmp9_ = _tmp8_;
		_g_free0 (_tmp7_);
		_g_object_unref0 (_tmp4_);
		r = _tmp9_;
		_tmp10_ = r;
		if (_tmp10_ == NULL) {
			result = NULL;
			_g_object_unref0 (r);
			return result;
		}
		_tmp11_ = r;
		_tmp12_ = number_multiply (x, _tmp11_);
		result = _tmp12_;
		_g_object_unref0 (r);
		return result;
	}
}

gchar*
unit_format (Unit* self,
             Number* x)
{
	gchar* number_text = NULL;
	Serializer* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (x != NULL, NULL);
	_tmp0_ = self->priv->serializer;
	_tmp1_ = serializer_to_string (_tmp0_, x);
	number_text = _tmp1_;
	_tmp2_ = self->priv->_format;
	_tmp3_ = g_strdup_printf (_tmp2_, number_text);
	result = _tmp3_;
	_g_free0 (number_text);
	return result;
}

static Number*
unit_solve_function (Unit* self,
                     const gchar* function,
                     Number* x)
{
	UnitSolveEquation* equation = NULL;
	UnitSolveEquation* _tmp0_;
	UnitSolveEquation* _tmp1_;
	UnitSolveEquation* _tmp2_;
	Number* z = NULL;
	UnitSolveEquation* _tmp3_;
	Number* _tmp4_;
	Number* _tmp5_;
	Number* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (function != NULL, NULL);
	g_return_val_if_fail (x != NULL, NULL);
	_tmp0_ = unit_solve_equation_new (function, x);
	equation = _tmp0_;
	_tmp1_ = equation;
	((Equation*) _tmp1_)->base = 10;
	_tmp2_ = equation;
	((Equation*) _tmp2_)->wordlen = 32;
	_tmp3_ = equation;
	_tmp4_ = equation_parse ((Equation*) _tmp3_, NULL, NULL, NULL, NULL, NULL);
	z = _tmp4_;
	_tmp5_ = z;
	if (_tmp5_ == NULL) {
		g_warning ("unit.vala:443: Failed to convert value: %s", function);
	}
	result = z;
	_g_object_unref0 (equation);
	return result;
}

gchar*
unit_get_name (Unit* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
unit_get_display_name (Unit* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
unit_class_init (UnitClass * klass,
                 gpointer klass_data)
{
	unit_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &Unit_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_unit_get_property;
	G_OBJECT_CLASS (klass)->finalize = unit_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), UNIT_NAME_PROPERTY, unit_properties[UNIT_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), UNIT_DISPLAY_NAME_PROPERTY, unit_properties[UNIT_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
unit_instance_init (Unit * self,
                    gpointer klass)
{
	self->priv = unit_get_instance_private (self);
}

static void
unit_finalize (GObject * obj)
{
	Unit * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_UNIT, Unit);
	_g_free0 (self->priv->_name);
	_g_free0 (self->priv->_display_name);
	_g_free0 (self->priv->_format);
	(self->priv->_symbols == NULL) ? NULL : (self->priv->_symbols = (_g_list_free__g_free0_ (self->priv->_symbols), NULL));
	_g_free0 (self->priv->from_function);
	_g_free0 (self->priv->to_function);
	_g_object_unref0 (self->priv->serializer);
	G_OBJECT_CLASS (unit_parent_class)->finalize (obj);
}

static GType
unit_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UnitClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unit_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Unit), 0, (GInstanceInitFunc) unit_instance_init, NULL };
	GType unit_type_id;
	unit_type_id = g_type_register_static (G_TYPE_OBJECT, "Unit", &g_define_type_info, 0);
	Unit_private_offset = g_type_add_instance_private (unit_type_id, sizeof (UnitPrivate));
	return unit_type_id;
}

GType
unit_get_type (void)
{
	static volatile gsize unit_type_id__once = 0;
	if (g_once_init_enter (&unit_type_id__once)) {
		GType unit_type_id;
		unit_type_id = unit_get_type_once ();
		g_once_init_leave (&unit_type_id__once, unit_type_id);
	}
	return unit_type_id__once;
}

static void
_vala_unit_get_property (GObject * object,
                         guint property_id,
                         GValue * value,
                         GParamSpec * pspec)
{
	Unit * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_UNIT, Unit);
	switch (property_id) {
		case UNIT_NAME_PROPERTY:
		g_value_take_string (value, unit_get_name (self));
		break;
		case UNIT_DISPLAY_NAME_PROPERTY:
		g_value_take_string (value, unit_get_display_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
unit_solve_equation_get_instance_private (UnitSolveEquation* self)
{
	return G_STRUCT_MEMBER_P (self, UnitSolveEquation_private_offset);
}

UnitSolveEquation*
unit_solve_equation_construct (GType object_type,
                               const gchar* function,
                               Number* x)
{
	UnitSolveEquation * self = NULL;
	Number* _tmp0_;
	g_return_val_if_fail (function != NULL, NULL);
	g_return_val_if_fail (x != NULL, NULL);
	self = (UnitSolveEquation*) equation_construct (object_type, function);
	_tmp0_ = _g_object_ref0 (x);
	_g_object_unref0 (self->priv->x);
	self->priv->x = _tmp0_;
	return self;
}

UnitSolveEquation*
unit_solve_equation_new (const gchar* function,
                         Number* x)
{
	return unit_solve_equation_construct (TYPE_UNIT_SOLVE_EQUATION, function, x);
}

static gboolean
unit_solve_equation_real_variable_is_defined (Equation* base,
                                              const gchar* name)
{
	UnitSolveEquation * self;
	gboolean result;
	self = (UnitSolveEquation*) base;
	g_return_val_if_fail (name != NULL, FALSE);
	result = TRUE;
	return result;
}

static Number*
unit_solve_equation_real_get_variable (Equation* base,
                                       const gchar* name)
{
	UnitSolveEquation * self;
	Number* _tmp0_;
	Number* _tmp1_;
	Number* result;
	self = (UnitSolveEquation*) base;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = self->priv->x;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
unit_solve_equation_class_init (UnitSolveEquationClass * klass,
                                gpointer klass_data)
{
	unit_solve_equation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &UnitSolveEquation_private_offset);
	((EquationClass *) klass)->variable_is_defined = (gboolean (*) (Equation*, const gchar*)) unit_solve_equation_real_variable_is_defined;
	((EquationClass *) klass)->get_variable = (Number* (*) (Equation*, const gchar*)) unit_solve_equation_real_get_variable;
	G_OBJECT_CLASS (klass)->finalize = unit_solve_equation_finalize;
}

static void
unit_solve_equation_instance_init (UnitSolveEquation * self,
                                   gpointer klass)
{
	self->priv = unit_solve_equation_get_instance_private (self);
}

static void
unit_solve_equation_finalize (GObject * obj)
{
	UnitSolveEquation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_UNIT_SOLVE_EQUATION, UnitSolveEquation);
	_g_object_unref0 (self->priv->x);
	G_OBJECT_CLASS (unit_solve_equation_parent_class)->finalize (obj);
}

static GType
unit_solve_equation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (UnitSolveEquationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unit_solve_equation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnitSolveEquation), 0, (GInstanceInitFunc) unit_solve_equation_instance_init, NULL };
	GType unit_solve_equation_type_id;
	unit_solve_equation_type_id = g_type_register_static (TYPE_EQUATION, "UnitSolveEquation", &g_define_type_info, 0);
	UnitSolveEquation_private_offset = g_type_add_instance_private (unit_solve_equation_type_id, sizeof (UnitSolveEquationPrivate));
	return unit_solve_equation_type_id;
}

GType
unit_solve_equation_get_type (void)
{
	static volatile gsize unit_solve_equation_type_id__once = 0;
	if (g_once_init_enter (&unit_solve_equation_type_id__once)) {
		GType unit_solve_equation_type_id;
		unit_solve_equation_type_id = unit_solve_equation_get_type_once ();
		g_once_init_leave (&unit_solve_equation_type_id__once, unit_solve_equation_type_id);
	}
	return unit_solve_equation_type_id__once;
}

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

