#include <stdbool.h>
#include <inttypes.h>
#include <hubbub/errors.h>
#include <hubbub/functypes.h>
#include <hubbub/tree.h>
#include <hubbub/types.h>
Go to the source code of this file.
◆ hubbub_parser
◆ hubbub_parser_optparams
Hubbub parser option parameters.
◆ hubbub_parser_opttype
Hubbub parser option types.
◆ hubbub_parser_opttype
Hubbub parser option types.
Enumerator |
---|
HUBBUB_PARSER_TOKEN_HANDLER | |
HUBBUB_PARSER_ERROR_HANDLER | |
HUBBUB_PARSER_CONTENT_MODEL | |
HUBBUB_PARSER_TREE_HANDLER | |
HUBBUB_PARSER_DOCUMENT_NODE | |
HUBBUB_PARSER_ENABLE_SCRIPTING | |
HUBBUB_PARSER_PAUSE | |
◆ hubbub_parser_completed()
Inform the parser that the last chunk of data has been parsed.
- Parameters
-
- Returns
- HUBBUB_OK on success, appropriate error otherwise
◆ hubbub_parser_create()
Create a hubbub parser.
- Parameters
-
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 |
- Returns
- HUBBUB_OK on success, HUBBUB_BADPARM on bad parameters, HUBBUB_NOMEM on memory exhaustion, HUBBUB_BADENCODING if
enc
is unsupported
◆ hubbub_parser_destroy()
Destroy a hubbub parser.
- Parameters
-
parser | Parser instance to destroy |
- Returns
- HUBBUB_OK on success, appropriate error otherwise
◆ hubbub_parser_insert_chunk()
Insert a chunk of data into a hubbub parser input stream.
This data is encoded in the input charset
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.
- Parameters
-
parser | Parser instance to use |
data | Data to parse (encoded in the input charset) |
len | Length, in bytes, of data |
- Returns
- HUBBUB_OK on success, appropriate error otherwise
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.
- Parameters
-
parser | Parser instance to use |
data | Data to parse (encoded in UTF-8) |
len | Length, in bytes, of data |
- Returns
- HUBBUB_OK on success, appropriate error otherwise
◆ hubbub_parser_parse_chunk()
Pass a chunk of data to a hubbub parser for parsing.
- Parameters
-
parser | Parser instance to use |
data | Data to parse (encoded in the input charset) |
len | Length, in bytes, of data |
- Returns
- HUBBUB_OK on success, appropriate error otherwise
◆ hubbub_parser_read_charset()
Read the document charset.
- Parameters
-
parser | Parser instance to query |
source | Pointer to location to receive charset source |
- Returns
- Pointer to charset name (constant; do not free), or NULL if unknown
◆ hubbub_parser_setopt()
Configure a hubbub parser.
- Parameters
-
parser | Parser instance to configure |
type | Option to set |
params | Option-specific parameters |
- Returns
- HUBBUB_OK on success, appropriate error otherwise