summaryrefslogtreecommitdiff
path: root/girepository
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2008-04-23 00:57:48 +0000
committerHavoc Pennington <hp@src.gnome.org>2008-04-23 00:57:48 +0000
commit8f3a4b04f6c17ab6f69ea7ad4cbf87c70840ce20 (patch)
treeb7161a7986ab0bb51600257bad471df4df48f731 /girepository
parent72a7ca914bc9e3840e60d3da2411540abd8f5705 (diff)
downloadgobject-introspection-8f3a4b04f6c17ab6f69ea7ad4cbf87c70840ce20.tar.gz
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
Diffstat (limited to 'girepository')
-rw-r--r--girepository/ginfo.c19
-rw-r--r--girepository/girepository.h2
2 files changed, 20 insertions, 1 deletions
diff --git a/girepository/ginfo.c b/girepository/ginfo.c
index 6d66de21..1707fa83 100644
--- a/girepository/ginfo.c
+++ b/girepository/ginfo.c
@@ -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
diff --git a/girepository/girepository.h b/girepository/girepository.h
index 7ad1067a..fa625aa2 100644
--- a/girepository/girepository.h
+++ b/girepository/girepository.h
@@ -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 */