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

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "xmpp-vala.h"

#define XMPP_XEP_MESSAGE_PROCESSING_HINTS_NS_URI "urn:xmpp:hints"
#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 _xmpp_stanza_entry_unref0(var) ((var == NULL) ? NULL : (var = (xmpp_stanza_entry_unref (var), NULL)))

static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

void
xmpp_xep_message_processing_hints_set_message_hint (XmppMessageStanza* message,
                                                    const gchar* message_hint)
{
	XmppStanzaNode* hint_node = NULL;
	XmppStanzaNode* _tmp0_;
	XmppStanzaNode* _tmp1_;
	XmppStanzaNode* _tmp2_;
	XmppStanzaNode* _tmp3_;
	XmppStanzaNode* _tmp4_;
	XmppStanzaNode* _tmp5_;
	XmppStanzaNode* _tmp6_;
	g_return_if_fail (message != NULL);
	g_return_if_fail (message_hint != NULL);
	_tmp0_ = xmpp_stanza_node_new_build (message_hint, XMPP_XEP_MESSAGE_PROCESSING_HINTS_NS_URI, NULL, NULL);
	_tmp1_ = _tmp0_;
	_tmp2_ = xmpp_stanza_node_add_self_xmlns (_tmp1_);
	_tmp3_ = _tmp2_;
	_xmpp_stanza_entry_unref0 (_tmp1_);
	hint_node = _tmp3_;
	_tmp4_ = ((XmppStanza*) message)->stanza;
	_tmp5_ = xmpp_stanza_node_put_node (_tmp4_, hint_node);
	_tmp6_ = _tmp5_;
	_xmpp_stanza_entry_unref0 (_tmp6_);
	_xmpp_stanza_entry_unref0 (hint_node);
}

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

