#include <stdlib.h>
#include <string.h>
#include "wbxml.h"
Include dependency graph for wbxml_parser.c:
Go to the source code of this file.
Compounds | |
struct | WBXMLParser_s |
The WBXML Parser. More... | |
Defines | |
#define | WBXML_PARSER_MALLOC_BLOCK 5000 |
#define | WBXML_PARSER_STRING_TABLE_MALLOC_BLOCK 200 |
#define | WBXML_PARSER_ATTR_VALUE_MALLOC_BLOCK 100 |
#define | WBXML_PARSER_BEST_EFFORT 1 |
#define | WBXML_PARSER_UNKNOWN_STRING ((WB_UTINY *)"unknown") |
#define | WBXML_PARSER_MAX_ENTITY_CODE 999999 |
#define | CHECK_ERROR if (ret != WBXML_OK) return ret; |
Typedefs | |
typedef enum WBXMLTokenType_e | WBXMLTokenType |
The WBXML Application Token types. | |
Enumerations | |
enum | WBXMLTokenType_e { WBXML_TAG_TOKEN, WBXML_ATTR_TOKEN } |
The WBXML Application Token types. More... | |
Functions | |
void | wbxml_parser_reinit (WBXMLParser *parser) |
Reinitialize a WBXML Parser. | |
unsigned char | is_token (WBXMLParser *parser, unsigned char token) |
Check if current byte a specified WBXML token. | |
unsigned char | is_literal (WBXMLParser *parser) |
Check if current byte is a WBXML literalTag token. | |
unsigned char | is_attr_value (WBXMLParser *parser) |
Check if next token to parse is an Attribute Value. | |
unsigned char | is_string (WBXMLParser *parser) |
Check if current byte is a string. | |
unsigned char | is_extension (WBXMLParser *parser) |
Check if current byte is an extension. | |
unsigned char | check_public_id (WBXMLParser *parser) |
Check the Public ID. | |
WBXMLError | parse_version (WBXMLParser *parser) |
Parse WBXML version. | |
WBXMLError | parse_publicid (WBXMLParser *parser) |
Parse WBXML public id. | |
WBXMLError | parse_charset (WBXMLParser *parser) |
Parse WBXML charset. | |
WBXMLError | parse_strtbl (WBXMLParser *parser) |
Parse WBXML string table. | |
WBXMLError | parse_body (WBXMLParser *parser) |
Parse WBXML body. | |
WBXMLError | parse_pi (WBXMLParser *parser) |
Parse WBXML pi. | |
WBXMLError | parse_element (WBXMLParser *parser) |
Parse WBXML element. | |
void | free_attrs_table (WBXMLAttribute **attrs) |
Free a (WBXMLAttribute *) table. | |
WBXMLError | parse_switch_page (WBXMLParser *parser, WBXMLTokenType code_space) |
Parse WBXML switchPage. | |
WBXMLError | parse_stag (WBXMLParser *parser, unsigned char *tag, WBXMLTag **element) |
Parse WBXML stag. | |
WBXMLError | parse_tag (WBXMLParser *parser, unsigned char *tag, WBXMLTag **element) |
Parse WBXML Application Token (tag). | |
WBXMLError | parse_attribute (WBXMLParser *parser, WBXMLAttribute **attr) |
Parse WBXML attribute. | |
WBXMLError | parse_content (WBXMLParser *parser, unsigned char **content, int *len, unsigned char *static_content) |
Parse WBXML content. | |
WBXMLError | parse_string (WBXMLParser *parser, unsigned char **str, int *len) |
Parse WBXML string. | |
WBXMLError | parse_extension (WBXMLParser *parser, WBXMLTokenType code_space, unsigned char **ext, int *len) |
Parse WBXML extension. | |
WBXMLError | parse_entity (WBXMLParser *parser, unsigned char **entity, int *len) |
Parse WBXML entity. | |
WBXMLError | parse_opaque (WBXMLParser *parser, unsigned char **data, int *len) |
Parse WBXML opaque. | |
WBXMLError | parse_literal (WBXMLParser *parser, unsigned char *tag, unsigned char **result) |
Parse WBXML literalTag. | |
WBXMLError | parse_attr_start (WBXMLParser *parser, WBXMLAttributeName **name, unsigned char **value) |
Parse WBXML attrStart. | |
WBXMLError | parse_attr_value (WBXMLParser *parser, unsigned char **value, int *len, unsigned char *static_value) |
Parse WBXML attrValue. | |
WBXMLError | parse_termstr (WBXMLParser *parser, unsigned char **str, int *len) |
Parse WBXML termstr. | |
WBXMLError | parse_inline (WBXMLParser *parser, unsigned char **str, int *len) |
Parse WBXML inline. | |
WBXMLError | parse_tableref (WBXMLParser *parser, unsigned char **str, int *len) |
Parse WBXML tableref. | |
WBXMLError | parse_entcode (WBXMLParser *parser, unsigned int *result) |
Parse WBXML entcode. | |
WBXMLError | get_strtbl_reference (WBXMLParser *parser, unsigned int index, unsigned char **str, int *len) |
Get a string from String Table. | |
WBXMLError | parse_uint8 (WBXMLParser *parser, unsigned char *result) |
Parse UINT8. | |
WBXMLError | parse_mb_uint32 (WBXMLParser *parser, unsigned int *result) |
Parse a MultiByte UINT32. | |
WBXMLError | decode_datetime (WBXMLBuffer *buff) |
WBXMLError | decode_opaque_content (WBXMLParser *parser, unsigned char **data, int *len, unsigned char *static_content) |
Decode an Opaque Content buffer. | |
WBXMLParser * | wbxml_parser_create (void) |
Create a WBXML Parser. | |
void | wbxml_parser_destroy (WBXMLParser *parser) |
Destroy a WBXML Parser. | |
WBXMLError | wbxml_parser_parse (WBXMLParser *parser, unsigned char *wbxml, unsigned int wbxml_len) |
void | wbxml_parser_set_user_data (WBXMLParser *parser, void *user_data) |
Set User Data for a WBXML Parser. | |
void | wbxml_parser_set_content_handler (WBXMLParser *parser, WBXMLContentHandler *content_handler) |
Set Content Handler for a WBXML Parser. | |
void | wbxml_parser_set_main_table (WBXMLParser *parser, const WBXMLLangEntry *main_table) |
Set Main WBXML Languages Table. | |
unsigned char | wbxml_parser_set_language (WBXMLParser *parser, WBXMLLanguage lang) |
Force to parse the Document of a given Language. | |
unsigned int | wbxml_parser_get_wbxml_public_id (WBXMLParser *parser) |
Get WBXML Public ID. | |
const unsigned char * | wbxml_parser_get_xml_public_id (WBXMLParser *parser) |
Get XML Public ID. | |
WBXMLVersion | wbxml_parser_get_wbxml_version (WBXMLParser *parser) |
Get WBXML Version. | |
int | wbxml_parser_get_current_byte_index (WBXMLParser *parser) |
Return current parsing position in WBXML. |
Definition in file wbxml_parser.c.
|
Definition at line 169 of file wbxml_parser.c. Referenced by wbxml_parser_parse(). |
|
Definition at line 52 of file wbxml_parser.c. |
|
Set it to '1' for Best Effort mode Definition at line 55 of file wbxml_parser.c. |
|
Definition at line 50 of file wbxml_parser.c. Referenced by wbxml_parser_parse(). |
|
If you want to modify this define, change the 'entcode' variable length in parse_entity() too please Definition at line 61 of file wbxml_parser.c. |
|
Definition at line 51 of file wbxml_parser.c. |
|
For unknown Tag Name or Attribute Name (in Best Effort Mode) Definition at line 58 of file wbxml_parser.c. |
|
The WBXML Application Token types.
|
|
The WBXML Application Token types.
Definition at line 67 of file wbxml_parser.c. |
|
Check the Public ID.
Definition at line 510 of file wbxml_parser.c. Referenced by wbxml_parser_parse(). |
|
|
|
Decode an Opaque Content buffer.
Definition at line 2072 of file wbxml_parser.c. |
|
Free a (WBXMLAttribute *) table.
Definition at line 948 of file wbxml_parser.c. |
|
Get a string from String Table.
Definition at line 1878 of file wbxml_parser.c. |
|
Check if next token to parse is an Attribute Value.
Definition at line 439 of file wbxml_parser.c. |
|
Check if current byte is an extension.
Definition at line 485 of file wbxml_parser.c. |
|
Check if current byte is a WBXML literalTag token.
Definition at line 422 of file wbxml_parser.c. |
|
Check if current byte is a string.
Definition at line 474 of file wbxml_parser.c. |
|
Check if current byte a specified WBXML token.
Definition at line 406 of file wbxml_parser.c. |
|
Parse WBXML attrStart.
Definition at line 1611 of file wbxml_parser.c. |
|
Parse WBXML attrValue.
Definition at line 1707 of file wbxml_parser.c. |
|
Parse WBXML attribute.
Definition at line 1087 of file wbxml_parser.c. |
|
Parse WBXML body.
Definition at line 724 of file wbxml_parser.c. Referenced by wbxml_parser_parse(). |
|
Parse WBXML charset.
Definition at line 669 of file wbxml_parser.c. Referenced by wbxml_parser_parse(). |
|
Parse WBXML content.
Definition at line 1205 of file wbxml_parser.c. |
|
Parse WBXML element.
Definition at line 830 of file wbxml_parser.c. |
|
Parse WBXML entcode.
Definition at line 1862 of file wbxml_parser.c. |
|
Parse WBXML entity.
Definition at line 1476 of file wbxml_parser.c. |
|
Parse WBXML extension.
Definition at line 1285 of file wbxml_parser.c. |
|
Parse WBXML inline.
Definition at line 1817 of file wbxml_parser.c. |
|
Parse WBXML literalTag.
Definition at line 1552 of file wbxml_parser.c. |
|
Parse a MultiByte UINT32.
Definition at line 1941 of file wbxml_parser.c. |
|
Parse WBXML opaque.
Definition at line 1515 of file wbxml_parser.c. |
|
Parse WBXML pi.
Definition at line 753 of file wbxml_parser.c. |
|
Parse WBXML public id.
Definition at line 633 of file wbxml_parser.c. Referenced by wbxml_parser_parse(). |
|
Parse WBXML stag.
Definition at line 998 of file wbxml_parser.c. |
|
Parse WBXML string.
Definition at line 1257 of file wbxml_parser.c. |
|
Parse WBXML string table.
Definition at line 687 of file wbxml_parser.c. Referenced by wbxml_parser_parse(). |
|
Parse WBXML switchPage.
Definition at line 969 of file wbxml_parser.c. |
|
Parse WBXML tableref.
Definition at line 1837 of file wbxml_parser.c. |
|
Parse WBXML Application Token (tag).
Definition at line 1027 of file wbxml_parser.c. |
|
Parse WBXML termstr.
Definition at line 1787 of file wbxml_parser.c. |
|
Parse UINT8.
Definition at line 1914 of file wbxml_parser.c. |
|
Parse WBXML version.
Definition at line 613 of file wbxml_parser.c. Referenced by wbxml_parser_parse(). |
|
|
Reinitialize a WBXML Parser.
Definition at line 370 of file wbxml_parser.c. Referenced by wbxml_parser_parse(). |