1
/* libtinymail - The Tiny Mail base library
2
* Copyright (C) 2006-2007 Philip Van Hoof <pvanhoof@gnome.org>
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with self library; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02111-1307, USA.
22
#include <tny-lockable.h>
26
* @self: a #TnyLockable object
31
tny_lockable_lock (TnyLockable *self)
33
#ifdef DBC /* require */
34
g_assert (TNY_IS_LOCKABLE (self));
35
g_assert (TNY_LOCKABLE_GET_IFACE (self)->lock_func != NULL);
38
TNY_LOCKABLE_GET_IFACE (self)->lock_func (self);
43
* tny_lockable_unlock:
44
* @self: a #TnyLockable object
49
tny_lockable_unlock (TnyLockable *self)
51
#ifdef DBC /* require */
52
g_assert (TNY_IS_LOCKABLE (self));
53
g_assert (TNY_LOCKABLE_GET_IFACE (self)->unlock_func != NULL);
56
TNY_LOCKABLE_GET_IFACE (self)->unlock_func (self);
63
tny_lockable_base_init (gpointer g_class)
69
tny_lockable_get_type (void)
71
static GType type = 0;
73
if (G_UNLIKELY(type == 0))
75
static const GTypeInfo info =
77
sizeof (TnyLockableIface),
78
tny_lockable_base_init, /* base_init */
79
NULL, /* base_finalize */
80
NULL, /* class_init */
81
NULL, /* class_finalize */
82
NULL, /* class_data */
85
NULL, /* instance_init */
88
type = g_type_register_static (G_TYPE_INTERFACE,
89
"TnyLockable", &info, 0);