new function to get the GType given a RegisteredTypeInfo

2008-04-22  Havoc Pennington  <hp@pobox.com>

 	* girepository/ginfo.c (g_registered_type_info_get_g_type): new
	function to get the GType given a RegisteredTypeInfo


svn path=/trunk/; revision=216
This commit is contained in:
Havoc Pennington 2008-04-23 00:57:48 +00:00 committed by Havoc Pennington
parent 4ff71171a9
commit db7b378221
2 changed files with 20 additions and 1 deletions

19
ginfo.c
View File

@ -968,6 +968,25 @@ g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info)
return NULL;
}
GType
g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info)
{
const char *type_init;
GType (* get_type_func) (void);
type_init = g_registered_type_info_get_type_init (info);
if (type_init == NULL)
return G_TYPE_NONE;
get_type_func = NULL;
if (!g_module_symbol (((GIBaseInfo*)info)->metadata->module,
type_init,
(void**) &get_type_func))
return G_TYPE_NONE;
return (* get_type_func) ();
}
/* GIStructInfo functions */
gint

View File

@ -350,7 +350,7 @@ GIFunctionInfo * g_struct_info_find_method (GIStructInfo *info,
const gchar * g_registered_type_info_get_type_name (GIRegisteredTypeInfo *info);
const gchar * g_registered_type_info_get_type_init (GIRegisteredTypeInfo *info);
GType g_registered_type_info_get_g_type (GIRegisteredTypeInfo *info);
/* GIEnumInfo */