Go to the documentation of this file.
8 #ifndef hubbub_parser_h_
9 #define hubbub_parser_h_
80 const uint8_t *data,
size_t len);
97 const uint8_t *data,
size_t len);
hubbub_charset_source
Source of charset information, in order of importance A client-dictated charset will override all oth...
Definition: types.h:22
hubbub_content_model model
Definition: parser.h:54
@ HUBBUB_PARSER_CONTENT_MODEL
Definition: parser.h:32
hubbub_error_handler handler
Definition: parser.h:49
Hubbub parser option parameters.
Definition: parser.h:42
union hubbub_parser_optparams hubbub_parser_optparams
Hubbub parser option parameters.
hubbub_error hubbub_parser_parse_chunk(hubbub_parser *parser, const uint8_t *data, size_t len)
Pass a chunk of data to a hubbub parser for parsing.
Definition: parser.c:235
hubbub_token_handler handler
Definition: parser.h:44
void * document_node
Document node.
Definition: parser.h:59
hubbub_tree_handler * tree_handler
Tree handling callbacks.
Definition: parser.h:57
bool enable_scripting
Whether to enable scripting.
Definition: parser.h:61
@ HUBBUB_PARSER_TREE_HANDLER
Definition: parser.h:33
Hubbub tree handler.
Definition: tree.h:273
@ HUBBUB_PARSER_ENABLE_SCRIPTING
Definition: parser.h:35
struct hubbub_parser_optparams::@13 error_handler
Error handling callback.
hubbub_error hubbub_parser_destroy(hubbub_parser *parser)
Destroy a hubbub parser.
Definition: parser.c:102
hubbub_error hubbub_parser_setopt(hubbub_parser *parser, hubbub_parser_opttype type, hubbub_parser_optparams *params)
Configure a hubbub parser.
Definition: parser.c:126
hubbub_error hubbub_parser_create(const char *enc, bool fix_enc, hubbub_parser **parser)
Create a hubbub parser.
Definition: parser.c:41
void(* hubbub_error_handler)(uint32_t line, uint32_t col, const char *message, void *pw)
Type of parse error handling function.
Definition: functypes.h:40
hubbub_parser_opttype
Hubbub parser option types.
Definition: parser.h:29
bool pause_parse
Pause parsing.
Definition: parser.h:63
Hubbub parser object.
Definition: parser.c:24
@ HUBBUB_PARSER_PAUSE
Definition: parser.h:36
hubbub_error
Definition: errors.h:18
element_type type
Definition: treebuilder.c:26
void * pw
Definition: parser.h:45
hubbub_error(* hubbub_token_handler)(const hubbub_token *token, void *pw)
Type of token handling function.
Definition: functypes.h:29
hubbub_error hubbub_parser_completed(hubbub_parser *parser)
Inform the parser that the last chunk of data has been parsed.
Definition: parser.c:279
@ HUBBUB_PARSER_ERROR_HANDLER
Definition: parser.h:31
@ HUBBUB_PARSER_DOCUMENT_NODE
Definition: parser.h:34
hubbub_content_model
Content model flag.
Definition: types.h:32
struct hubbub_parser_optparams::@12 token_handler
Token handling callback.
size_t len
Definition: initial.c:23
hubbub_error hubbub_parser_insert_chunk(hubbub_parser *parser, const uint8_t *data, size_t len)
Insert a chunk of data into a hubbub parser input stream.
Definition: parser.c:218
@ HUBBUB_PARSER_TOKEN_HANDLER
Definition: parser.h:30
const char * hubbub_parser_read_charset(hubbub_parser *parser, hubbub_charset_source *source)
Read the document charset.
Definition: parser.c:305
struct hubbub_parser_optparams::@14 content_model
Current content model.