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

#include "xmpp-vala.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.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

enum  {
	XMPP_STANZA_0_PROPERTY,
	XMPP_STANZA_FROM_PROPERTY,
	XMPP_STANZA_ID_PROPERTY,
	XMPP_STANZA_TO_PROPERTY,
	XMPP_STANZA_TYPE__PROPERTY,
	XMPP_STANZA_NUM_PROPERTIES
};
static GParamSpec* xmpp_stanza_properties[XMPP_STANZA_NUM_PROPERTIES];
#define _xmpp_jid_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_jid_unref (var), NULL)))
#define _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _XmppStanzaPrivate {
	XmppJid* my_jid;
	XmppJid* from_;
	XmppJid* to_;
};

static gint XmppStanza_private_offset;
static gpointer xmpp_stanza_parent_class = NULL;

static void xmpp_stanza_finalize (GObject * obj);
static GType xmpp_stanza_get_type_once (void);
static void _vala_xmpp_stanza_get_property (GObject * object,
                                     guint property_id,
                                     GValue * value,
                                     GParamSpec * pspec);
static void _vala_xmpp_stanza_set_property (GObject * object,
                                     guint property_id,
                                     const GValue * value,
                                     GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
xmpp_stanza_get_instance_private (XmppStanza* self)
{
	return G_STRUCT_MEMBER_P (self, XmppStanza_private_offset);
}

static gpointer
_xmpp_stanza_entry_ref0 (gpointer self)
{
	return self ? xmpp_stanza_entry_ref (self) : NULL;
}

static gpointer
_xmpp_jid_ref0 (gpointer self)
{
	return self ? xmpp_jid_ref (self) : NULL;
}

XmppStanza*
xmpp_stanza_construct_incoming (GType object_type,
                                XmppStanzaNode* stanza,
                                XmppJid* my_jid)
{
	XmppStanza * self = NULL;
	XmppStanzaNode* _tmp0_;
	XmppJid* _tmp1_;
	g_return_val_if_fail (stanza != NULL, NULL);
	self = (XmppStanza*) g_object_new (object_type, NULL);
	_tmp0_ = _xmpp_stanza_entry_ref0 (stanza);
	_xmpp_stanza_entry_unref0 (self->stanza);
	self->stanza = _tmp0_;
	_tmp1_ = _xmpp_jid_ref0 (my_jid);
	_xmpp_jid_unref0 (self->priv->my_jid);
	self->priv->my_jid = _tmp1_;
	return self;
}

XmppStanza*
xmpp_stanza_new_incoming (XmppStanzaNode* stanza,
                          XmppJid* my_jid)
{
	return xmpp_stanza_construct_incoming (XMPP_TYPE_STANZA, stanza, my_jid);
}

XmppStanza*
xmpp_stanza_construct_outgoing (GType object_type,
                                XmppStanzaNode* stanza)
{
	XmppStanza * self = NULL;
	XmppStanzaNode* _tmp0_;
	g_return_val_if_fail (stanza != NULL, NULL);
	self = (XmppStanza*) g_object_new (object_type, NULL);
	_tmp0_ = _xmpp_stanza_entry_ref0 (stanza);
	_xmpp_stanza_entry_unref0 (self->stanza);
	self->stanza = _tmp0_;
	return self;
}

XmppStanza*
xmpp_stanza_new_outgoing (XmppStanzaNode* stanza)
{
	return xmpp_stanza_construct_outgoing (XMPP_TYPE_STANZA, stanza);
}

gboolean
xmpp_stanza_is_error (XmppStanza* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = xmpp_stanza_get_type_ (self);
	_tmp1_ = _tmp0_;
	result = g_strcmp0 (_tmp1_, XMPP_STANZA_TYPE_ERROR) == 0;
	return result;
}

XmppErrorStanza*
xmpp_stanza_get_error (XmppStanza* self)
{
	XmppStanzaNode* _tmp0_;
	XmppErrorStanza* _tmp1_;
	XmppErrorStanza* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->stanza;
	_tmp1_ = xmpp_error_stanza_from_stanza (_tmp0_);
	result = _tmp1_;
	return result;
}

XmppStanza*
xmpp_stanza_construct (GType object_type)
{
	XmppStanza * self = NULL;
	self = (XmppStanza*) g_object_new (object_type, NULL);
	return self;
}

XmppStanza*
xmpp_stanza_new (void)
{
	return xmpp_stanza_construct (XMPP_TYPE_STANZA);
}

XmppJid*
xmpp_stanza_get_from (XmppStanza* self)
{
	XmppStanzaClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = XMPP_STANZA_GET_CLASS (self);
	if (_klass_->get_from) {
		return _klass_->get_from (self);
	}
	return NULL;
}

static XmppJid*
xmpp_stanza_real_get_from (XmppStanza* base)
{
	XmppJid* result;
	XmppStanza* self;
	gchar* from_attribute = NULL;
	XmppStanzaNode* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	XmppJid* _tmp12_;
	GError* _inner_error0_ = NULL;
	self = base;
	_tmp0_ = self->stanza;
	_tmp1_ = xmpp_stanza_node_get_attribute (_tmp0_, XMPP_STANZA_ATTRIBUTE_FROM, NULL);
	_tmp2_ = g_strdup (_tmp1_);
	from_attribute = _tmp2_;
	_tmp3_ = from_attribute;
	if (_tmp3_ != NULL) {
		{
			XmppJid* _tmp4_ = NULL;
			const gchar* _tmp5_;
			XmppJid* _tmp6_;
			XmppJid* _tmp7_;
			XmppJid* _tmp8_;
			XmppJid* _tmp9_;
			_tmp5_ = from_attribute;
			_tmp6_ = xmpp_jid_new (_tmp5_, &_inner_error0_);
			_tmp4_ = _tmp6_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					goto __catch0_xmpp_invalid_jid_error;
				}
				_g_free0 (from_attribute);
				g_critical ("file %s: line %d: unexpected 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;
			}
			_tmp7_ = _tmp4_;
			_tmp4_ = NULL;
			_xmpp_jid_unref0 (self->priv->from_);
			self->priv->from_ = _tmp7_;
			_tmp8_ = self->priv->from_;
			_tmp9_ = _xmpp_jid_ref0 (_tmp8_);
			result = _tmp9_;
			_xmpp_jid_unref0 (_tmp4_);
			_g_free0 (from_attribute);
			return result;
		}
		goto __finally0;
		__catch0_xmpp_invalid_jid_error:
		{
			GError* e = NULL;
			GError* _tmp10_;
			const gchar* _tmp11_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp10_ = e;
			_tmp11_ = _tmp10_->message;
			g_warning ("stanza.vala:25: Ignoring invalid from Jid: %s", _tmp11_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_free0 (from_attribute);
			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;
		}
	}
	_tmp12_ = self->priv->my_jid;
	if (_tmp12_ != NULL) {
		XmppJid* _tmp13_;
		XmppJid* _tmp14_;
		XmppJid* _tmp15_;
		_tmp13_ = self->priv->my_jid;
		_tmp14_ = xmpp_jid_get_bare_jid (_tmp13_);
		_tmp15_ = _tmp14_;
		result = _tmp15_;
		_g_free0 (from_attribute);
		return result;
	}
	result = NULL;
	_g_free0 (from_attribute);
	return result;
}

void
xmpp_stanza_set_from (XmppStanza* self,
                      XmppJid* value)
{
	XmppStanzaClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_STANZA_GET_CLASS (self);
	if (_klass_->set_from) {
		_klass_->set_from (self, value);
	}
}

static void
xmpp_stanza_real_set_from (XmppStanza* base,
                           XmppJid* value)
{
	XmppStanza* self;
	XmppStanzaNode* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	self = base;
	_tmp0_ = self->stanza;
	_tmp1_ = xmpp_jid_to_string (value);
	_tmp2_ = _tmp1_;
	xmpp_stanza_node_set_attribute (_tmp0_, XMPP_STANZA_ATTRIBUTE_FROM, _tmp2_, NULL);
	_g_free0 (_tmp2_);
	g_object_notify_by_pspec ((GObject *) self, xmpp_stanza_properties[XMPP_STANZA_FROM_PROPERTY]);
}

const gchar*
xmpp_stanza_get_id (XmppStanza* self)
{
	XmppStanzaClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = XMPP_STANZA_GET_CLASS (self);
	if (_klass_->get_id) {
		return _klass_->get_id (self);
	}
	return NULL;
}

static const gchar*
xmpp_stanza_real_get_id (XmppStanza* base)
{
	const gchar* result;
	XmppStanza* self;
	XmppStanzaNode* _tmp0_;
	const gchar* _tmp1_;
	self = base;
	_tmp0_ = self->stanza;
	_tmp1_ = xmpp_stanza_node_get_attribute (_tmp0_, XMPP_STANZA_ATTRIBUTE_ID, NULL);
	result = _tmp1_;
	return result;
}

void
xmpp_stanza_set_id (XmppStanza* self,
                    const gchar* value)
{
	XmppStanzaClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_STANZA_GET_CLASS (self);
	if (_klass_->set_id) {
		_klass_->set_id (self, value);
	}
}

static void
xmpp_stanza_real_set_id (XmppStanza* base,
                         const gchar* value)
{
	XmppStanza* self;
	XmppStanzaNode* _tmp0_;
	self = base;
	_tmp0_ = self->stanza;
	xmpp_stanza_node_set_attribute (_tmp0_, XMPP_STANZA_ATTRIBUTE_ID, value, NULL);
	g_object_notify_by_pspec ((GObject *) self, xmpp_stanza_properties[XMPP_STANZA_ID_PROPERTY]);
}

XmppJid*
xmpp_stanza_get_to (XmppStanza* self)
{
	XmppStanzaClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = XMPP_STANZA_GET_CLASS (self);
	if (_klass_->get_to) {
		return _klass_->get_to (self);
	}
	return NULL;
}

static XmppJid*
xmpp_stanza_real_get_to (XmppStanza* base)
{
	XmppJid* result;
	XmppStanza* self;
	gchar* to_attribute = NULL;
	XmppStanzaNode* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	XmppJid* _tmp14_;
	XmppJid* _tmp15_;
	GError* _inner_error0_ = NULL;
	self = base;
	_tmp0_ = self->stanza;
	_tmp1_ = xmpp_stanza_node_get_attribute (_tmp0_, XMPP_STANZA_ATTRIBUTE_TO, NULL);
	_tmp2_ = g_strdup (_tmp1_);
	to_attribute = _tmp2_;
	{
		XmppJid* _tmp3_ = NULL;
		const gchar* _tmp4_;
		XmppJid* _tmp11_;
		_tmp4_ = to_attribute;
		if (_tmp4_ == NULL) {
			XmppJid* _tmp5_;
			_tmp5_ = self->priv->my_jid;
			_tmp3_ = _tmp5_;
		} else {
			XmppJid* _tmp6_ = NULL;
			const gchar* _tmp7_;
			XmppJid* _tmp8_;
			XmppJid* _tmp9_;
			XmppJid* _tmp10_;
			_tmp7_ = to_attribute;
			_tmp8_ = xmpp_jid_new (_tmp7_, &_inner_error0_);
			_tmp6_ = _tmp8_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				if (_inner_error0_->domain == XMPP_INVALID_JID_ERROR) {
					goto __catch0_xmpp_invalid_jid_error;
				}
				_g_free0 (to_attribute);
				g_critical ("file %s: line %d: unexpected 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;
			}
			_tmp9_ = _tmp6_;
			_tmp6_ = NULL;
			_xmpp_jid_unref0 (self->priv->to_);
			self->priv->to_ = _tmp9_;
			_tmp10_ = self->priv->to_;
			_tmp3_ = _tmp10_;
			_xmpp_jid_unref0 (_tmp6_);
		}
		_tmp11_ = _xmpp_jid_ref0 (_tmp3_);
		result = _tmp11_;
		_g_free0 (to_attribute);
		return result;
	}
	goto __finally0;
	__catch0_xmpp_invalid_jid_error:
	{
		GError* e = NULL;
		GError* _tmp12_;
		const gchar* _tmp13_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp12_ = e;
		_tmp13_ = _tmp12_->message;
		g_warning ("stanza.vala:49: Ignoring invalid to Jid: %s", _tmp13_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_free0 (to_attribute);
		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;
	}
	_tmp14_ = self->priv->my_jid;
	_tmp15_ = _xmpp_jid_ref0 (_tmp14_);
	result = _tmp15_;
	_g_free0 (to_attribute);
	return result;
}

void
xmpp_stanza_set_to (XmppStanza* self,
                    XmppJid* value)
{
	XmppStanzaClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_STANZA_GET_CLASS (self);
	if (_klass_->set_to) {
		_klass_->set_to (self, value);
	}
}

static void
xmpp_stanza_real_set_to (XmppStanza* base,
                         XmppJid* value)
{
	XmppStanza* self;
	XmppStanzaNode* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	self = base;
	_tmp0_ = self->stanza;
	_tmp1_ = xmpp_jid_to_string (value);
	_tmp2_ = _tmp1_;
	xmpp_stanza_node_set_attribute (_tmp0_, XMPP_STANZA_ATTRIBUTE_TO, _tmp2_, NULL);
	_g_free0 (_tmp2_);
	g_object_notify_by_pspec ((GObject *) self, xmpp_stanza_properties[XMPP_STANZA_TO_PROPERTY]);
}

const gchar*
xmpp_stanza_get_type_ (XmppStanza* self)
{
	XmppStanzaClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = XMPP_STANZA_GET_CLASS (self);
	if (_klass_->get_type_) {
		return _klass_->get_type_ (self);
	}
	return NULL;
}

static const gchar*
xmpp_stanza_real_get_type_ (XmppStanza* base)
{
	const gchar* result;
	XmppStanza* self;
	XmppStanzaNode* _tmp0_;
	const gchar* _tmp1_;
	self = base;
	_tmp0_ = self->stanza;
	_tmp1_ = xmpp_stanza_node_get_attribute (_tmp0_, XMPP_STANZA_ATTRIBUTE_TYPE, NULL);
	result = _tmp1_;
	return result;
}

void
xmpp_stanza_set_type_ (XmppStanza* self,
                       const gchar* value)
{
	XmppStanzaClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = XMPP_STANZA_GET_CLASS (self);
	if (_klass_->set_type_) {
		_klass_->set_type_ (self, value);
	}
}

static void
xmpp_stanza_real_set_type_ (XmppStanza* base,
                            const gchar* value)
{
	XmppStanza* self;
	XmppStanzaNode* _tmp0_;
	self = base;
	_tmp0_ = self->stanza;
	xmpp_stanza_node_set_attribute (_tmp0_, XMPP_STANZA_ATTRIBUTE_TYPE, value, NULL);
	g_object_notify_by_pspec ((GObject *) self, xmpp_stanza_properties[XMPP_STANZA_TYPE__PROPERTY]);
}

static void
xmpp_stanza_class_init (XmppStanzaClass * klass,
                        gpointer klass_data)
{
	xmpp_stanza_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &XmppStanza_private_offset);
	XMPP_STANZA_CLASS (klass)->get_from = (XmppJid* (*) (XmppStanza*)) xmpp_stanza_real_get_from;
	XMPP_STANZA_CLASS (klass)->set_from = (void (*) (XmppStanza*, XmppJid*)) xmpp_stanza_real_set_from;
	XMPP_STANZA_CLASS (klass)->get_id = (const gchar* (*) (XmppStanza*)) xmpp_stanza_real_get_id;
	XMPP_STANZA_CLASS (klass)->set_id = (void (*) (XmppStanza*, const gchar*)) xmpp_stanza_real_set_id;
	XMPP_STANZA_CLASS (klass)->get_to = (XmppJid* (*) (XmppStanza*)) xmpp_stanza_real_get_to;
	XMPP_STANZA_CLASS (klass)->set_to = (void (*) (XmppStanza*, XmppJid*)) xmpp_stanza_real_set_to;
	XMPP_STANZA_CLASS (klass)->get_type_ = (const gchar* (*) (XmppStanza*)) xmpp_stanza_real_get_type_;
	XMPP_STANZA_CLASS (klass)->set_type_ = (void (*) (XmppStanza*, const gchar*)) xmpp_stanza_real_set_type_;
	G_OBJECT_CLASS (klass)->get_property = _vala_xmpp_stanza_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_xmpp_stanza_set_property;
	G_OBJECT_CLASS (klass)->finalize = xmpp_stanza_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_STANZA_FROM_PROPERTY, xmpp_stanza_properties[XMPP_STANZA_FROM_PROPERTY] = xmpp_param_spec_jid ("from", "from", "from", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_STANZA_ID_PROPERTY, xmpp_stanza_properties[XMPP_STANZA_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_STANZA_TO_PROPERTY, xmpp_stanza_properties[XMPP_STANZA_TO_PROPERTY] = xmpp_param_spec_jid ("to", "to", "to", XMPP_TYPE_JID, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), XMPP_STANZA_TYPE__PROPERTY, xmpp_stanza_properties[XMPP_STANZA_TYPE__PROPERTY] = g_param_spec_string ("type-", "type-", "type-", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
xmpp_stanza_instance_init (XmppStanza * self,
                           gpointer klass)
{
	self->priv = xmpp_stanza_get_instance_private (self);
}

static void
xmpp_stanza_finalize (GObject * obj)
{
	XmppStanza * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, XMPP_TYPE_STANZA, XmppStanza);
	_xmpp_jid_unref0 (self->priv->my_jid);
	_xmpp_jid_unref0 (self->priv->from_);
	_xmpp_jid_unref0 (self->priv->to_);
	_xmpp_stanza_entry_unref0 (self->stanza);
	G_OBJECT_CLASS (xmpp_stanza_parent_class)->finalize (obj);
}

static GType
xmpp_stanza_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppStanzaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_stanza_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (XmppStanza), 0, (GInstanceInitFunc) xmpp_stanza_instance_init, NULL };
	GType xmpp_stanza_type_id;
	xmpp_stanza_type_id = g_type_register_static (G_TYPE_OBJECT, "XmppStanza", &g_define_type_info, 0);
	XmppStanza_private_offset = g_type_add_instance_private (xmpp_stanza_type_id, sizeof (XmppStanzaPrivate));
	return xmpp_stanza_type_id;
}

GType
xmpp_stanza_get_type (void)
{
	static volatile gsize xmpp_stanza_type_id__once = 0;
	if (g_once_init_enter (&xmpp_stanza_type_id__once)) {
		GType xmpp_stanza_type_id;
		xmpp_stanza_type_id = xmpp_stanza_get_type_once ();
		g_once_init_leave (&xmpp_stanza_type_id__once, xmpp_stanza_type_id);
	}
	return xmpp_stanza_type_id__once;
}

static void
_vala_xmpp_stanza_get_property (GObject * object,
                                guint property_id,
                                GValue * value,
                                GParamSpec * pspec)
{
	XmppStanza * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_TYPE_STANZA, XmppStanza);
	switch (property_id) {
		case XMPP_STANZA_FROM_PROPERTY:
		xmpp_value_take_jid (value, xmpp_stanza_get_from (self));
		break;
		case XMPP_STANZA_ID_PROPERTY:
		g_value_set_string (value, xmpp_stanza_get_id (self));
		break;
		case XMPP_STANZA_TO_PROPERTY:
		xmpp_value_take_jid (value, xmpp_stanza_get_to (self));
		break;
		case XMPP_STANZA_TYPE__PROPERTY:
		g_value_set_string (value, xmpp_stanza_get_type_ (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_xmpp_stanza_set_property (GObject * object,
                                guint property_id,
                                const GValue * value,
                                GParamSpec * pspec)
{
	XmppStanza * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, XMPP_TYPE_STANZA, XmppStanza);
	switch (property_id) {
		case XMPP_STANZA_FROM_PROPERTY:
		xmpp_stanza_set_from (self, xmpp_value_get_jid (value));
		break;
		case XMPP_STANZA_ID_PROPERTY:
		xmpp_stanza_set_id (self, g_value_get_string (value));
		break;
		case XMPP_STANZA_TO_PROPERTY:
		xmpp_stanza_set_to (self, xmpp_value_get_jid (value));
		break;
		case XMPP_STANZA_TYPE__PROPERTY:
		xmpp_stanza_set_type_ (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

