enum sgml_parser_type: SGML parser type

There are two kinds of parser types: One that optimises one-time access to the DOM tree and one that creates a persistent DOM tree.

The first one is a DOM tree builder.
The second one will simply push nodes on the stack, not building a DOM tree. This interface is similar to that of SAX (Simple API for XML) where events are fired when nodes are entered and exited. It is useful when you are not actually interested in the DOM tree, but can do all processing in a stream-like manner, such as when highlighting HTML code.

enum sgml_parser_code: (Error) codes for the SGML parser

These enum values are used

The parsing was successful
The parsing could not be completed
Failed to allocate memory
FIXME: For when we will add support for requiring stricter parsing or even a validator.

callback sgml_error_T: SGML error callback

Called by the SGML parser when a parsing error has occurred.

If the return code is not SGML_PARSER_CODE_OK the parsing will be ended and that code will be returned.

struct sgml_parser: Something


init_sgml_parser(): Initialise an SGML parser

Initialise an SGML parser with the given properties.

type Stream or tree; one-time or persistant.
doctype The document type, this affects what sub type nodes are given.
uri The URI of the document root.
flags Flags controlling the behaviour of the parser.

done_sgml_parser(): Release an SGML parser

Deallocates all resources, _expect_ the root node.

parser The parser being released.