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

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

static GType xmpp_xep_jingle_security_precondition_get_type_once (void);
static GType xmpp_xep_jingle_security_parameters_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

gchar*
xmpp_xep_jingle_security_precondition_security_ns_uri (XmppXepJingleSecurityPrecondition* self)
{
	XmppXepJingleSecurityPreconditionIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_SECURITY_PRECONDITION_GET_INTERFACE (self);
	if (_iface_->security_ns_uri) {
		return _iface_->security_ns_uri (self);
	}
	return NULL;
}

XmppXepJingleSecurityParameters*
xmpp_xep_jingle_security_precondition_create_security_parameters (XmppXepJingleSecurityPrecondition* self,
                                                                  XmppXmppStream* stream,
                                                                  XmppJid* local_full_jid,
                                                                  XmppJid* peer_full_jid,
                                                                  GObject* options,
                                                                  GError** error)
{
	XmppXepJingleSecurityPreconditionIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_SECURITY_PRECONDITION_GET_INTERFACE (self);
	if (_iface_->create_security_parameters) {
		return _iface_->create_security_parameters (self, stream, local_full_jid, peer_full_jid, options, error);
	}
	return NULL;
}

XmppXepJingleSecurityParameters*
xmpp_xep_jingle_security_precondition_parse_security_parameters (XmppXepJingleSecurityPrecondition* self,
                                                                 XmppXmppStream* stream,
                                                                 XmppJid* local_full_jid,
                                                                 XmppJid* peer_full_jid,
                                                                 XmppStanzaNode* security,
                                                                 GError** error)
{
	XmppXepJingleSecurityPreconditionIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_SECURITY_PRECONDITION_GET_INTERFACE (self);
	if (_iface_->parse_security_parameters) {
		return _iface_->parse_security_parameters (self, stream, local_full_jid, peer_full_jid, security, error);
	}
	return NULL;
}

static void
xmpp_xep_jingle_security_precondition_default_init (XmppXepJingleSecurityPreconditionIface * iface,
                                                    gpointer iface_data)
{
}

static GType
xmpp_xep_jingle_security_precondition_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleSecurityPreconditionIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_security_precondition_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType xmpp_xep_jingle_security_precondition_type_id;
	xmpp_xep_jingle_security_precondition_type_id = g_type_register_static (G_TYPE_INTERFACE, "XmppXepJingleSecurityPrecondition", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (xmpp_xep_jingle_security_precondition_type_id, G_TYPE_OBJECT);
	return xmpp_xep_jingle_security_precondition_type_id;
}

GType
xmpp_xep_jingle_security_precondition_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_security_precondition_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_security_precondition_type_id__once)) {
		GType xmpp_xep_jingle_security_precondition_type_id;
		xmpp_xep_jingle_security_precondition_type_id = xmpp_xep_jingle_security_precondition_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_security_precondition_type_id__once, xmpp_xep_jingle_security_precondition_type_id);
	}
	return xmpp_xep_jingle_security_precondition_type_id__once;
}

gchar*
xmpp_xep_jingle_security_parameters_security_ns_uri (XmppXepJingleSecurityParameters* self)
{
	XmppXepJingleSecurityParametersIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_SECURITY_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->security_ns_uri) {
		return _iface_->security_ns_uri (self);
	}
	return NULL;
}

XmppStanzaNode*
xmpp_xep_jingle_security_parameters_to_security_stanza_node (XmppXepJingleSecurityParameters* self,
                                                             XmppXmppStream* stream,
                                                             XmppJid* local_full_jid,
                                                             XmppJid* peer_full_jid)
{
	XmppXepJingleSecurityParametersIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_SECURITY_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->to_security_stanza_node) {
		return _iface_->to_security_stanza_node (self, stream, local_full_jid, peer_full_jid);
	}
	return NULL;
}

GIOStream*
xmpp_xep_jingle_security_parameters_wrap_stream (XmppXepJingleSecurityParameters* self,
                                                 GIOStream* stream)
{
	XmppXepJingleSecurityParametersIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = XMPP_XEP_JINGLE_SECURITY_PARAMETERS_GET_INTERFACE (self);
	if (_iface_->wrap_stream) {
		return _iface_->wrap_stream (self, stream);
	}
	return NULL;
}

static void
xmpp_xep_jingle_security_parameters_default_init (XmppXepJingleSecurityParametersIface * iface,
                                                  gpointer iface_data)
{
}

static GType
xmpp_xep_jingle_security_parameters_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (XmppXepJingleSecurityParametersIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) xmpp_xep_jingle_security_parameters_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType xmpp_xep_jingle_security_parameters_type_id;
	xmpp_xep_jingle_security_parameters_type_id = g_type_register_static (G_TYPE_INTERFACE, "XmppXepJingleSecurityParameters", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (xmpp_xep_jingle_security_parameters_type_id, G_TYPE_OBJECT);
	return xmpp_xep_jingle_security_parameters_type_id;
}

GType
xmpp_xep_jingle_security_parameters_get_type (void)
{
	static volatile gsize xmpp_xep_jingle_security_parameters_type_id__once = 0;
	if (g_once_init_enter (&xmpp_xep_jingle_security_parameters_type_id__once)) {
		GType xmpp_xep_jingle_security_parameters_type_id;
		xmpp_xep_jingle_security_parameters_type_id = xmpp_xep_jingle_security_parameters_get_type_once ();
		g_once_init_leave (&xmpp_xep_jingle_security_parameters_type_id__once, xmpp_xep_jingle_security_parameters_type_id);
	}
	return xmpp_xep_jingle_security_parameters_type_id__once;
}

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

