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

#include "xmpp-vala.h"
#include <gee.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.h>
#include <gobject/gvaluecollector.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _xmpp_namespace_state_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_namespace_state_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
typedef struct _XmppParamSpecNamespaceState XmppParamSpecNamespaceState;

struct _XmppNamespaceStatePrivate {
	GeeHashMap* uri_to_name;
	GeeHashMap* name_to_uri;
	XmppNamespaceState* parent;
};

struct _XmppParamSpecNamespaceState {
	GParamSpec parent_instance;
};

static gint XmppNamespaceState_private_offset;
static gpointer xmpp_namespace_state_parent_class = NULL;

static XmppNamespaceState* xmpp_namespace_state_new_copy (XmppNamespaceState* old);
static XmppNamespaceState* xmpp_namespace_state_construct_copy (GType object_type,
                                                         XmppNamespaceState* old);
static XmppNamespaceState* xmpp_namespace_state_new_with_parent (XmppNamespaceState* parent);
static XmppNamespaceState* xmpp_namespace_state_construct_with_parent (GType object_type,
                                                                XmppNamespaceState* parent);
static void xmpp_namespace_state_finalize (XmppNamespaceState * obj);
static GType xmpp_namespace_state_get_type_once (void);

static inline gpointer
xmpp_namespace_state_get_instance_private (XmppNamespaceState* self)
{
	return G_STRUCT_MEMBER_P (self, XmppNamespaceState_private_offset);
}

XmppNamespaceState*
xmpp_namespace_state_construct (GType object_type)
{
	XmppNamespaceState* self = NULL;
	gchar* _tmp0_;
	self = (XmppNamespaceState*) g_type_create_instance (object_type);
	xmpp_namespace_state_add_assoc (self, XMPP_XMLNS_URI, "xmlns");
	xmpp_namespace_state_add_assoc (self, XMPP_XML_URI, "xml");
	_tmp0_ = g_strdup (XMPP_XML_URI);
	_g_free0 (self->current_ns_uri);
	self->current_ns_uri = _tmp0_;
	return self;
}

XmppNamespaceState*
xmpp_namespace_state_new (void)
{
	return xmpp_namespace_state_construct (XMPP_TYPE_NAMESPACE_STATE);
}

XmppNamespaceState*
xmpp_namespace_state_construct_for_stanza (GType object_type)
{
	XmppNamespaceState* self = NULL;
	gchar* _tmp0_;
	self = (XmppNamespaceState*) xmpp_namespace_state_construct (object_type);
	xmpp_namespace_state_add_assoc (self, "http://etherx.jabber.org/streams", "stream");
	_tmp0_ = g_strdup ("jabber:client");
	_g_free0 (self->current_ns_uri);
	self->current_ns_uri = _tmp0_;
	return self;
}

XmppNamespaceState*
xmpp_namespace_state_new_for_stanza (void)
{
	return xmpp_namespace_state_construct_for_stanza (XMPP_TYPE_NAMESPACE_STATE);
}

static XmppNamespaceState*
xmpp_namespace_state_construct_copy (GType object_type,
                                     XmppNamespaceState* old)
{
	XmppNamespaceState* self = NULL;
	const gchar* _tmp14_;
	g_return_val_if_fail (old != NULL, NULL);
	self = (XmppNamespaceState*) g_type_create_instance (object_type);
	{
		GeeIterator* _key_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = old->priv->uri_to_name;
		_tmp1_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_key_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gchar* key = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			const gchar* _tmp9_;
			GeeHashMap* _tmp10_;
			const gchar* _tmp11_;
			gpointer _tmp12_;
			gchar* _tmp13_;
			_tmp6_ = _key_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _key_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			key = (gchar*) _tmp8_;
			_tmp9_ = key;
			_tmp10_ = old->priv->uri_to_name;
			_tmp11_ = key;
			_tmp12_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp10_, _tmp11_);
			_tmp13_ = (gchar*) _tmp12_;
			xmpp_namespace_state_add_assoc (self, _tmp9_, _tmp13_);
			_g_free0 (_tmp13_);
			_g_free0 (key);
		}
		_g_object_unref0 (_key_it);
	}
	_tmp14_ = old->current_ns_uri;
	xmpp_namespace_state_set_current (self, _tmp14_);
	return self;
}

static XmppNamespaceState*
xmpp_namespace_state_new_copy (XmppNamespaceState* old)
{
	return xmpp_namespace_state_construct_copy (XMPP_TYPE_NAMESPACE_STATE, old);
}

static gpointer
_xmpp_namespace_state_ref0 (gpointer self)
{
	return self ? xmpp_namespace_state_ref (self) : NULL;
}

static XmppNamespaceState*
xmpp_namespace_state_construct_with_parent (GType object_type,
                                            XmppNamespaceState* parent)
{
	XmppNamespaceState* self = NULL;
	XmppNamespaceState* _tmp0_;
	g_return_val_if_fail (parent != NULL, NULL);
	self = (XmppNamespaceState*) xmpp_namespace_state_construct_copy (object_type, parent);
	_tmp0_ = _xmpp_namespace_state_ref0 (parent);
	_xmpp_namespace_state_unref0 (self->priv->parent);
	self->priv->parent = _tmp0_;
	return self;
}

static XmppNamespaceState*
xmpp_namespace_state_new_with_parent (XmppNamespaceState* parent)
{
	return xmpp_namespace_state_construct_with_parent (XMPP_TYPE_NAMESPACE_STATE, parent);
}

XmppNamespaceState*
xmpp_namespace_state_construct_with_assoc (GType object_type,
                                           XmppNamespaceState* old,
                                           const gchar* ns_uri,
                                           const gchar* name)
{
	XmppNamespaceState* self = NULL;
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (ns_uri != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	self = (XmppNamespaceState*) xmpp_namespace_state_construct_copy (object_type, old);
	xmpp_namespace_state_add_assoc (self, ns_uri, name);
	return self;
}

XmppNamespaceState*
xmpp_namespace_state_new_with_assoc (XmppNamespaceState* old,
                                     const gchar* ns_uri,
                                     const gchar* name)
{
	return xmpp_namespace_state_construct_with_assoc (XMPP_TYPE_NAMESPACE_STATE, old, ns_uri, name);
}

XmppNamespaceState*
xmpp_namespace_state_construct_with_current (GType object_type,
                                             XmppNamespaceState* old,
                                             const gchar* current_ns_uri)
{
	XmppNamespaceState* self = NULL;
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (current_ns_uri != NULL, NULL);
	self = (XmppNamespaceState*) xmpp_namespace_state_construct_copy (object_type, old);
	xmpp_namespace_state_set_current (self, current_ns_uri);
	return self;
}

XmppNamespaceState*
xmpp_namespace_state_new_with_current (XmppNamespaceState* old,
                                       const gchar* current_ns_uri)
{
	return xmpp_namespace_state_construct_with_current (XMPP_TYPE_NAMESPACE_STATE, old, current_ns_uri);
}

void
xmpp_namespace_state_add_assoc (XmppNamespaceState* self,
                                const gchar* ns_uri,
                                const gchar* name)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (ns_uri != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->name_to_uri;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, name, ns_uri);
	_tmp1_ = self->priv->uri_to_name;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp1_, ns_uri, name);
}

void
xmpp_namespace_state_set_current (XmppNamespaceState* self,
                                  const gchar* current_ns_uri)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (current_ns_uri != NULL);
	_tmp0_ = g_strdup (current_ns_uri);
	_g_free0 (self->current_ns_uri);
	self->current_ns_uri = _tmp0_;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

gchar*
xmpp_namespace_state_find_name (XmppNamespaceState* self,
                                const gchar* ns_uri,
                                GError** error)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GError* _tmp6_;
	GError* _tmp7_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (ns_uri != NULL, NULL);
	_tmp0_ = self->priv->uri_to_name;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, ns_uri)) {
		GeeHashMap* _tmp1_;
		gpointer _tmp2_;
		_tmp1_ = self->priv->uri_to_name;
		_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, ns_uri);
		result = (gchar*) _tmp2_;
		return result;
	}
	_tmp3_ = string_to_string (ns_uri);
	_tmp4_ = g_strconcat ("XML: NS URI ", _tmp3_, " not found.", NULL);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_INVALID_DATA, _tmp5_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_inner_error0_ = _tmp7_;
	if (_inner_error0_->domain == G_IO_ERROR) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

gchar*
xmpp_namespace_state_find_uri (XmppNamespaceState* self,
                               const gchar* name,
                               GError** error)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GError* _tmp6_;
	GError* _tmp7_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = self->priv->name_to_uri;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, name)) {
		GeeHashMap* _tmp1_;
		gpointer _tmp2_;
		_tmp1_ = self->priv->name_to_uri;
		_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, name);
		result = (gchar*) _tmp2_;
		return result;
	}
	_tmp3_ = string_to_string (name);
	_tmp4_ = g_strconcat ("XML: NS name ", _tmp3_, " not found.", NULL);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_INVALID_DATA, _tmp5_);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_inner_error0_ = _tmp7_;
	if (_inner_error0_->domain == G_IO_ERROR) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	} else {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return NULL;
	}
}

XmppNamespaceState*
xmpp_namespace_state_push (XmppNamespaceState* self)
{
	XmppNamespaceState* _tmp0_;
	XmppNamespaceState* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = xmpp_namespace_state_new_with_parent (self);
	result = _tmp0_;
	return result;
}

XmppNamespaceState*
xmpp_namespace_state_pop (XmppNamespaceState* self)
{
	XmppNamespaceState* _tmp0_;
	XmppNamespaceState* _tmp1_;
	XmppNamespaceState* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->parent;
	_tmp1_ = _xmpp_namespace_state_ref0 (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
xmpp_namespace_state_to_string (XmppNamespaceState* self)
{
	GString* sb = NULL;
	GString* _tmp0_;
	GString* _tmp1_;
	GString* _tmp20_;
	GString* _tmp21_;
	const gchar* _tmp22_;
	GString* _tmp23_;
	GString* _tmp24_;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_string_new ("");
	sb = _tmp0_;
	_tmp1_ = sb;
	g_string_append (_tmp1_, "NamespaceState{");
	{
		GeeIterator* _key_it = NULL;
		GeeHashMap* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeSet* _tmp5_;
		GeeIterator* _tmp6_;
		GeeIterator* _tmp7_;
		_tmp2_ = self->priv->uri_to_name;
		_tmp3_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_iterable_iterator ((GeeIterable*) _tmp5_);
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
		_key_it = _tmp7_;
		while (TRUE) {
			GeeIterator* _tmp8_;
			gchar* key = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			GString* _tmp11_;
			const gchar* _tmp12_;
			GString* _tmp13_;
			GString* _tmp14_;
			GeeHashMap* _tmp15_;
			const gchar* _tmp16_;
			gpointer _tmp17_;
			gchar* _tmp18_;
			GString* _tmp19_;
			_tmp8_ = _key_it;
			if (!gee_iterator_next (_tmp8_)) {
				break;
			}
			_tmp9_ = _key_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			key = (gchar*) _tmp10_;
			_tmp11_ = sb;
			_tmp12_ = key;
			g_string_append (_tmp11_, _tmp12_);
			_tmp13_ = sb;
			g_string_append_c (_tmp13_, '=');
			_tmp14_ = sb;
			_tmp15_ = self->priv->uri_to_name;
			_tmp16_ = key;
			_tmp17_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp15_, _tmp16_);
			_tmp18_ = (gchar*) _tmp17_;
			g_string_append (_tmp14_, _tmp18_);
			_g_free0 (_tmp18_);
			_tmp19_ = sb;
			g_string_append_c (_tmp19_, ',');
			_g_free0 (key);
		}
		_g_object_unref0 (_key_it);
	}
	_tmp20_ = sb;
	g_string_append (_tmp20_, "current=");
	_tmp21_ = sb;
	_tmp22_ = self->current_ns_uri;
	g_string_append (_tmp21_, _tmp22_);
	_tmp23_ = sb;
	g_string_append_c (_tmp23_, '}');
	_tmp24_ = sb;
	_tmp25_ = _tmp24_->str;
	_tmp26_ = g_strdup (_tmp25_);
	result = _tmp26_;
	_g_string_free0 (sb);
	return result;
}

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

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

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

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

static gchar*
xmpp_value_namespace_state_collect_value (GValue* value,
                                          guint n_collect_values,
                                          GTypeCValue* collect_values,
                                          guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		XmppNamespaceState * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = xmpp_namespace_state_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
xmpp_value_namespace_state_lcopy_value (const GValue* value,
                                        guint n_collect_values,
                                        GTypeCValue* collect_values,
                                        guint collect_flags)
{
	XmppNamespaceState ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = xmpp_namespace_state_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
xmpp_param_spec_namespace_state (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags)
{
	XmppParamSpecNamespaceState* spec;
	g_return_val_if_fail (g_type_is_a (object_type, XMPP_TYPE_NAMESPACE_STATE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
xmpp_value_get_namespace_state (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_TYPE_NAMESPACE_STATE), NULL);
	return value->data[0].v_pointer;
}

void
xmpp_value_set_namespace_state (GValue* value,
                                gpointer v_object)
{
	XmppNamespaceState * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_TYPE_NAMESPACE_STATE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_TYPE_NAMESPACE_STATE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		xmpp_namespace_state_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_namespace_state_unref (old);
	}
}

void
xmpp_value_take_namespace_state (GValue* value,
                                 gpointer v_object)
{
	XmppNamespaceState * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, XMPP_TYPE_NAMESPACE_STATE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, XMPP_TYPE_NAMESPACE_STATE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		xmpp_namespace_state_unref (old);
	}
}

static void
xmpp_namespace_state_class_init (XmppNamespaceStateClass * klass,
                                 gpointer klass_data)
{
	xmpp_namespace_state_parent_class = g_type_class_peek_parent (klass);
	((XmppNamespaceStateClass *) klass)->finalize = xmpp_namespace_state_finalize;
	g_type_class_adjust_private_offset (klass, &XmppNamespaceState_private_offset);
}

static void
xmpp_namespace_state_instance_init (XmppNamespaceState * self,
                                    gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = xmpp_namespace_state_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->uri_to_name = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->name_to_uri = _tmp1_;
	self->ref_count = 1;
}

static void
xmpp_namespace_state_finalize (XmppNamespaceState * obj)
{
	XmppNamespaceState * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_TYPE_NAMESPACE_STATE, XmppNamespaceState);
	g_signal_handlers_destroy (self);
	_g_object_unref0 (self->priv->uri_to_name);
	_g_object_unref0 (self->priv->name_to_uri);
	_g_free0 (self->current_ns_uri);
	_xmpp_namespace_state_unref0 (self->priv->parent);
}

static GType
xmpp_namespace_state_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { xmpp_value_namespace_state_init, xmpp_value_namespace_state_free_value, xmpp_value_namespace_state_copy_value, xmpp_value_namespace_state_peek_pointer, "p", xmpp_value_namespace_state_collect_value, "p", xmpp_value_namespace_state_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (XmppNamespaceStateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_namespace_state_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppNamespaceState), 0, (GInstanceInitFunc) xmpp_namespace_state_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType xmpp_namespace_state_type_id;
	xmpp_namespace_state_type_id = g_type_register_fundamental (g_type_fundamental_next (), "XmppNamespaceState", &g_define_type_info, &g_define_type_fundamental_info, 0);
	XmppNamespaceState_private_offset = g_type_add_instance_private (xmpp_namespace_state_type_id, sizeof (XmppNamespaceStatePrivate));
	return xmpp_namespace_state_type_id;
}

GType
xmpp_namespace_state_get_type (void)
{
	static volatile gsize xmpp_namespace_state_type_id__once = 0;
	if (g_once_init_enter (&xmpp_namespace_state_type_id__once)) {
		GType xmpp_namespace_state_type_id;
		xmpp_namespace_state_type_id = xmpp_namespace_state_get_type_once ();
		g_once_init_leave (&xmpp_namespace_state_type_id__once, xmpp_namespace_state_type_id);
	}
	return xmpp_namespace_state_type_id__once;
}

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

void
xmpp_namespace_state_unref (gpointer instance)
{
	XmppNamespaceState * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		XMPP_NAMESPACE_STATE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

