1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
/*
* Database record interface for DMAP sharing
*
* Copyright (C) 2008 W. Michael Petullo <mike@flyn.org>
*
* This library 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.
*
* This library 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <libdmapsharing/dmap-record.h>
static gint dmap_record_init_count = 0;
static void
dmap_record_init (DMAPRecordIface * iface)
{
dmap_record_init_count++;
}
static void
dmap_record_finalize (DMAPRecordIface * iface)
{
dmap_record_init_count--;
}
/* FIXME: No G_DEFINE_INTERFACE available in GObject headers: */
GType
dmap_record_get_type (void)
{
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
sizeof (DMAPRecordIface),
(GBaseInitFunc) dmap_record_init,
(GBaseFinalizeFunc) dmap_record_finalize
};
object_type =
g_type_register_static (G_TYPE_INTERFACE,
"DMAPRecord",
&object_info, 0);
g_type_interface_add_prerequisite (object_type,
G_TYPE_OBJECT);
}
return object_type;
}
GByteArray *
dmap_record_to_blob (DMAPRecord * record)
{
return DMAP_RECORD_GET_INTERFACE (record)->to_blob (record);
}
gboolean
dmap_record_set_from_blob (DMAPRecord * record, GByteArray * blob)
{
return DMAP_RECORD_GET_INTERFACE (record)->set_from_blob (record,
blob);
}
|