summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-07-28 12:24:10 +0200
committerTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-07-28 12:24:10 +0200
commit04167774e2d03b0032d1a366c3ac0d0364e4f29f (patch)
treeff0a2adaa073980c21b9f81244ab5ab00f6b4d4e
parent5888b86c1fc88f4003ea5b0812df7f17cd931969 (diff)
downloadgobject-introspection-04167774e2d03b0032d1a366c3ac0d0364e4f29f.tar.gz
Add g_info_type_to_string (GIInfoType type)
-rw-r--r--girepository/girepository.c56
-rw-r--r--girepository/gitypeinfo.h1
2 files changed, 57 insertions, 0 deletions
diff --git a/girepository/girepository.c b/girepository/girepository.c
index 6aae2457..bc2c0873 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 4d33d31e..39890a7d 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);