summaryrefslogtreecommitdiff
path: root/bindings/hubbub/parser.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2012-07-27 10:41:43 +0100
committerVincent Sanders <vince@netsurf-browser.org>2012-07-27 10:41:43 +0100
commitfe867cf6cdce9f8164405b793afce92a379efd3c (patch)
treece06dc2f20cb12a04e1be547f2839de3e05967e5 /bindings/hubbub/parser.c
parentbe470386ad4af10d096bda3c04409a7ba5c4fc5d (diff)
downloadlibdom-fe867cf6cdce9f8164405b793afce92a379efd3c.tar.gz
libdom-fe867cf6cdce9f8164405b793afce92a379efd3c.tar.bz2
Allow control over parser pause state
Diffstat (limited to 'bindings/hubbub/parser.c')
-rw-r--r--bindings/hubbub/parser.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c
index 4a90511..6299da5 100644
--- a/bindings/hubbub/parser.c
+++ b/bindings/hubbub/parser.c
@@ -911,3 +911,24 @@ const char *dom_hubbub_parser_get_encoding(dom_hubbub_parser *parser,
return parser->encoding != NULL ? parser->encoding
: "Windows-1252";
}
+
+/**
+ * Set the Parse pause state.
+ *
+ * \param parser The parser object
+ * \param pause The pause state to set.
+ * \return DOM_HUBBUB_OK on success,
+ * DOM_HUBBUB_HUBBUB_ERR | <hubbub_error> on failure
+ */
+dom_hubbub_error dom_hubbub_parser_pause(dom_hubbub_parser *parser, bool pause)
+{
+ hubbub_error err;
+ hubbub_parser_optparams params;
+
+ params.pause_parse = pause;
+ err = hubbub_parser_setopt(parser->parser, HUBBUB_PARSER_PAUSE, &params);
+ if (err != HUBBUB_OK)
+ return DOM_HUBBUB_HUBBUB_ERR | err;
+
+ return DOM_HUBBUB_OK;
+}