diff options
-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); |