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

/*
 Copyright (C) 2014 Christian Dywan <christian@twotoasts.de>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 See the file COPYING for the full license text.
*/

#include <glib.h>
#include <glib-object.h>
#include "toolbar-editor.h"
#include <stdlib.h>
#include <string.h>

#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

struct _AdblockOptionsPrivate {
	GHashTable* optslist;
};


static gpointer adblock_options_parent_class = NULL;

#define ADBLOCK_OPTIONS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), ADBLOCK_TYPE_OPTIONS, AdblockOptionsPrivate))
enum  {
	ADBLOCK_OPTIONS_DUMMY_PROPERTY
};
static void _g_free0_ (gpointer var);
static void adblock_options_finalize (GObject* obj);


AdblockOptions* adblock_options_construct (GType object_type) {
	AdblockOptions * self = NULL;
#line 16 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	self = (AdblockOptions*) g_object_new (object_type, NULL);
#line 17 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	adblock_options_clear (self);
#line 16 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	return self;
#line 47 "options.c"
}


AdblockOptions* adblock_options_new (void) {
#line 16 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	return adblock_options_construct (ADBLOCK_TYPE_OPTIONS);
#line 54 "options.c"
}


void adblock_options_insert (AdblockOptions* self, const gchar* sig, const gchar* opts) {
	GHashTable* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	gchar* _tmp4_ = NULL;
#line 20 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	g_return_if_fail (self != NULL);
#line 20 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	g_return_if_fail (sig != NULL);
#line 21 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp0_ = self->priv->optslist;
#line 21 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp1_ = sig;
#line 21 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 21 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp3_ = opts;
#line 21 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 21 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	g_hash_table_insert (_tmp0_, _tmp2_, _tmp4_);
#line 80 "options.c"
}


gchar* adblock_options_lookup (AdblockOptions* self, const gchar* sig) {
	gchar* result = NULL;
	GHashTable* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
#line 24 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 24 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	g_return_val_if_fail (sig != NULL, NULL);
#line 25 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp0_ = self->priv->optslist;
#line 25 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp1_ = sig;
#line 25 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp2_ = g_hash_table_lookup (_tmp0_, _tmp1_);
#line 25 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp3_ = g_strdup ((const gchar*) _tmp2_);
#line 25 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	result = _tmp3_;
#line 25 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	return result;
#line 106 "options.c"
}


static void _g_free0_ (gpointer var) {
#line 29 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	var = (g_free (var), NULL);
#line 113 "options.c"
}


void adblock_options_clear (AdblockOptions* self) {
	GHashFunc _tmp0_ = NULL;
	GEqualFunc _tmp1_ = NULL;
	GHashTable* _tmp2_ = NULL;
#line 28 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	g_return_if_fail (self != NULL);
#line 29 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp0_ = g_str_hash;
#line 29 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp1_ = g_str_equal;
#line 29 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
#line 29 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_g_hash_table_unref0 (self->priv->optslist);
#line 29 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	self->priv->optslist = _tmp2_;
#line 133 "options.c"
}


static void adblock_options_class_init (AdblockOptionsClass * klass) {
#line 13 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	adblock_options_parent_class = g_type_class_peek_parent (klass);
#line 13 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	g_type_class_add_private (klass, sizeof (AdblockOptionsPrivate));
#line 13 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	G_OBJECT_CLASS (klass)->finalize = adblock_options_finalize;
#line 144 "options.c"
}


static void adblock_options_instance_init (AdblockOptions * self) {
#line 13 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	self->priv = ADBLOCK_OPTIONS_GET_PRIVATE (self);
#line 151 "options.c"
}


static void adblock_options_finalize (GObject* obj) {
	AdblockOptions * self;
#line 13 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, ADBLOCK_TYPE_OPTIONS, AdblockOptions);
#line 14 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	_g_hash_table_unref0 (self->priv->optslist);
#line 13 "/usr/src/ports/midori/midori-0.5.10-1.i686/src/extensions/adblock/options.vala"
	G_OBJECT_CLASS (adblock_options_parent_class)->finalize (obj);
#line 163 "options.c"
}


GType adblock_options_get_type (void) {
	static volatile gsize adblock_options_type_id__volatile = 0;
	if (g_once_init_enter (&adblock_options_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (AdblockOptionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) adblock_options_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (AdblockOptions), 0, (GInstanceInitFunc) adblock_options_instance_init, NULL };
		GType adblock_options_type_id;
		adblock_options_type_id = g_type_register_static (G_TYPE_OBJECT, "AdblockOptions", &g_define_type_info, 0);
		g_once_init_leave (&adblock_options_type_id__volatile, adblock_options_type_id);
	}
	return adblock_options_type_id__volatile;
}



