Hubbub $Id$
|
#include <assert.h>
#include <string.h>
#include <parserutils/charset/mibenum.h>
#include <parserutils/input/inputstream.h>
#include <hubbub/parser.h>
#include "charset/detect.h"
#include "tokeniser/tokeniser.h"
#include "treebuilder/treebuilder.h"
#include "utils/parserutilserror.h"
Classes | |
struct | hubbub_parser |
Hubbub parser object. More... | |
Functions | |
hubbub_error | hubbub_parser_create (const char *enc, bool fix_enc, hubbub_parser **parser) |
Create a hubbub parser. More... | |
hubbub_error | hubbub_parser_destroy (hubbub_parser *parser) |
Destroy a hubbub parser. More... | |
hubbub_error | hubbub_parser_setopt (hubbub_parser *parser, hubbub_parser_opttype type, hubbub_parser_optparams *params) |
Configure a hubbub parser. More... | |
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. More... | |
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. More... | |
hubbub_error | hubbub_parser_completed (hubbub_parser *parser) |
Inform the parser that the last chunk of data has been parsed. More... | |
const char * | hubbub_parser_read_charset (hubbub_parser *parser, hubbub_charset_source *source) |
Read the document charset. More... | |
hubbub_error hubbub_parser_completed | ( | hubbub_parser * | parser | ) |
Inform the parser that the last chunk of data has been parsed.
parser | Parser to inform |
hubbub_error hubbub_parser_create | ( | const char * | enc, |
bool | fix_enc, | ||
hubbub_parser ** | parser | ||
) |
Create a hubbub parser.
enc | Source document encoding, or NULL to autodetect |
fix_enc | Permit fixing up of encoding if it's frequently misused |
parser | Pointer to location to receive parser instance |
enc
is unsupported hubbub_error hubbub_parser_destroy | ( | hubbub_parser * | parser | ) |
Destroy a hubbub parser.
parser | Parser instance to destroy |
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.
Inserts the given data into the input stream ready for parsing but does not cause any additional processing of the input. This is useful to allow hubbub callbacks to add computed data to the input.
parser | Parser instance to use |
data | Data to parse (encoded in UTF-8) |
len | Length, in bytes, of data |
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.
parser | Parser instance to use |
data | Data to parse (encoded in the input charset) |
len | Length, in bytes, of data |
const char * hubbub_parser_read_charset | ( | hubbub_parser * | parser, |
hubbub_charset_source * | source | ||
) |
Read the document charset.
parser | Parser instance to query |
source | Pointer to location to receive charset source |
hubbub_error hubbub_parser_setopt | ( | hubbub_parser * | parser, |
hubbub_parser_opttype | type, | ||
hubbub_parser_optparams * | params | ||
) |
Configure a hubbub parser.
parser | Parser instance to configure |
type | Option to set |
params | Option-specific parameters |