summaryrefslogtreecommitdiff
path: root/content/content.c
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-03 03:40:42 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-03 03:40:42 +0000
commit209c72b0113b5235a49af7a16e2aecb8e9f9c8ef (patch)
tree825dcad0e1a2827583e4b98562aceec8adc3b10f /content/content.c
parent0980d865b43982084cf6d8af17436c664e33af5b (diff)
downloadnetsurf-209c72b0113b5235a49af7a16e2aecb8e9f9c8ef.tar.gz
netsurf-209c72b0113b5235a49af7a16e2aecb8e9f9c8ef.tar.bz2
Add a function to tell the mime type for a content type.
svn path=/trunk/netsurf/; revision=5478
Diffstat (limited to 'content/content.c')
-rw-r--r--content/content.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c
index 935f3657f..090eb399d 100644
--- a/content/content.c
+++ b/content/content.c
@@ -383,6 +383,23 @@ content_type content_lookup(const char *mime_type)
/**
+ * Convert a content_type to a MIME type.
+ *
+ */
+
+const char *content_mime(content_type type)
+{
+ struct mime_entry *m;
+ int i;
+ m = mime_map;
+ for (i = MIME_MAP_COUNT - 1; i >= 0; i--)
+ if (m[i].type == type)
+ return m[i].mime_type;
+ return "application/octet-stream";
+}
+
+
+/**
* Create a new content structure.
*
* \param url URL of content, copied