Add mime-type getter.

svn path=/trunk/netsurf/; revision=10259
This commit is contained in:
Michael Drake 2010-04-07 09:12:09 +00:00
parent cbf55bd418
commit 236b6a15e1
3 changed files with 21 additions and 0 deletions

View File

@ -1060,6 +1060,25 @@ content_type content__get_type(struct content *c)
return c->type;
}
/**
* 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
*

View File

@ -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);

View File

@ -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);