summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Macks <dmacks@netspace.org>2017-04-24 01:52:27 -0400
committerPatrick Griffis <tingping@tingping.se>2017-04-28 06:42:12 -0400
commitab333f42b6cfee1547f3886d92bbdec928ff1767 (patch)
tree7d94aa5f22c3ae719dabeebbfa023cb83f94e798
parentbd555b9ba070df6c47d10a8b83e6b58d7fe94623 (diff)
downloadglib-ab333f42b6cfee1547f3886d92bbdec928ff1767.tar.gz
Implement g_content_type_is_mime_type() (clone of win32's)
Add missing function, copying from gcontenttype-win32.c per Patrick Griffis (Comment #55 of bug report) https://bugzilla.gnome.org/show_bug.cgi?id=734946
-rw-r--r--gio/gosxcontenttype.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gio/gosxcontenttype.c b/gio/gosxcontenttype.c
index 3c223d6b1..8c15ec76e 100644
--- a/gio/gosxcontenttype.c
+++ b/gio/gosxcontenttype.c
@@ -133,6 +133,23 @@ g_content_type_is_a (const gchar *ctype,
}
gboolean
+g_content_type_is_mime_type (const gchar *type,
+ const gchar *mime_type)
+{
+ gchar *content_type;
+ gboolean ret;
+
+ g_return_val_if_fail (type != NULL, FALSE);
+ g_return_val_if_fail (mime_type != NULL, FALSE);
+
+ content_type = g_content_type_from_mime_type (mime_type);
+ ret = g_content_type_is_a (type, content_type);
+ g_free (content_type);
+
+ return ret;
+}
+
+gboolean
g_content_type_is_unknown (const gchar *type)
{
g_return_val_if_fail (type != NULL, FALSE);