diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2010-04-07 09:12:09 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2010-04-07 09:12:09 +0000 |
commit | 236b6a15e1c458d51ec6f31a6a49b3579e91d2d3 (patch) | |
tree | e8f29f2ec3be1c3b145cb519154cefa519ffa0b4 /content | |
parent | cbf55bd418814a943422dffacf37f18c4ab3e839 (diff) | |
download | netsurf-236b6a15e1c458d51ec6f31a6a49b3579e91d2d3.tar.gz netsurf-236b6a15e1c458d51ec6f31a6a49b3579e91d2d3.tar.bz2 |
Add mime-type getter.
svn path=/trunk/netsurf/; revision=10259
Diffstat (limited to 'content')
-rw-r--r-- | content/content.c | 19 | ||||
-rw-r--r-- | content/content.h | 1 | ||||
-rw-r--r-- | content/content_protected.h | 1 |
3 files changed, 21 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 diff --git a/content/content.h b/content/content.h index b9af6c267..a76783bdf 100644 --- a/content/content.h +++ b/content/content.h @@ -131,6 +131,7 @@ void content_close(struct hlcache_handle *h); /* Member accessors */ content_type content_get_type(struct hlcache_handle *c); +const char *content_get_mime_type(struct hlcache_handle *c); const char *content_get_url(struct hlcache_handle *c); const char *content_get_title(struct hlcache_handle *c); content_status content_get_status(struct hlcache_handle *c); diff --git a/content/content_protected.h b/content/content_protected.h index 013a9645f..16760180b 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -207,6 +207,7 @@ void content__reformat(struct content *c, int width, int height); bool content__set_title(struct content *c, const char *title); content_type content__get_type(struct content *c); +const char *content__get_mime_type(struct content *c); const char *content__get_url(struct content *c); const char *content__get_title(struct content *c); content_status content__get_status(struct content *c); |