libdom
Loading...
Searching...
No Matches
xmlparser.h File Reference
#include <stddef.h>
#include <inttypes.h>
#include <dom/dom.h>
#include "xmlerror.h"

Go to the source code of this file.

Typedefs

typedef struct dom_xml_parser dom_xml_parser
 

Functions

dom_xml_parserdom_xml_parser_create (const char *enc, const char *int_enc, dom_msg msg, void *mctx, dom_document **document)
 
void dom_xml_parser_destroy (dom_xml_parser *parser)
 
dom_xml_error dom_xml_parser_parse_chunk (dom_xml_parser *parser, uint8_t *data, size_t len)
 
dom_xml_error dom_xml_parser_completed (dom_xml_parser *parser)
 

Typedef Documentation

◆ dom_xml_parser

typedef struct dom_xml_parser dom_xml_parser

Function Documentation

◆ dom_xml_parser_completed()

dom_xml_error dom_xml_parser_completed ( dom_xml_parser * parser)

Notify parser that datastream is empty

Parameters
parserThe XML parser instance to notify
Returns
DOM_XML_OK on success, DOM_XML_EXTERNAL_ERR | expat error on failure

This will force any remaining data through the parser

Notify parser that datastream is empty

Parameters
parserThe XML parser instance to notify
Returns
DOM_XML_OK on success, DOM_XML_EXTERNAL_ERR | libxml error on failure

This will force any remaining data through the parser

◆ dom_xml_parser_create()

dom_xml_parser * dom_xml_parser_create ( const char * enc,
const char * int_enc,
dom_msg msg,
void * mctx,
dom_document ** document )

Create an XML parser instance

Parameters
encSource charset, or NULL
int_encDesired charset of document buffer (UTF-8 or UTF-16)
msgInformational message function
mctxPointer to client-specific private data
documentDOM Document
Returns
Pointer to instance, or NULL on memory exhaustion

int_enc is ignored due to it being made of bees.

Create an XML parser instance

Parameters
encSource charset, or NULL
int_encDesired charset of document buffer (UTF-8 or UTF-16)
msgInformational message function
mctxPointer to client-specific private data
Returns
Pointer to instance, or NULL on memory exhaustion

Neither enc nor int_enc are used here. libxml only supports a UTF-8 document buffer and forcibly setting the parser encoding is not yet implemented

◆ dom_xml_parser_destroy()

void dom_xml_parser_destroy ( dom_xml_parser * parser)

Destroy an XML parser instance

Parameters
parserThe parser instance to destroy

◆ dom_xml_parser_parse_chunk()

dom_xml_error dom_xml_parser_parse_chunk ( dom_xml_parser * parser,
uint8_t * data,
size_t len )

Parse a chunk of data

Parameters
parserThe XML parser instance to use for parsing
dataPointer to data chunk
lenByte length of data chunk
Returns
DOM_XML_OK on success, DOM_XML_EXTERNAL_ERR | expat error on failure

Parse a chunk of data

Parameters
parserThe XML parser instance to use for parsing
dataPointer to data chunk
lenByte length of data chunk
Returns
DOM_XML_OK on success, DOM_XML_EXTERNAL_ERR | libxml error on failure