[gobject-introspection] Add g_info_type_to_string (GIInfoType type)
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Add g_info_type_to_string (GIInfoType type)
- Date: Wed, 28 Jul 2010 10:24:17 +0000 (UTC)
commit 04167774e2d03b0032d1a366c3ac0d0364e4f29f
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date: Wed Jul 28 12:24:10 2010 +0200
Add g_info_type_to_string (GIInfoType type)
girepository/girepository.c | 56 +++++++++++++++++++++++++++++++++++++++++++
girepository/gitypeinfo.h | 1 +
2 files changed, 57 insertions(+), 0 deletions(-)
---
diff --git a/girepository/girepository.c b/girepository/girepository.c
index 6aae245..bc2c087 100644
--- a/girepository/girepository.c
+++ b/girepository/girepository.c
@@ -1403,3 +1403,59 @@ g_type_tag_to_string (GITypeTag type)
return "unknown";
}
}
+
+/**
+ * g_info_type_to_string:
+ * @type: info type
+ *
+ * Returns: (transfer none): Description for this info type
+ */
+const gchar*
+g_info_type_to_string (GIInfoType type)
+{
+ switch (type)
+ {
+ case GI_INFO_TYPE_INVALID:
+ return "invalid";
+ case GI_INFO_TYPE_FUNCTION:
+ return "function";
+ case GI_INFO_TYPE_CALLBACK:
+ return "callback";
+ case GI_INFO_TYPE_STRUCT:
+ return "struct";
+ case GI_INFO_TYPE_BOXED:
+ return "boxed";
+ case GI_INFO_TYPE_ENUM:
+ return "enum";
+ case GI_INFO_TYPE_FLAGS:
+ return "flags";
+ case GI_INFO_TYPE_OBJECT:
+ return "object";
+ case GI_INFO_TYPE_INTERFACE:
+ return "interface";
+ case GI_INFO_TYPE_CONSTANT:
+ return "constant";
+ case GI_INFO_TYPE_ERROR_DOMAIN:
+ return "error domain";
+ case GI_INFO_TYPE_UNION:
+ return "union";
+ case GI_INFO_TYPE_VALUE:
+ return "value";
+ case GI_INFO_TYPE_SIGNAL:
+ return "signal";
+ case GI_INFO_TYPE_VFUNC:
+ return "vfunc";
+ case GI_INFO_TYPE_PROPERTY:
+ return "property";
+ case GI_INFO_TYPE_FIELD:
+ return "field";
+ case GI_INFO_TYPE_ARG:
+ return "arg";
+ case GI_INFO_TYPE_TYPE:
+ return "type";
+ case GI_INFO_TYPE_UNRESOLVED:
+ return "unresolved";
+ default:
+ return "unknown";
+ }
+}
diff --git a/girepository/gitypeinfo.h b/girepository/gitypeinfo.h
index 4d33d31..39890a7 100644
--- a/girepository/gitypeinfo.h
+++ b/girepository/gitypeinfo.h
@@ -36,6 +36,7 @@ G_BEGIN_DECLS
#define G_TYPE_TAG_IS_BASIC(tag) (tag < GI_TYPE_TAG_ARRAY)
const gchar* g_type_tag_to_string (GITypeTag type);
+const gchar* g_info_type_to_string (GIInfoType type);
gboolean g_type_info_is_pointer (GITypeInfo *info);
GITypeTag g_type_info_get_tag (GITypeInfo *info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]