summaryrefslogtreecommitdiff
path: root/content/content.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2010-04-07 09:12:09 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2010-04-07 09:12:09 +0000
commit236b6a15e1c458d51ec6f31a6a49b3579e91d2d3 (patch)
treee8f29f2ec3be1c3b145cb519154cefa519ffa0b4 /content/content.c
parentcbf55bd418814a943422dffacf37f18c4ab3e839 (diff)
downloadnetsurf-236b6a15e1c458d51ec6f31a6a49b3579e91d2d3.tar.gz
netsurf-236b6a15e1c458d51ec6f31a6a49b3579e91d2d3.tar.bz2
Add mime-type getter.
svn path=/trunk/netsurf/; revision=10259
Diffstat (limited to 'content/content.c')
-rw-r--r--content/content.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c
index a44eb2847..9e01171ea 100644
--- a/content/content.c
+++ b/content/content.c
@@ -1061,6 +1061,25 @@ content_type content__get_type(struct content *c)
}
/**
+ * Retrieve mime-type of content
+ *
+ * \param c Content to retrieve mime-type of
+ * \return Pointer to mime-type, or NULL if not found.
+ */
+const char *content_get_mime_type(hlcache_handle *h)
+{
+ return content__get_mime_type(hlcache_handle_get_content(h));
+}
+
+const char *content__get_mime_type(struct content *c)
+{
+ if (c == NULL)
+ return NULL;
+
+ return c->mime_type;
+}
+
+/**
* Retrieve URL associated with content
*
* \param c Content to retrieve URL from