From 5562c9a553fe539d0d1fbf05dba89b1b1f577fae Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 8 Nov 2014 22:08:29 +0000 Subject: Continue doxygen error cleanup. --- content/content.c | 131 ++++++++++++++++++-------------------------- content/content.h | 99 +++++++++++++++++++++++++++++---- content/content_protected.h | 59 +++++++++++++++++++- content/hlcache.c | 3 +- 4 files changed, 200 insertions(+), 92 deletions(-) (limited to 'content') diff --git a/content/content.c b/content/content.c index 1316497a9..eca3f61c2 100644 --- a/content/content.c +++ b/content/content.c @@ -17,10 +17,7 @@ */ /** \file - * Content handling (implementation). - * - * This implementation is based on the ::handler_map array, which maps - * ::content_type to the functions which implement that type. + * Content handling implementation. */ #include @@ -894,20 +891,8 @@ void content_add_error(struct content *c, const char *token, { } -bool content__set_title(struct content *c, const char *title) -{ - char *new_title = strdup(title); - if (new_title == NULL) - return false; - - if (c->title != NULL) - free(c->title); - - c->title = new_title; - - return true; -} +/* exported interface documented in content/content.h */ struct content_rfc5988_link * content_find_rfc5988_link(hlcache_handle *h, lwc_string *rel) { @@ -999,12 +984,24 @@ bool content__add_rfc5988_link(struct content *c, return true; } + + /** - * Retrieve computed type of content + * Retrieve URL associated with content * - * \param c Content to retrieve type of - * \return Computed content type + * \param c Content to retrieve URL from + * \return Pointer to URL, or NULL if not found. */ +nsurl *content_get_url(struct content *c) +{ + if (c == NULL) + return NULL; + + return llcache_handle_get_url(c->llcache); +} + + +/* exported interface documented in content/content.h */ content_type content_get_type(hlcache_handle *h) { struct content *c = hlcache_handle_get_content(h); @@ -1015,17 +1012,14 @@ content_type content_get_type(hlcache_handle *h) return c->handler->type(); } -/** - * Retrieve mime-type of content - * - * \param c Content to retrieve mime-type of - * \return Pointer to referenced mime-type, or NULL if not found. - */ + +/* exported interface documented in content/content.h */ lwc_string *content_get_mime_type(hlcache_handle *h) { return content__get_mime_type(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ lwc_string *content__get_mime_type(struct content *c) { if (c == NULL) @@ -1034,31 +1028,30 @@ lwc_string *content__get_mime_type(struct content *c) return lwc_string_ref(c->mime_type); } -/** - * Retrieve URL associated with content - * - * \param c Content to retrieve URL from - * \return Pointer to URL, or NULL if not found. - */ -nsurl *content_get_url(struct content *c) + +/* exported interface documented in content/content_protected.h */ +bool content__set_title(struct content *c, const char *title) { - if (c == NULL) - return NULL; + char *new_title = strdup(title); + if (new_title == NULL) + return false; - return llcache_handle_get_url(c->llcache); + if (c->title != NULL) + free(c->title); + + c->title = new_title; + + return true; } -/** - * Retrieve title associated with content - * - * \param c Content to retrieve title from - * \return Pointer to title, or NULL if not found. - */ + +/* exported interface documented in content/content.h */ const char *content_get_title(hlcache_handle *h) { return content__get_title(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ const char *content__get_title(struct content *c) { if (c == NULL) @@ -1068,17 +1061,14 @@ const char *content__get_title(struct content *c) nsurl_access(llcache_handle_get_url(c->llcache)); } -/** - * Retrieve status of content - * - * \param c Content to retrieve status of - * \return Content status - */ + +/* exported interface documented in content/content.h */ content_status content_get_status(hlcache_handle *h) { return content__get_status(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ content_status content__get_status(struct content *c) { if (c == NULL) @@ -1087,17 +1077,14 @@ content_status content__get_status(struct content *c) return c->status; } -/** - * Retrieve status message associated with content - * - * \param c Content to retrieve status message from - * \return Pointer to status message, or NULL if not found. - */ + +/* exported interface documented in content/content.h */ const char *content_get_status_message(hlcache_handle *h) { return content__get_status_message(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ const char *content__get_status_message(struct content *c) { if (c == NULL) @@ -1106,17 +1093,14 @@ const char *content__get_status_message(struct content *c) return c->status_message; } -/** - * Retrieve width of content - * - * \param c Content to retrieve width of - * \return Content width - */ + +/* exported interface documented in content/content.h */ int content_get_width(hlcache_handle *h) { return content__get_width(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ int content__get_width(struct content *c) { if (c == NULL) @@ -1125,17 +1109,14 @@ int content__get_width(struct content *c) return c->width; } -/** - * Retrieve height of content - * - * \param c Content to retrieve height of - * \return Content height - */ + +/* exported interface documented in content/content.h */ int content_get_height(hlcache_handle *h) { return content__get_height(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ int content__get_height(struct content *c) { if (c == NULL) @@ -1144,17 +1125,14 @@ int content__get_height(struct content *c) return c->height; } -/** - * Retrieve available width of content - * - * \param h handle to the content. - * \return Available width of content. - */ + +/* exported interface documented in content/content.h */ int content_get_available_width(hlcache_handle *h) { return content__get_available_width(hlcache_handle_get_content(h)); } +/* exported interface documented in content/content_protected.h */ int content__get_available_width(struct content *c) { if (c == NULL) @@ -1164,18 +1142,13 @@ int content__get_available_width(struct content *c) } -/** - * Retrieve source of content - * - * \param c Content to retrieve source of - * \param size Pointer to location to receive byte size of source - * \return Pointer to source data - */ +/* exported interface documented in content/content.h */ const char *content_get_source_data(hlcache_handle *h, unsigned long *size) { return content__get_source_data(hlcache_handle_get_content(h), size); } +/* exported interface documented in content/content_protected.h */ const char *content__get_source_data(struct content *c, unsigned long *size) { const uint8_t *data; diff --git a/content/content.h b/content/content.h index 5f7d53a70..b0f2c099c 100644 --- a/content/content.h +++ b/content/content.h @@ -250,7 +250,6 @@ void content_remove_user(struct content *c, uint32_t content_count_users(struct content *c); bool content_matches_quirks(struct content *c, bool quirks); bool content_is_shareable(struct content *c); -content_status content__get_status(struct content *c); const struct llcache_handle *content_get_llcache_handle(struct content *c); nsurl *content_get_url(struct content *c); @@ -315,19 +314,99 @@ nserror content_debug_dump(struct hlcache_handle *h, FILE *f, enum content_debug */ nserror content_debug(struct hlcache_handle *h, enum content_debug op); -struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *c, +/** + * find link in content that matches the rel string. + * + * \param h handle to the content to retrieve tyoe of. + * \param rel The string to match. + * \return A matching rfc5988 link or NULL if none is found. + * + */ +struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *h, lwc_string *rel); /* Member accessors */ + +/** + * Retrieve computed type of content + * + * \param h handle to the content to retrieve tyoe of. + * \return Computed content type + */ content_type content_get_type(struct hlcache_handle *c); -lwc_string *content_get_mime_type(struct hlcache_handle *c); -const char *content_get_title(struct hlcache_handle *c); -content_status content_get_status(struct hlcache_handle *c); -const char *content_get_status_message(struct hlcache_handle *c); -int content_get_width(struct hlcache_handle *c); -int content_get_height(struct hlcache_handle *c); -int content_get_available_width(struct hlcache_handle *c); -const char *content_get_source_data(struct hlcache_handle *c, + +/** + * Retrieve mime-type of content + * + * \param h handle to the content to retrieve mime type from + * \return Pointer to referenced mime type, or NULL if not found. + */ +lwc_string *content_get_mime_type(struct hlcache_handle *h); + +/** + * Retrieve title associated with content + * + * \param h handle to the content to retrieve title from + * \return Pointer to title, or NULL if not found. + */ +const char *content_get_title(struct hlcache_handle *h); + +/** + * Retrieve status of content + * + * \param h handle to the content to retrieve status from + * \return Content status + */ +content_status content_get_status(struct hlcache_handle *h); + +/** + * Retrieve status of content + * + * \param c Content to retrieve status from. + * \return Content status + */ +content_status content__get_status(struct content *c); + +/** + * Retrieve status message associated with content + * + * \param h handle to the content to retrieve status message from + * \return Pointer to status message, or NULL if not found. + */ +const char *content_get_status_message(struct hlcache_handle *h); + +/** + * Retrieve width of content + * + * \param h handle to the content to get width of. + * \return Content width + */ +int content_get_width(struct hlcache_handle *h); + +/** + * Retrieve height of content + * + * \param h handle to the content to get height of. + * \return Content height + */ +int content_get_height(struct hlcache_handle *h); + +/** + * Retrieve available width of content + * + * \param h handle to the content to get available width of. + * \return Available width of content. + */ +int content_get_available_width(struct hlcache_handle *h); + +/** + * Retrieve source of content + * + * \param h Content handle to retrieve source of + * \param size Pointer to location to receive byte size of source + * \return Pointer to source data + */ +const char *content_get_source_data(struct hlcache_handle *h, unsigned long *size); /** diff --git a/content/content_protected.h b/content/content_protected.h index 1ae899891..d22ff4b22 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -185,14 +185,71 @@ void content__reformat(struct content *c, bool background, void content__request_redraw(struct content *c, int x, int y, int width, int height); -bool content__set_title(struct content *c, const char *title); +/** + * Retrieve mime-type of content + * + * \param c Content to retrieve mime-type of + * \return Pointer to referenced mime-type, or NULL if not found. + */ lwc_string *content__get_mime_type(struct content *c); + +/** + * Set title associated with content + * + * \param c Content to set title on. + * \parm title The new title to set. + * \return true on sucess else false. + */ +bool content__set_title(struct content *c, const char *title); + +/** + * Retrieve title associated with content + * + * \param c Content to retrieve title from + * \return Pointer to title, or NULL if not found. + */ const char *content__get_title(struct content *c); + +/** + * Retrieve status message associated with content + * + * \param c Content to retrieve status message from + * \return Pointer to status message, or NULL if not found. + */ const char *content__get_status_message(struct content *c); + +/** + * Retrieve width of content + * + * \param c Content to retrieve width of + * \return Content width + */ int content__get_width(struct content *c); + +/** + * Retrieve height of content + * + * \param c Content to retrieve height of + * \return Content height + */ int content__get_height(struct content *c); + +/** + * Retrieve available width of content + * + * \param c content to get available width of. + * \return Available width of content. + */ int content__get_available_width(struct content *c); + +/** + * Retrieve source of content. + * + * \param c Content to retrieve source of. + * \param size Pointer to location to receive byte size of source. + * \return Pointer to source data. + */ const char *content__get_source_data(struct content *c, unsigned long *size); /** diff --git a/content/hlcache.c b/content/hlcache.c index 6cfcba328..6e991281d 100644 --- a/content/hlcache.c +++ b/content/hlcache.c @@ -113,8 +113,7 @@ static void hlcache_clean(void *ignored) if (entry->content == NULL) continue; - if (content__get_status(entry->content) == - CONTENT_STATUS_LOADING) + if (content__get_status(entry->content) == CONTENT_STATUS_LOADING) continue; if (content_count_users(entry->content) != 0) -- cgit v1.2.3