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


#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>


#define TYPE_PROVIDERS (providers_get_type ())
#define PROVIDERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROVIDERS, Providers))
#define PROVIDERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROVIDERS, ProvidersClass))
#define IS_PROVIDERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROVIDERS))
#define IS_PROVIDERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROVIDERS))
#define PROVIDERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROVIDERS, ProvidersClass))

typedef struct _Providers Providers;
typedef struct _ProvidersClass ProvidersClass;
typedef struct _ProvidersPrivate ProvidersPrivate;

#define TYPE_PROVIDER (provider_get_type ())
#define PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROVIDER, Provider))
#define PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROVIDER, ProviderClass))
#define IS_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROVIDER))
#define IS_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROVIDER))
#define PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROVIDER, ProviderClass))

typedef struct _Provider Provider;
typedef struct _ProviderClass ProviderClass;

#define TYPE_FUNCTION (function_get_type ())
#define FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FUNCTION, Function))
#define FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FUNCTION, FunctionClass))
#define IS_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FUNCTION))
#define IS_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FUNCTION))
#define FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FUNCTION, FunctionClass))

typedef struct _Function Function;
typedef struct _FunctionClass FunctionClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_CPU_PROVIDER (cpu_provider_get_type ())
#define CPU_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CPU_PROVIDER, CpuProvider))
#define CPU_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CPU_PROVIDER, CpuProviderClass))
#define IS_CPU_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CPU_PROVIDER))
#define IS_CPU_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CPU_PROVIDER))
#define CPU_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CPU_PROVIDER, CpuProviderClass))

typedef struct _CpuProvider CpuProvider;
typedef struct _CpuProviderClass CpuProviderClass;

#define TYPE_CPU_FREQ_PROVIDER (cpu_freq_provider_get_type ())
#define CPU_FREQ_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CPU_FREQ_PROVIDER, CpuFreqProvider))
#define CPU_FREQ_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CPU_FREQ_PROVIDER, CpuFreqProviderClass))
#define IS_CPU_FREQ_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CPU_FREQ_PROVIDER))
#define IS_CPU_FREQ_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CPU_FREQ_PROVIDER))
#define CPU_FREQ_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CPU_FREQ_PROVIDER, CpuFreqProviderClass))

typedef struct _CpuFreqProvider CpuFreqProvider;
typedef struct _CpuFreqProviderClass CpuFreqProviderClass;

#define TYPE_MEM_PROVIDER (mem_provider_get_type ())
#define MEM_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEM_PROVIDER, MemProvider))
#define MEM_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEM_PROVIDER, MemProviderClass))
#define IS_MEM_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEM_PROVIDER))
#define IS_MEM_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MEM_PROVIDER))
#define MEM_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MEM_PROVIDER, MemProviderClass))

typedef struct _MemProvider MemProvider;
typedef struct _MemProviderClass MemProviderClass;

#define TYPE_NET_PROVIDER (net_provider_get_type ())
#define NET_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_NET_PROVIDER, NetProvider))
#define NET_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_NET_PROVIDER, NetProviderClass))
#define IS_NET_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_NET_PROVIDER))
#define IS_NET_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_NET_PROVIDER))
#define NET_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_NET_PROVIDER, NetProviderClass))

typedef struct _NetProvider NetProvider;
typedef struct _NetProviderClass NetProviderClass;

#define TYPE_SWAP_PROVIDER (swap_provider_get_type ())
#define SWAP_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SWAP_PROVIDER, SwapProvider))
#define SWAP_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SWAP_PROVIDER, SwapProviderClass))
#define IS_SWAP_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SWAP_PROVIDER))
#define IS_SWAP_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SWAP_PROVIDER))
#define SWAP_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SWAP_PROVIDER, SwapProviderClass))

typedef struct _SwapProvider SwapProvider;
typedef struct _SwapProviderClass SwapProviderClass;

#define TYPE_LOAD_PROVIDER (load_provider_get_type ())
#define LOAD_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LOAD_PROVIDER, LoadProvider))
#define LOAD_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LOAD_PROVIDER, LoadProviderClass))
#define IS_LOAD_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LOAD_PROVIDER))
#define IS_LOAD_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LOAD_PROVIDER))
#define LOAD_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LOAD_PROVIDER, LoadProviderClass))

typedef struct _LoadProvider LoadProvider;
typedef struct _LoadProviderClass LoadProviderClass;

#define TYPE_DISK_PROVIDER (disk_provider_get_type ())
#define DISK_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DISK_PROVIDER, DiskProvider))
#define DISK_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DISK_PROVIDER, DiskProviderClass))
#define IS_DISK_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DISK_PROVIDER))
#define IS_DISK_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DISK_PROVIDER))
#define DISK_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DISK_PROVIDER, DiskProviderClass))

typedef struct _DiskProvider DiskProvider;
typedef struct _DiskProviderClass DiskProviderClass;

#define TYPE_DECIMALS_FUNCTION (decimals_function_get_type ())
#define DECIMALS_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DECIMALS_FUNCTION, DecimalsFunction))
#define DECIMALS_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DECIMALS_FUNCTION, DecimalsFunctionClass))
#define IS_DECIMALS_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DECIMALS_FUNCTION))
#define IS_DECIMALS_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DECIMALS_FUNCTION))
#define DECIMALS_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DECIMALS_FUNCTION, DecimalsFunctionClass))

typedef struct _DecimalsFunction DecimalsFunction;
typedef struct _DecimalsFunctionClass DecimalsFunctionClass;

#define TYPE_SIZE_FUNCTION (size_function_get_type ())
#define SIZE_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SIZE_FUNCTION, SizeFunction))
#define SIZE_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SIZE_FUNCTION, SizeFunctionClass))
#define IS_SIZE_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SIZE_FUNCTION))
#define IS_SIZE_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SIZE_FUNCTION))
#define SIZE_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SIZE_FUNCTION, SizeFunctionClass))

typedef struct _SizeFunction SizeFunction;
typedef struct _SizeFunctionClass SizeFunctionClass;

#define TYPE_SPEED_FUNCTION (speed_function_get_type ())
#define SPEED_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SPEED_FUNCTION, SpeedFunction))
#define SPEED_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SPEED_FUNCTION, SpeedFunctionClass))
#define IS_SPEED_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SPEED_FUNCTION))
#define IS_SPEED_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SPEED_FUNCTION))
#define SPEED_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SPEED_FUNCTION, SpeedFunctionClass))

typedef struct _SpeedFunction SpeedFunction;
typedef struct _SpeedFunctionClass SpeedFunctionClass;

#define TYPE_PERCENT_FUNCTION (percent_function_get_type ())
#define PERCENT_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PERCENT_FUNCTION, PercentFunction))
#define PERCENT_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PERCENT_FUNCTION, PercentFunctionClass))
#define IS_PERCENT_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PERCENT_FUNCTION))
#define IS_PERCENT_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PERCENT_FUNCTION))
#define PERCENT_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PERCENT_FUNCTION, PercentFunctionClass))

typedef struct _PercentFunction PercentFunction;
typedef struct _PercentFunctionClass PercentFunctionClass;

#define TYPE_FREQUENCY_FUNCTION (frequency_function_get_type ())
#define FREQUENCY_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FREQUENCY_FUNCTION, FrequencyFunction))
#define FREQUENCY_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FREQUENCY_FUNCTION, FrequencyFunctionClass))
#define IS_FREQUENCY_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FREQUENCY_FUNCTION))
#define IS_FREQUENCY_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FREQUENCY_FUNCTION))
#define FREQUENCY_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FREQUENCY_FUNCTION, FrequencyFunctionClass))

typedef struct _FrequencyFunction FrequencyFunction;
typedef struct _FrequencyFunctionClass FrequencyFunctionClass;

struct _Providers {
	GObject parent_instance;
	ProvidersPrivate * priv;
};

struct _ProvidersClass {
	GObjectClass parent_class;
};

struct _ProvidersPrivate {
	Provider** _providers;
	gint _providers_length1;
	gint __providers_size_;
	Function** _functions;
	gint _functions_length1;
	gint __functions_size_;
};


static gpointer providers_parent_class = NULL;

GType providers_get_type (void) G_GNUC_CONST;
GType provider_get_type (void) G_GNUC_CONST;
GType function_get_type (void) G_GNUC_CONST;
#define PROVIDERS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PROVIDERS, ProvidersPrivate))
enum  {
	PROVIDERS_DUMMY_PROPERTY
};
gdouble providers_value (Providers* self, const gchar* name, gboolean* found);
Provider** providers_get_providers (Providers* self, int* result_length1);
const gchar* provider_get_id (Provider* self);
gchar** provider_get_keys (Provider* self, int* result_length1);
gdouble* provider_get_values (Provider* self, int* result_length1);
gchar* providers_call (Providers* self, const gchar* name, gchar** parameters, int parameters_length1, gboolean widest, gboolean* found, GError** error);
Function** providers_get_functions (Providers* self, int* result_length1);
const gchar* function_get_id (Function* self);
gchar* function_call (Function* self, gchar** parameters, int parameters_length1, gboolean widest, GError** error);
void providers_update (Providers* self);
void provider_update (Provider* self);
Providers* providers_new (void);
Providers* providers_construct (GType object_type);
static void providers_set_providers (Providers* self, Provider** value, int value_length1);
static Provider** _vala_array_dup23 (Provider** self, int length);
static void providers_set_functions (Providers* self, Function** value, int value_length1);
static Function** _vala_array_dup24 (Function** self, int length);
static GObject * providers_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
CpuProvider* cpu_provider_new (void);
CpuProvider* cpu_provider_construct (GType object_type);
GType cpu_provider_get_type (void) G_GNUC_CONST;
CpuFreqProvider* cpu_freq_provider_new (void);
CpuFreqProvider* cpu_freq_provider_construct (GType object_type);
GType cpu_freq_provider_get_type (void) G_GNUC_CONST;
MemProvider* mem_provider_new (void);
MemProvider* mem_provider_construct (GType object_type);
GType mem_provider_get_type (void) G_GNUC_CONST;
NetProvider* net_provider_new (void);
NetProvider* net_provider_construct (GType object_type);
GType net_provider_get_type (void) G_GNUC_CONST;
SwapProvider* swap_provider_new (void);
SwapProvider* swap_provider_construct (GType object_type);
GType swap_provider_get_type (void) G_GNUC_CONST;
LoadProvider* load_provider_new (void);
LoadProvider* load_provider_construct (GType object_type);
GType load_provider_get_type (void) G_GNUC_CONST;
DiskProvider* disk_provider_new (void);
DiskProvider* disk_provider_construct (GType object_type);
GType disk_provider_get_type (void) G_GNUC_CONST;
DecimalsFunction* decimals_function_new (void);
DecimalsFunction* decimals_function_construct (GType object_type);
GType decimals_function_get_type (void) G_GNUC_CONST;
SizeFunction* size_function_new (void);
SizeFunction* size_function_construct (GType object_type);
GType size_function_get_type (void) G_GNUC_CONST;
SpeedFunction* speed_function_new (void);
SpeedFunction* speed_function_construct (GType object_type);
GType speed_function_get_type (void) G_GNUC_CONST;
PercentFunction* percent_function_new (void);
PercentFunction* percent_function_construct (GType object_type);
GType percent_function_get_type (void) G_GNUC_CONST;
FrequencyFunction* frequency_function_new (void);
FrequencyFunction* frequency_function_construct (GType object_type);
GType frequency_function_get_type (void) G_GNUC_CONST;
static void providers_finalize (GObject* obj);
static void _vala_providers_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_providers_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 gint _vala_array_length (gpointer array);


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


gdouble providers_value (Providers* self, const gchar* name, gboolean* found) {
	gboolean _vala_found = FALSE;
	gdouble result = 0.0;
	gchar** varparts = NULL;
	const gchar* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gchar** _tmp2_ = NULL;
	gint varparts_length1 = 0;
	gint _varparts_size_ = 0;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	Provider** _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	Provider** _tmp5_ = NULL;
	gint _tmp5__length1 = 0;
	g_return_val_if_fail (IS_PROVIDERS (self), 0.0);
	g_return_val_if_fail (name != NULL, 0.0);
	_tmp0_ = name;
	_tmp2_ = _tmp1_ = g_strsplit (_tmp0_, ".", 2);
	varparts = _tmp2_;
	varparts_length1 = _vala_array_length (_tmp1_);
	_varparts_size_ = varparts_length1;
	_tmp3_ = varparts;
	_tmp3__length1 = varparts_length1;
	g_return_val_if_fail (_tmp3__length1 == 2, 0);
	_vala_found = TRUE;
	_tmp4_ = providers_get_providers (self, &_tmp4__length1);
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _tmp4__length1;
	{
		Provider** provider_collection = NULL;
		gint provider_collection_length1 = 0;
		gint _provider_collection_size_ = 0;
		gint provider_it = 0;
		provider_collection = _tmp5_;
		provider_collection_length1 = _tmp5__length1;
		for (provider_it = 0; provider_it < _tmp5__length1; provider_it = provider_it + 1) {
			Provider* _tmp6_ = NULL;
			Provider* provider = NULL;
			_tmp6_ = _g_object_ref0 (provider_collection[provider_it]);
			provider = _tmp6_;
			{
				Provider* _tmp7_ = NULL;
				const gchar* _tmp8_ = NULL;
				const gchar* _tmp9_ = NULL;
				gchar** _tmp10_ = NULL;
				gint _tmp10__length1 = 0;
				const gchar* _tmp11_ = NULL;
				_tmp7_ = provider;
				_tmp8_ = provider_get_id (_tmp7_);
				_tmp9_ = _tmp8_;
				_tmp10_ = varparts;
				_tmp10__length1 = varparts_length1;
				_tmp11_ = _tmp10_[0];
				if (g_strcmp0 (_tmp9_, _tmp11_) != 0) {
					_g_object_unref0 (provider);
					continue;
				}
				{
					guint j = 0U;
					guint jsize = 0U;
					Provider* _tmp12_ = NULL;
					gchar** _tmp13_ = NULL;
					gint _tmp13__length1 = 0;
					gchar** _tmp14_ = NULL;
					gint _tmp14__length1 = 0;
					j = (guint) 0;
					_tmp12_ = provider;
					_tmp13_ = provider_get_keys (_tmp12_, &_tmp13__length1);
					_tmp14_ = _tmp13_;
					_tmp14__length1 = _tmp13__length1;
					jsize = (guint) _tmp14__length1;
					{
						gboolean _tmp15_ = FALSE;
						_tmp15_ = TRUE;
						while (TRUE) {
							gboolean _tmp16_ = FALSE;
							guint _tmp18_ = 0U;
							guint _tmp19_ = 0U;
							Provider* _tmp20_ = NULL;
							gchar** _tmp21_ = NULL;
							gint _tmp21__length1 = 0;
							gchar** _tmp22_ = NULL;
							gint _tmp22__length1 = 0;
							guint _tmp23_ = 0U;
							const gchar* _tmp24_ = NULL;
							gchar** _tmp25_ = NULL;
							gint _tmp25__length1 = 0;
							const gchar* _tmp26_ = NULL;
							Provider* _tmp27_ = NULL;
							gdouble* _tmp28_ = NULL;
							gint _tmp28__length1 = 0;
							gdouble* _tmp29_ = NULL;
							gint _tmp29__length1 = 0;
							guint _tmp30_ = 0U;
							gdouble _tmp31_ = 0.0;
							_tmp16_ = _tmp15_;
							if (!_tmp16_) {
								guint _tmp17_ = 0U;
								_tmp17_ = j;
								j = _tmp17_ + 1;
							}
							_tmp15_ = FALSE;
							_tmp18_ = j;
							_tmp19_ = jsize;
							if (!(_tmp18_ < _tmp19_)) {
								break;
							}
							_tmp20_ = provider;
							_tmp21_ = provider_get_keys (_tmp20_, &_tmp21__length1);
							_tmp22_ = _tmp21_;
							_tmp22__length1 = _tmp21__length1;
							_tmp23_ = j;
							_tmp24_ = _tmp22_[_tmp23_];
							_tmp25_ = varparts;
							_tmp25__length1 = varparts_length1;
							_tmp26_ = _tmp25_[1];
							if (g_strcmp0 (_tmp24_, _tmp26_) != 0) {
								continue;
							}
							_tmp27_ = provider;
							_tmp28_ = provider_get_values (_tmp27_, &_tmp28__length1);
							_tmp29_ = _tmp28_;
							_tmp29__length1 = _tmp28__length1;
							_tmp30_ = j;
							_tmp31_ = _tmp29_[_tmp30_];
							result = _tmp31_;
							_g_object_unref0 (provider);
							varparts = (_vala_array_free (varparts, varparts_length1, (GDestroyNotify) g_free), NULL);
							if (found) {
								*found = _vala_found;
							}
							return result;
						}
					}
				}
				_g_object_unref0 (provider);
			}
		}
	}
	_vala_found = FALSE;
	result = (gdouble) 0;
	varparts = (_vala_array_free (varparts, varparts_length1, (GDestroyNotify) g_free), NULL);
	if (found) {
		*found = _vala_found;
	}
	return result;
}


gchar* providers_call (Providers* self, const gchar* name, gchar** parameters, int parameters_length1, gboolean widest, gboolean* found, GError** error) {
	gboolean _vala_found = FALSE;
	gchar* result = NULL;
	Function** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	Function** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	gchar* _tmp12_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (IS_PROVIDERS (self), NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_vala_found = TRUE;
	_tmp0_ = providers_get_functions (self, &_tmp0__length1);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	{
		Function** function_collection = NULL;
		gint function_collection_length1 = 0;
		gint _function_collection_size_ = 0;
		gint function_it = 0;
		function_collection = _tmp1_;
		function_collection_length1 = _tmp1__length1;
		for (function_it = 0; function_it < _tmp1__length1; function_it = function_it + 1) {
			Function* _tmp2_ = NULL;
			Function* function = NULL;
			_tmp2_ = _g_object_ref0 (function_collection[function_it]);
			function = _tmp2_;
			{
				Function* _tmp3_ = NULL;
				const gchar* _tmp4_ = NULL;
				const gchar* _tmp5_ = NULL;
				const gchar* _tmp6_ = NULL;
				gchar* _tmp7_ = NULL;
				Function* _tmp8_ = NULL;
				gchar** _tmp9_ = NULL;
				gint _tmp9__length1 = 0;
				gboolean _tmp10_ = FALSE;
				gchar* _tmp11_ = NULL;
				_tmp3_ = function;
				_tmp4_ = function_get_id (_tmp3_);
				_tmp5_ = _tmp4_;
				_tmp6_ = name;
				if (g_strcmp0 (_tmp5_, _tmp6_) != 0) {
					_g_object_unref0 (function);
					continue;
				}
				_tmp8_ = function;
				_tmp9_ = parameters;
				_tmp9__length1 = parameters_length1;
				_tmp10_ = widest;
				_tmp11_ = function_call (_tmp8_, _tmp9_, _tmp9__length1, _tmp10_, &_inner_error_);
				_tmp7_ = _tmp11_;
				if (_inner_error_ != NULL) {
					g_propagate_error (error, _inner_error_);
					_g_object_unref0 (function);
					return NULL;
				}
				result = _tmp7_;
				_g_object_unref0 (function);
				if (found) {
					*found = _vala_found;
				}
				return result;
			}
		}
	}
	_vala_found = FALSE;
	_tmp12_ = g_strdup ("");
	result = _tmp12_;
	if (found) {
		*found = _vala_found;
	}
	return result;
}


void providers_update (Providers* self) {
	Provider** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	Provider** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (IS_PROVIDERS (self));
	_tmp0_ = providers_get_providers (self, &_tmp0__length1);
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	{
		Provider** provider_collection = NULL;
		gint provider_collection_length1 = 0;
		gint _provider_collection_size_ = 0;
		gint provider_it = 0;
		provider_collection = _tmp1_;
		provider_collection_length1 = _tmp1__length1;
		for (provider_it = 0; provider_it < _tmp1__length1; provider_it = provider_it + 1) {
			Provider* _tmp2_ = NULL;
			Provider* provider = NULL;
			_tmp2_ = _g_object_ref0 (provider_collection[provider_it]);
			provider = _tmp2_;
			{
				Provider* _tmp3_ = NULL;
				_tmp3_ = provider;
				provider_update (_tmp3_);
				_g_object_unref0 (provider);
			}
		}
	}
}


Providers* providers_construct (GType object_type) {
	Providers * self = NULL;
	self = (Providers*) g_object_new (object_type, NULL);
	return self;
}


Providers* providers_new (void) {
	return providers_construct (TYPE_PROVIDERS);
}


Provider** providers_get_providers (Providers* self, int* result_length1) {
	Provider** result;
	Provider** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	Provider** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (IS_PROVIDERS (self), NULL);
	_tmp0_ = self->priv->_providers;
	_tmp0__length1 = self->priv->_providers_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


static Provider** _vala_array_dup23 (Provider** self, int length) {
	Provider** result;
	int i;
	result = g_new0 (Provider*, length + 1);
	for (i = 0; i < length; i++) {
		Provider* _tmp0_ = NULL;
		_tmp0_ = _g_object_ref0 (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static void providers_set_providers (Providers* self, Provider** value, int value_length1) {
	Provider** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	Provider** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (IS_PROVIDERS (self));
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup23 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_providers = (_vala_array_free (self->priv->_providers, self->priv->_providers_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->_providers = _tmp1_;
	self->priv->_providers_length1 = _tmp1__length1;
	self->priv->__providers_size_ = self->priv->_providers_length1;
}


Function** providers_get_functions (Providers* self, int* result_length1) {
	Function** result;
	Function** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	Function** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_val_if_fail (IS_PROVIDERS (self), NULL);
	_tmp0_ = self->priv->_functions;
	_tmp0__length1 = self->priv->_functions_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}


static Function** _vala_array_dup24 (Function** self, int length) {
	Function** result;
	int i;
	result = g_new0 (Function*, length + 1);
	for (i = 0; i < length; i++) {
		Function* _tmp0_ = NULL;
		_tmp0_ = _g_object_ref0 (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static void providers_set_functions (Providers* self, Function** value, int value_length1) {
	Function** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	Function** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	g_return_if_fail (IS_PROVIDERS (self));
	_tmp0_ = value;
	_tmp0__length1 = value_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup24 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->_functions = (_vala_array_free (self->priv->_functions, self->priv->_functions_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->_functions = _tmp1_;
	self->priv->_functions_length1 = _tmp1__length1;
	self->priv->__functions_size_ = self->priv->_functions_length1;
}


static GObject * providers_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	Providers * self;
	CpuProvider* _tmp0_ = NULL;
	CpuFreqProvider* _tmp1_ = NULL;
	MemProvider* _tmp2_ = NULL;
	NetProvider* _tmp3_ = NULL;
	SwapProvider* _tmp4_ = NULL;
	LoadProvider* _tmp5_ = NULL;
	DiskProvider* _tmp6_ = NULL;
	Provider** _tmp7_ = NULL;
	Provider** _tmp8_ = NULL;
	gint _tmp8__length1 = 0;
	DecimalsFunction* _tmp9_ = NULL;
	SizeFunction* _tmp10_ = NULL;
	SpeedFunction* _tmp11_ = NULL;
	PercentFunction* _tmp12_ = NULL;
	FrequencyFunction* _tmp13_ = NULL;
	Function** _tmp14_ = NULL;
	Function** _tmp15_ = NULL;
	gint _tmp15__length1 = 0;
	parent_class = G_OBJECT_CLASS (providers_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PROVIDERS, Providers);
	_tmp0_ = cpu_provider_new ();
	_tmp1_ = cpu_freq_provider_new ();
	_tmp2_ = mem_provider_new ();
	_tmp3_ = net_provider_new ();
	_tmp4_ = swap_provider_new ();
	_tmp5_ = load_provider_new ();
	_tmp6_ = disk_provider_new ();
	_tmp7_ = g_new0 (Provider*, 7 + 1);
	_tmp7_[0] = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_PROVIDER, Provider);
	_tmp7_[1] = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_PROVIDER, Provider);
	_tmp7_[2] = G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, TYPE_PROVIDER, Provider);
	_tmp7_[3] = G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_PROVIDER, Provider);
	_tmp7_[4] = G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, TYPE_PROVIDER, Provider);
	_tmp7_[5] = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, TYPE_PROVIDER, Provider);
	_tmp7_[6] = G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, TYPE_PROVIDER, Provider);
	_tmp8_ = _tmp7_;
	_tmp8__length1 = 7;
	providers_set_providers (self, _tmp8_, 7);
	_tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_object_unref), NULL);
	providers_update (self);
	_tmp9_ = decimals_function_new ();
	_tmp10_ = size_function_new ();
	_tmp11_ = speed_function_new ();
	_tmp12_ = percent_function_new ();
	_tmp13_ = frequency_function_new ();
	_tmp14_ = g_new0 (Function*, 5 + 1);
	_tmp14_[0] = G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, TYPE_FUNCTION, Function);
	_tmp14_[1] = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, TYPE_FUNCTION, Function);
	_tmp14_[2] = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, TYPE_FUNCTION, Function);
	_tmp14_[3] = G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, TYPE_FUNCTION, Function);
	_tmp14_[4] = G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, TYPE_FUNCTION, Function);
	_tmp15_ = _tmp14_;
	_tmp15__length1 = 5;
	providers_set_functions (self, _tmp15_, 5);
	_tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_object_unref), NULL);
	return obj;
}


static void providers_class_init (ProvidersClass * klass) {
	providers_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ProvidersPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_providers_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_providers_set_property;
	G_OBJECT_CLASS (klass)->constructor = providers_constructor;
	G_OBJECT_CLASS (klass)->finalize = providers_finalize;
}


static void providers_instance_init (Providers * self) {
	self->priv = PROVIDERS_GET_PRIVATE (self);
}


static void providers_finalize (GObject* obj) {
	Providers * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_PROVIDERS, Providers);
	self->priv->_providers = (_vala_array_free (self->priv->_providers, self->priv->_providers_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->_functions = (_vala_array_free (self->priv->_functions, self->priv->_functions_length1, (GDestroyNotify) g_object_unref), NULL);
	G_OBJECT_CLASS (providers_parent_class)->finalize (obj);
}


/******************************************************************************
 * Copyright (C) 2011-2013  Michael Hofmann <mh21@mh21.de>                    *
 *                                                                            *
 * This program is free software; you can redistribute it and/or modify       *
 * it under the terms of the GNU General Public License as published by       *
 * the Free Software Foundation; either version 3 of the License, or          *
 * (at your option) any later version.                                        *
 *                                                                            *
 * This program is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
 * GNU General Public License for more details.                               *
 *                                                                            *
 * You should have received a copy of the GNU General Public License along    *
 * with this program; if not, write to the Free Software Foundation, Inc.,    *
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                *
 ******************************************************************************/
GType providers_get_type (void) {
	static volatile gsize providers_type_id__volatile = 0;
	if (g_once_init_enter (&providers_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ProvidersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) providers_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Providers), 0, (GInstanceInitFunc) providers_instance_init, NULL };
		GType providers_type_id;
		providers_type_id = g_type_register_static (G_TYPE_OBJECT, "Providers", &g_define_type_info, 0);
		g_once_init_leave (&providers_type_id__volatile, providers_type_id);
	}
	return providers_type_id__volatile;
}


static void _vala_providers_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	Providers * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PROVIDERS, Providers);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_providers_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	Providers * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_PROVIDERS, Providers);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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


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


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



