From 5a0d96027b949a0c1b0b25e8553a78e2a8957c48 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 6 Dec 2012 16:16:01 +0000 Subject: make the hubbub binding creation take a parameter struct and return standard error codes --- bindings/hubbub/parser.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'bindings/hubbub/parser.h') diff --git a/bindings/hubbub/parser.h b/bindings/hubbub/parser.h index ef0a745..132cc86 100644 --- a/bindings/hubbub/parser.h +++ b/bindings/hubbub/parser.h @@ -48,10 +48,23 @@ typedef enum dom_hubbub_encoding_source { * The client must not call any method of this parser after destruction. */ +/** + * Parameter block for dom_hubbub_parser_create + */ +typedef struct dom_hubbub_parser_params { + const char *enc; /**< Source charset, or NULL */ + bool fix_enc; /**< Whether fix the encoding */ + + bool enable_script; /**< Whether scripting should be enabled. */ + dom_script script; /**< Script callback function */ + + dom_msg msg; /**< Informational message function */ + void *ctx; /**< Pointer to client-specific private data */ +} dom_hubbub_parser_params; + /* Create a Hubbub parser instance */ -dom_hubbub_parser *dom_hubbub_parser_create(const char *enc, bool fix_enc, - bool enable_script, dom_msg msg, - dom_script script, void *mctx, +dom_hubbub_error dom_hubbub_parser_create(dom_hubbub_parser_params *params, + dom_hubbub_parser **parser, dom_document **document); /* Destroy a Hubbub parser instance */ -- cgit v1.2.3