mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Add g_type_interface_prerequisites.
This commit is contained in:
parent
f861d72bb2
commit
1565a2027e
@ -1,3 +1,7 @@
|
||||
2002-10-15 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gobject/gobject-sections.txt: Add g_type_interface_prerequisites.
|
||||
|
||||
2002-10-14 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gobject/Makefile.am (dist-hook):
|
||||
|
@ -55,6 +55,7 @@ g_type_interface_peek
|
||||
g_type_interface_peek_parent
|
||||
g_type_children
|
||||
g_type_interfaces
|
||||
g_type_interface_prerequisites
|
||||
g_type_set_qdata
|
||||
g_type_get_qdata
|
||||
g_type_query
|
||||
|
@ -1,3 +1,8 @@
|
||||
2002-10-15 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtype.c (g_type_interface_prerequisites): New function to obtain
|
||||
the prerequisites of an interface type.
|
||||
|
||||
Sat Oct 12 22:02:32 2002 Tim Janik <timj@gtk.org>
|
||||
|
||||
* merged up from 2.0:
|
||||
|
@ -1220,6 +1220,52 @@ g_type_interface_add_prerequisite (GType interface_type,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* g_type_interface_prerequisites:
|
||||
* @interface_type: an interface type
|
||||
* @n_prerequisites: location to return the number of prerequisites, or %NULL
|
||||
*
|
||||
* Returns the prerequisites of an interfaces type.
|
||||
*
|
||||
* Return value: a newly-allocated zero-terminated array of #GType containing
|
||||
* the prerequisites of @interface_type
|
||||
**/
|
||||
GType* /* free result */
|
||||
g_type_interface_prerequisites (GType interface_type,
|
||||
guint *n_prerequisites)
|
||||
{
|
||||
TypeNode *iface;
|
||||
|
||||
g_return_val_if_fail (G_TYPE_IS_INTERFACE (interface_type), NULL);
|
||||
|
||||
iface = lookup_type_node_I (interface_type);
|
||||
if (iface)
|
||||
{
|
||||
GType *prerequisites;
|
||||
guint i;
|
||||
|
||||
G_READ_LOCK (&type_rw_lock);
|
||||
prerequisites = g_new (GType, IFACE_NODE_N_PREREQUISITES (iface) + 1);
|
||||
for (i = 0; i < IFACE_NODE_N_PREREQUISITES (iface); i++)
|
||||
prerequisites[i] = IFACE_NODE_PREREQUISITES (iface)[i];
|
||||
prerequisites[i] = 0;
|
||||
|
||||
if (n_prerequisites)
|
||||
*n_prerequisites = IFACE_NODE_N_PREREQUISITES (iface);
|
||||
G_READ_UNLOCK (&type_rw_lock);
|
||||
|
||||
return prerequisites;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (n_prerequisites)
|
||||
*n_prerequisites = 0;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static IFaceHolder*
|
||||
type_iface_peek_holder_L (TypeNode *iface,
|
||||
GType instance_type)
|
||||
|
@ -295,6 +295,8 @@ void g_type_add_interface_dynamic (GType instance_type,
|
||||
GTypePlugin *plugin);
|
||||
void g_type_interface_add_prerequisite (GType interface_type,
|
||||
GType prerequisite_type);
|
||||
GType *g_type_interface_prerequisites (GType interface_type,
|
||||
guint *n_prerequisites);
|
||||
|
||||
|
||||
/* --- protected (for fundamental type implementations) --- */
|
||||
|
Loading…
Reference in New Issue
Block a user