summaryrefslogtreecommitdiff
path: root/render/box_construct.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2012-11-26 17:23:03 +0000
committerVincent Sanders <vince@netsurf-browser.org>2012-11-26 18:59:13 +0000
commitfb13fcf16648a0e5ba71ac64f9c0441f0516004a (patch)
treee2d5596b7e6975f4ee60c96e5c2686926cc5a288 /render/box_construct.c
parentce309aa5a9c1f813f6bdf152221f9bff88c4d3e1 (diff)
downloadnetsurf-fb13fcf16648a0e5ba71ac64f9c0441f0516004a.tar.gz
netsurf-fb13fcf16648a0e5ba71ac64f9c0441f0516004a.tar.bz2
Improve html renderer error reporting
Diffstat (limited to 'render/box_construct.c')
-rw-r--r--render/box_construct.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index 26d9b54ab..63575876e 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -157,10 +157,10 @@ static const struct element_entry element_table[] = {
* \param n xml tree
* \param c content of type CONTENT_HTML to construct box tree in
* \param cb callback to report conversion completion
- * \return true on success, false on memory exhaustion
+ * \return netsurf error code indicating status of call
*/
-bool xml_to_box(dom_node *n, html_content *c, box_construct_complete_cb cb)
+nserror dom_to_box(dom_node *n, html_content *c, box_construct_complete_cb cb)
{
struct box_construct_ctx *ctx;
@@ -168,13 +168,14 @@ bool xml_to_box(dom_node *n, html_content *c, box_construct_complete_cb cb)
/* create a context allocation for this box tree */
c->bctx = talloc_zero(0, int);
if (c->bctx == NULL) {
- return false;
+ return NSERROR_NOMEM;
}
}
ctx = malloc(sizeof(*ctx));
- if (ctx == NULL)
- return false;
+ if (ctx == NULL) {
+ return NSERROR_NOMEM;
+ }
ctx->content = c;
ctx->n = dom_node_ref(n);
@@ -184,7 +185,7 @@ bool xml_to_box(dom_node *n, html_content *c, box_construct_complete_cb cb)
schedule(0, (schedule_callback_fn) convert_xml_to_box, ctx);
- return true;
+ return NSERROR_OK;
}
/* mapping from CSS display to box type