/* rygel-updatable-object.c generated by valac 0.56.19, the Vala compiler
 * generated from rygel-updatable-object.vala, do not modify */

/*
 * Copyright (C) 2012 Intel Corporation.
 *
 * Author: Krzesimir Nowak <krnowak@openismus.com>
 *
 * This file is part of Rygel.
 *
 * Rygel 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.
 *
 * Rygel is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "rygel-server.h"
#include <gio/gio.h>
#include <glib.h>
#include <string.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 rygel_updatable_object_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

void
rygel_updatable_object_commit (RygelUpdatableObject* self,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	RygelUpdatableObjectIface* _iface_;
	_iface_ = RYGEL_UPDATABLE_OBJECT_GET_INTERFACE (self);
	if (_iface_->commit) {
		_iface_->commit (self, _callback_, _user_data_);
	}
}

void
rygel_updatable_object_commit_finish (RygelUpdatableObject* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	RygelUpdatableObjectIface* _iface_;
	_iface_ = RYGEL_UPDATABLE_OBJECT_GET_INTERFACE (self);
	if (_iface_->commit_finish) {
		_iface_->commit_finish (self, _res_, error);
	}
}

static void
rygel_updatable_object_default_init (RygelUpdatableObjectIface * iface,
                                     gpointer iface_data)
{
}

/**
 * This interface should be implemented by 'updatable' objects - ones
 * that allow modifying their own metadata in some persistent storage.
 */
 G_GNUC_NO_INLINE static GType
rygel_updatable_object_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (RygelUpdatableObjectIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_updatable_object_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType rygel_updatable_object_type_id;
	rygel_updatable_object_type_id = g_type_register_static (G_TYPE_INTERFACE, "RygelUpdatableObject", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (rygel_updatable_object_type_id, RYGEL_TYPE_MEDIA_OBJECT);
	return rygel_updatable_object_type_id;
}

GType
rygel_updatable_object_get_type (void)
{
	static volatile gsize rygel_updatable_object_type_id__once = 0;
	if (g_once_init_enter (&rygel_updatable_object_type_id__once)) {
		GType rygel_updatable_object_type_id;
		rygel_updatable_object_type_id = rygel_updatable_object_get_type_once ();
		g_once_init_leave (&rygel_updatable_object_type_id__once, rygel_updatable_object_type_id);
	}
	return rygel_updatable_object_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;
}

