Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

decompile.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  tagWBXML_NODE
struct  tagDTD_NODE_DATA
struct  tagWBXML_INFO
struct  tagWBXML_STRING_TABLE
struct  tagDTD_TYPE_LIST
struct  tagCODEPAGE_TAG_NAME_LIST
struct  tagCODEPAGE_ATTRSTART_NAME_LIST
struct  tagCODEPAGE_ATTRVALUE_NAME_LIST

Defines

#define TAG_SWITCH_PAGE   0x00
#define TAG_END   0x01
#define TAG_ENTITY   0x02
#define TAG_STR_I   0x03
#define TAG_LITERAL   0x04
#define TAG_EXT_I_0   0x40
#define TAG_EXT_I_1   0x41
#define TAG_EXT_I_2   0x42
#define TAG_PI   0x43
#define TAG_LITERAL_C   0x44
#define TAG_EXT_T_0   0x80
#define TAG_EXT_T_1   0x81
#define TAG_EXT_T_2   0x82
#define TAG_STR_T   0x83
#define TAG_LITERAL_A   0x84
#define TAG_EXT_0   0xc0
#define TAG_EXT_1   0xc1
#define TAG_EXT_2   0xc2
#define TAG_OPAQUE   0xc3
#define TAG_LITERAL_AC   0xc4
#define CODEPAGE_TAG_MASK   ((WBXML_TAG) 0x3f)
#define CODEPAGE_TAG_HAS_CONTENT   ((WBXML_TAG) 0x40)
#define CODEPAGE_TAG_HAS_ATTRS   ((WBXML_TAG) 0x80)
#define SWITCHPAGE_SIZE   2
#define FALSE   0
#define TRUE   1
#define MAX_MB_U_INT32_BYTES   4

Typedefs

typedef enum tagCP_TYPES CP_TAG_TYPE
typedef int BOOL
typedef unsigned char WBXML
typedef WBXMLP_WBXML
typedef P_WBXMLPP_WBXML
typedef unsigned char WBXML_TAG
typedef WBXML_TAGP_WBXML_TAG
typedef unsigned char WBXML_CODEPAGE
typedef unsigned long WBXML_LENGTH
typedef tagWBXML_NODE WBXML_NODE
typedef WBXML_NODEP_WBXML_NODE
typedef unsigned char WBXML_U_INT8
typedef WBXML_U_INT8P_WBXML_U_INT8
typedef unsigned char WBXML_MB_U_INT32 [MAX_MB_U_INT32_BYTES]
typedef WBXML_MB_U_INT32P_WBXML_MB_U_INT32
typedef WBXML_MB_U_INT32 WBXML_STRING_INDEX
typedef WBXML_STRING_INDEXP_WBXML_STRING_INDEX
typedef unsigned char * WBXML_BYTES
typedef WBXML_BYTESP_WBXML_BYTES
typedef WBXML_MB_U_INT32 WBXML_DTD_TYPE
typedef tagDTD_NODE_DATA DTD_NODE_DATA
typedef tagWBXML_INFO WBXML_INFO
typedef WBXML_INFOP_WBXML_INFO
typedef tagWBXML_STRING_TABLE WBXML_STRING_TABLE
typedef WBXML_STRING_TABLEP_WBXML_STRING_TABLE
typedef enum tagWBXML_PARSE_ERROR WBXML_PARSE_ERROR
typedef enum tagWBXML_PARSE_WARNING WBXML_PARSE_WARNING
typedef tagDTD_TYPE_LIST DTD_TYPE_LIST
typedef tagCODEPAGE_TAG_NAME_LIST CODEPAGE_TAG_NAME_LIST
typedef CODEPAGE_TAG_NAME_LISTP_CODEPAGE_TAG_NAME_LIST
typedef tagCODEPAGE_ATTRSTART_NAME_LIST CODEPAGE_ATTRSTART_NAME_LIST
typedef CODEPAGE_ATTRSTART_NAME_LISTP_CODEPAGE_ATTRSTART_NAME_LIST
typedef tagCODEPAGE_ATTRVALUE_NAME_LIST CODEPAGE_ATTRVALUE_NAME_LIST
typedef CODEPAGE_ATTRVALUE_NAME_LISTP_CODEPAGE_ATTRVALUE_NAME_LIST

Enumerations

enum  tagCP_TYPES { CP_TAG_TAG, CP_TAG_ATTRSTART, CP_TAG_ATTRVALUE }
enum  WBXML_NODE_TYPE {
  NODE_CODEPAGE_TAG, NODE_CODEPAGE_LITERAL_TAG, NODE_ATTRSTART, NODE_ATTRSTART_LITERAL,
  NODE_ATTRVALUE, NODE_ATTREND, NODE_STRING, NODE_DTD_TYPE,
  NODE_STRING_TABLE, NODE_VARIABLE_STRING, NODE_VARIABLE_INDEX
}
enum  WBXML_VARIABLE_TYPE { VAR_ESCAPED, VAR_UNESCAPED, VAR_UNCHANGED }
enum  tagWBXML_PARSE_ERROR {
  ERR_END_OF_DATA, ERR_INTERNAL_BAD_PARAM, ERR_TAG_NOT_FOUND, ERR_FILE_NOT_FOUND,
  ERR_FILE_NOT_READ, ERR_NOT_ENOUGH_MEMORY
}
enum  tagWBXML_PARSE_WARNING { WARN_FUTURE_EXPANSION_EXT_0, WARN_FUTURE_EXPANSION_EXT_1, WARN_FUTURE_EXPANSION_EXT_2 }

Functions

void Message (char *msg)
void ParseError (WBXML_PARSE_ERROR error)
void ParseWarning (WBXML_PARSE_WARNING warning)
WBXML_LENGTH BytesLeft (P_WBXML_INFO buffer)
BOOL IsTag (P_WBXML_INFO buffer, WBXML_TAG tag)
BOOL IsCodepageTag (P_WBXML_INFO buffer, CP_TAG_TYPE type)
BOOL Is_attrValue (P_WBXML_INFO buffer)
BOOL Is_extension (P_WBXML_INFO buffer)
BOOL Is_string (P_WBXML_INFO buffer)
BOOL Is_switchPage (P_WBXML_INFO buffer)
BOOL Is_inline (P_WBXML_INFO buffer)
BOOL Is_tableref (P_WBXML_INFO buffer)
BOOL Is_entity (P_WBXML_INFO buffer)
BOOL Is_pi (P_WBXML_INFO buffer)
BOOL Is_opaque (P_WBXML_INFO buffer)
BOOL Is_zero (P_WBXML_INFO buffer)
void Read_u_int8 (P_WBXML_INFO buffer, P_WBXML_U_INT8 result)
void Read_mb_u_int32 (P_WBXML_INFO buffer, P_WBXML_MB_U_INT32 result)
void Read_bytes (P_WBXML_INFO buffer, WBXML_LENGTH length, P_WBXML_BYTES result)
void ReadFixedTag (P_WBXML_INFO buffer, WBXML_TAG tag)
WBXML_TAG ReadCodepageTag (P_WBXML_INFO buffer, CP_TAG_TYPE type)
long mb_u_int32_to_long (P_WBXML_MB_U_INT32 value)
void Read_start (P_WBXML_INFO buffer)
void Read_strtbl (P_WBXML_INFO buffer)
void Read_body (P_WBXML_INFO buffer)
void Read_element (P_WBXML_INFO buffer)
void Read_content (P_WBXML_INFO buffer)
WBXML_TAG Read_stag (P_WBXML_INFO buffer)
void Read_attribute (P_WBXML_INFO buffer)
void Read_attrStart (P_WBXML_INFO buffer)
void Read_attrValue (P_WBXML_INFO buffer)
void Read_extension (P_WBXML_INFO buffer)
void Read_string (P_WBXML_INFO buffer)
void Read_switchPage (P_WBXML_INFO buffer)
void Read_inline (P_WBXML_INFO buffer)
void Read_tableref (P_WBXML_INFO buffer)
void Read_entity (P_WBXML_INFO buffer)
void Read_entcode (P_WBXML_INFO buffer)
void Read_pi (P_WBXML_INFO buffer)
void Read_opaque (P_WBXML_INFO buffer)
void Read_version (P_WBXML_INFO buffer)
void Read_publicid (P_WBXML_INFO buffer)
void Read_charset (P_WBXML_INFO buffer)
void Read_termstr (P_WBXML_INFO buffer)
void Read_termstr_rtn (P_WBXML_INFO buffer, char **result)
void Read_index (P_WBXML_INFO buffer, P_WBXML_MB_U_INT32 result)
void Read_length (P_WBXML_INFO buffer, P_WBXML_MB_U_INT32 result)
void Read_zero (P_WBXML_INFO buffer)
void Read_pageindex (P_WBXML_INFO buffer, P_WBXML_U_INT8 result)

Variables

const WBXML_MB_U_INT32 ZERO_WBXML_MB_U_INT32


Define Documentation

#define CODEPAGE_TAG_HAS_ATTRS   ((WBXML_TAG) 0x80)
 

Definition at line 93 of file decompile.h.

#define CODEPAGE_TAG_HAS_CONTENT   ((WBXML_TAG) 0x40)
 

Definition at line 92 of file decompile.h.

#define CODEPAGE_TAG_MASK   ((WBXML_TAG) 0x3f)
 

Definition at line 91 of file decompile.h.

#define FALSE   0
 

Definition at line 109 of file decompile.h.

Referenced by DumpNodes().

#define MAX_MB_U_INT32_BYTES   4
 

Definition at line 164 of file decompile.h.

#define SWITCHPAGE_SIZE   2
 

Definition at line 96 of file decompile.h.

#define TAG_END   0x01
 

Definition at line 70 of file decompile.h.

Referenced by Read_element(), and Read_pi().

#define TAG_ENTITY   0x02
 

Definition at line 71 of file decompile.h.

Referenced by Is_entity(), and Read_entity().

#define TAG_EXT_0   0xc0
 

Definition at line 84 of file decompile.h.

Referenced by Is_extension(), and Read_extension().

#define TAG_EXT_1   0xc1
 

Definition at line 85 of file decompile.h.

Referenced by Is_extension(), and Read_extension().

#define TAG_EXT_2   0xc2
 

Definition at line 86 of file decompile.h.

Referenced by Is_extension(), and Read_extension().

#define TAG_EXT_I_0   0x40
 

Definition at line 74 of file decompile.h.

Referenced by Is_extension(), and Read_extension().

#define TAG_EXT_I_1   0x41
 

Definition at line 75 of file decompile.h.

Referenced by Is_extension(), and Read_extension().

#define TAG_EXT_I_2   0x42
 

Definition at line 76 of file decompile.h.

Referenced by Is_extension(), and Read_extension().

#define TAG_EXT_T_0   0x80
 

Definition at line 79 of file decompile.h.

Referenced by Is_extension(), and Read_extension().

#define TAG_EXT_T_1   0x81
 

Definition at line 80 of file decompile.h.

Referenced by Is_extension(), and Read_extension().

#define TAG_EXT_T_2   0x82
 

Definition at line 81 of file decompile.h.

Referenced by Is_extension(), and Read_extension().

#define TAG_LITERAL   0x04
 

Definition at line 73 of file decompile.h.

Referenced by Read_attrStart(), and Read_stag().

#define TAG_LITERAL_A   0x84
 

Definition at line 83 of file decompile.h.

#define TAG_LITERAL_AC   0xc4
 

Definition at line 88 of file decompile.h.

#define TAG_LITERAL_C   0x44
 

Definition at line 78 of file decompile.h.

#define TAG_OPAQUE   0xc3
 

Definition at line 87 of file decompile.h.

Referenced by Is_opaque(), and Read_opaque().

#define TAG_PI   0x43
 

Definition at line 77 of file decompile.h.

Referenced by Is_pi(), and Read_pi().

#define TAG_STR_I   0x03
 

Definition at line 72 of file decompile.h.

Referenced by Is_inline(), and Read_inline().

#define TAG_STR_T   0x83
 

Definition at line 82 of file decompile.h.

Referenced by Is_tableref(), and Read_tableref().

#define TAG_SWITCH_PAGE   0x00
 

Definition at line 69 of file decompile.h.

Referenced by Is_switchPage(), and Read_switchPage().

#define TRUE   1
 

Definition at line 110 of file decompile.h.


Typedef Documentation

typedef int BOOL
 

Definition at line 108 of file decompile.h.

Referenced by DumpNode(), DumpNodes(), Is_attrValue(), Is_entity(), Is_extension(), Is_inline(), Is_opaque(), Is_pi(), Is_string(), Is_switchPage(), Is_tableref(), Is_zero(), IsCodepageTag(), IsTag(), and Read_termstr_rtn().

typedef struct tagCODEPAGE_ATTRSTART_NAME_LIST CODEPAGE_ATTRSTART_NAME_LIST
 

typedef struct tagCODEPAGE_ATTRVALUE_NAME_LIST CODEPAGE_ATTRVALUE_NAME_LIST
 

typedef struct tagCODEPAGE_TAG_NAME_LIST CODEPAGE_TAG_NAME_LIST
 

typedef enum tagCP_TYPES CP_TAG_TYPE
 

typedef struct tagDTD_NODE_DATA DTD_NODE_DATA
 

Referenced by AddDTDNode(), and DumpNode().

typedef struct tagDTD_TYPE_LIST DTD_TYPE_LIST
 

typedef CODEPAGE_ATTRSTART_NAME_LIST* P_CODEPAGE_ATTRSTART_NAME_LIST
 

Definition at line 255 of file decompile.h.

typedef CODEPAGE_ATTRVALUE_NAME_LIST* P_CODEPAGE_ATTRVALUE_NAME_LIST
 

Definition at line 266 of file decompile.h.

typedef CODEPAGE_TAG_NAME_LIST* P_CODEPAGE_TAG_NAME_LIST
 

Definition at line 243 of file decompile.h.

typedef WBXML* P_WBXML
 

Definition at line 113 of file decompile.h.

typedef WBXML_BYTES* P_WBXML_BYTES
 

Definition at line 175 of file decompile.h.

typedef WBXML_INFO* P_WBXML_INFO
 

Definition at line 197 of file decompile.h.

Referenced by AddAttrEndNode(), AddAttrStartLiteralNode(), AddAttrStartNode(), AddAttrValueNode(), AddCodepageLiteralTagNode(), AddCodepageTagNode(), AddDTDNode(), AddStringNode(), AddStringTableNode(), AddVariableIndexNode(), AddVariableStringNode(), BufferLength(), BytesLeft(), DumpNodes(), Free(), Init(), Is_attrValue(), Is_entity(), Is_extension(), Is_inline(), Is_opaque(), Is_pi(), Is_string(), Is_switchPage(), Is_tableref(), Is_zero(), IsCodepageTag(), IsTag(), NewNode(), Read_attribute(), Read_attrStart(), Read_attrValue(), Read_body(), Read_bytes(), Read_charset(), Read_content(), Read_element(), Read_entcode(), Read_entity(), Read_extension(), Read_index(), Read_inline(), Read_length(), Read_mb_u_int32(), Read_opaque(), Read_pageindex(), Read_pi(), Read_publicid(), Read_stag(), Read_start(), Read_string(), Read_strtbl(), Read_switchPage(), Read_tableref(), Read_termstr(), Read_termstr_rtn(), Read_u_int8(), Read_version(), Read_zero(), ReadBinary(), ReadCodepageTag(), and ReadFixedTag().

typedef WBXML_MB_U_INT32* P_WBXML_MB_U_INT32
 

Definition at line 167 of file decompile.h.

Referenced by AddAttrStartLiteralNode(), AddCodepageLiteralTagNode(), and DumpNode().

typedef WBXML_NODE* P_WBXML_NODE
 

Definition at line 151 of file decompile.h.

Referenced by AddAttrEndNode(), AddAttrStartLiteralNode(), AddAttrStartNode(), AddAttrValueNode(), AddCodepageLiteralTagNode(), AddCodepageTagNode(), AddDTDNode(), AddStringNode(), AddStringTableNode(), DumpNode(), DumpNodes(), FreeNode(), GetStringTableString(), and NewNode().

typedef WBXML_STRING_INDEX* P_WBXML_STRING_INDEX
 

Definition at line 172 of file decompile.h.

typedef WBXML_STRING_TABLE* P_WBXML_STRING_TABLE
 

Definition at line 206 of file decompile.h.

Referenced by AddStringTableNode(), and GetStringTableString().

typedef WBXML_TAG* P_WBXML_TAG
 

Definition at line 117 of file decompile.h.

Referenced by DumpNode().

typedef WBXML_U_INT8* P_WBXML_U_INT8
 

Definition at line 162 of file decompile.h.

typedef P_WBXML* PP_WBXML
 

Definition at line 114 of file decompile.h.

typedef unsigned char WBXML
 

Definition at line 112 of file decompile.h.

typedef unsigned char* WBXML_BYTES
 

Definition at line 174 of file decompile.h.

Referenced by Read_opaque().

typedef unsigned char WBXML_CODEPAGE
 

Definition at line 119 of file decompile.h.

typedef WBXML_MB_U_INT32 WBXML_DTD_TYPE
 

Definition at line 177 of file decompile.h.

typedef struct tagWBXML_INFO WBXML_INFO
 

Referenced by Is_attrValue(), Is_extension(), and main().

typedef unsigned long WBXML_LENGTH
 

Definition at line 121 of file decompile.h.

Referenced by BytesLeft().

typedef unsigned char WBXML_MB_U_INT32[MAX_MB_U_INT32_BYTES]
 

Definition at line 166 of file decompile.h.

Referenced by AddAttrStartLiteralNode(), AddCodepageLiteralTagNode(), AddDTDNode(), Read_attrStart(), Read_charset(), Read_entcode(), Read_extension(), Read_opaque(), Read_publicid(), Read_stag(), and Read_tableref().

typedef struct tagWBXML_NODE WBXML_NODE
 

Referenced by NewNode().

typedef enum tagWBXML_PARSE_ERROR WBXML_PARSE_ERROR
 

typedef enum tagWBXML_PARSE_WARNING WBXML_PARSE_WARNING
 

typedef WBXML_MB_U_INT32 WBXML_STRING_INDEX
 

Definition at line 171 of file decompile.h.

typedef struct tagWBXML_STRING_TABLE WBXML_STRING_TABLE
 

Referenced by AddStringTableNode(), and Read_strtbl().

typedef unsigned char WBXML_TAG
 

Definition at line 116 of file decompile.h.

Referenced by AddAttrStartNode(), AddAttrValueNode(), AddCodepageTagNode(), DumpNode(), IsTag(), Read_attrStart(), Read_attrValue(), Read_element(), Read_stag(), ReadCodepageTag(), and ReadFixedTag().

typedef unsigned char WBXML_U_INT8
 

Definition at line 161 of file decompile.h.

Referenced by IsCodepageTag(), Read_switchPage(), Read_version(), and Read_zero().


Enumeration Type Documentation

enum tagCP_TYPES
 

Enumeration values:
CP_TAG_TAG 
CP_TAG_ATTRSTART 
CP_TAG_ATTRVALUE 

Definition at line 99 of file decompile.h.

00100 {
00101     CP_TAG_TAG,
00102     CP_TAG_ATTRSTART,
00103     CP_TAG_ATTRVALUE
00104 
00105 } CP_TAG_TYPE;

enum tagWBXML_PARSE_ERROR
 

Enumeration values:
ERR_END_OF_DATA 
ERR_INTERNAL_BAD_PARAM 
ERR_TAG_NOT_FOUND 
ERR_FILE_NOT_FOUND 
ERR_FILE_NOT_READ 
ERR_NOT_ENOUGH_MEMORY 

Definition at line 208 of file decompile.h.

00209 {
00210   ERR_END_OF_DATA,
00211   ERR_INTERNAL_BAD_PARAM,
00212   ERR_TAG_NOT_FOUND,
00213   ERR_FILE_NOT_FOUND,
00214   ERR_FILE_NOT_READ,
00215   ERR_NOT_ENOUGH_MEMORY
00216 
00217 } WBXML_PARSE_ERROR;

enum tagWBXML_PARSE_WARNING
 

Enumeration values:
WARN_FUTURE_EXPANSION_EXT_0 
WARN_FUTURE_EXPANSION_EXT_1 
WARN_FUTURE_EXPANSION_EXT_2 

Definition at line 219 of file decompile.h.

00220 {
00221   WARN_FUTURE_EXPANSION_EXT_0,
00222   WARN_FUTURE_EXPANSION_EXT_1,
00223   WARN_FUTURE_EXPANSION_EXT_2
00224 
00225 } WBXML_PARSE_WARNING;

enum WBXML_NODE_TYPE
 

Enumeration values:
NODE_CODEPAGE_TAG 
NODE_CODEPAGE_LITERAL_TAG 
NODE_ATTRSTART 
NODE_ATTRSTART_LITERAL 
NODE_ATTRVALUE 
NODE_ATTREND 
NODE_STRING 
NODE_DTD_TYPE 
NODE_STRING_TABLE 
NODE_VARIABLE_STRING 
NODE_VARIABLE_INDEX 

Definition at line 123 of file decompile.h.

00124 {
00125     NODE_CODEPAGE_TAG,
00126     NODE_CODEPAGE_LITERAL_TAG,
00127     NODE_ATTRSTART,
00128     NODE_ATTRSTART_LITERAL,
00129     NODE_ATTRVALUE,
00130     NODE_ATTREND,
00131     NODE_STRING,
00132     NODE_DTD_TYPE,
00133     NODE_STRING_TABLE,
00134     NODE_VARIABLE_STRING,
00135     NODE_VARIABLE_INDEX
00136 
00137 } WBXML_NODE_TYPE;

enum WBXML_VARIABLE_TYPE
 

Enumeration values:
VAR_ESCAPED 
VAR_UNESCAPED 
VAR_UNCHANGED 

Definition at line 153 of file decompile.h.

00154 {
00155     VAR_ESCAPED,
00156     VAR_UNESCAPED,
00157     VAR_UNCHANGED
00158 
00159 } WBXML_VARIABLE_TYPE;


Function Documentation

WBXML_LENGTH BytesLeft P_WBXML_INFO  buffer  ) 
 

Definition at line 548 of file decompile.c.

References ERR_INTERNAL_BAD_PARAM, tagWBXML_INFO::m_curpos, tagWBXML_INFO::m_length, tagWBXML_INFO::m_start, P_WBXML_INFO, ParseError(), and WBXML_LENGTH.

Referenced by Is_zero(), IsTag(), Read_bytes(), Read_mb_u_int32(), Read_termstr_rtn(), Read_u_int8(), ReadCodepageTag(), and ReadFixedTag().

00549 {
00550   if (buffer)
00551   {
00552     WBXML_LENGTH bytesRead = (buffer->m_curpos - buffer->m_start);
00553     if (bytesRead >= buffer->m_length)
00554     {
00555       return 0;
00556     }
00557     else
00558     {
00559       return (buffer->m_length - bytesRead);
00560     }
00561   }
00562   else
00563   {
00564     ParseError(ERR_INTERNAL_BAD_PARAM);
00565   }
00566 
00567   return 0;
00568 }

Here is the call graph for this function:

BOOL Is_attrValue P_WBXML_INFO  buffer  ) 
 

Definition at line 612 of file decompile.c.

References BOOL, CP_TAG_ATTRVALUE, Is_entity(), Is_extension(), Is_opaque(), Is_pi(), Is_string(), Is_switchPage(), IsCodepageTag(), tagWBXML_INFO::m_curpos, P_WBXML_INFO, and WBXML_INFO.

Referenced by Read_attribute(), and Read_pi().

00613 {
00614     WBXML_INFO tmpbuffer;
00615     memcpy(&tmpbuffer, buffer, sizeof(WBXML_INFO));
00616     tmpbuffer.m_curpos += SWITCHPAGE_SIZE;
00617 
00618     return ((Is_switchPage(buffer) && IsCodepageTag(&tmpbuffer, CP_TAG_ATTRVALUE)) ||
00619             IsCodepageTag(buffer, CP_TAG_ATTRVALUE) ||
00620             Is_string(buffer) ||
00621             Is_extension(buffer) ||
00622             Is_entity(buffer) ||
00623             Is_pi(buffer) ||
00624             Is_opaque(buffer));
00625 }

Here is the call graph for this function:

BOOL Is_entity P_WBXML_INFO  buffer  ) 
 

Definition at line 675 of file decompile.c.

References BOOL, IsTag(), P_WBXML_INFO, and TAG_ENTITY.

Referenced by Is_attrValue(), Read_attrValue(), and Read_content().

00676 {
00677     return IsTag(buffer, TAG_ENTITY);
00678 }

Here is the call graph for this function:

BOOL Is_extension P_WBXML_INFO  buffer  ) 
 

Definition at line 627 of file decompile.c.

References BOOL, Is_switchPage(), IsTag(), tagWBXML_INFO::m_curpos, P_WBXML_INFO, TAG_EXT_0, TAG_EXT_1, TAG_EXT_2, TAG_EXT_I_0, TAG_EXT_I_1, TAG_EXT_I_2, TAG_EXT_T_0, TAG_EXT_T_1, TAG_EXT_T_2, and WBXML_INFO.

Referenced by Is_attrValue(), Read_attrValue(), and Read_content().

00628 {
00629     WBXML_INFO tmpbuffer;
00630     memcpy(&tmpbuffer, buffer, sizeof(WBXML_INFO));
00631     tmpbuffer.m_curpos += SWITCHPAGE_SIZE;
00632 
00633     return ((Is_switchPage(buffer) &&
00634              (IsTag(&tmpbuffer, TAG_EXT_0) ||
00635               IsTag(&tmpbuffer, TAG_EXT_1) ||
00636               IsTag(&tmpbuffer, TAG_EXT_2) ||
00637               IsTag(&tmpbuffer, TAG_EXT_T_0) ||
00638               IsTag(&tmpbuffer, TAG_EXT_T_1) ||
00639               IsTag(&tmpbuffer, TAG_EXT_T_2) ||
00640               IsTag(&tmpbuffer, TAG_EXT_I_0) ||
00641               IsTag(&tmpbuffer, TAG_EXT_I_1) ||
00642               IsTag(&tmpbuffer, TAG_EXT_I_2))) ||
00643             (IsTag(buffer, TAG_EXT_0) ||
00644              IsTag(buffer, TAG_EXT_1) ||
00645              IsTag(buffer, TAG_EXT_2) ||
00646              IsTag(buffer, TAG_EXT_T_0) ||
00647              IsTag(buffer, TAG_EXT_T_1) ||
00648              IsTag(buffer, TAG_EXT_T_2) ||
00649              IsTag(buffer, TAG_EXT_I_0) ||
00650              IsTag(buffer, TAG_EXT_I_1) ||
00651              IsTag(buffer, TAG_EXT_I_2)));
00652 }

Here is the call graph for this function:

BOOL Is_inline P_WBXML_INFO  buffer  ) 
 

Definition at line 665 of file decompile.c.

References BOOL, IsTag(), P_WBXML_INFO, and TAG_STR_I.

Referenced by Is_string(), and Read_string().

00666 {
00667     return IsTag(buffer, TAG_STR_I);
00668 }

Here is the call graph for this function:

BOOL Is_opaque P_WBXML_INFO  buffer  ) 
 

Definition at line 685 of file decompile.c.

References BOOL, IsTag(), P_WBXML_INFO, and TAG_OPAQUE.

Referenced by Is_attrValue(), Read_attrValue(), and Read_content().

00686 {
00687     return IsTag(buffer, TAG_OPAQUE);
00688 }

Here is the call graph for this function:

BOOL Is_pi P_WBXML_INFO  buffer  ) 
 

Definition at line 680 of file decompile.c.

References BOOL, IsTag(), P_WBXML_INFO, and TAG_PI.

Referenced by Is_attrValue(), Read_body(), and Read_content().

00681 {
00682     return IsTag(buffer, TAG_PI);
00683 }

Here is the call graph for this function:

BOOL Is_string P_WBXML_INFO  buffer  ) 
 

Definition at line 654 of file decompile.c.

References BOOL, Is_inline(), Is_tableref(), and P_WBXML_INFO.

Referenced by Is_attrValue(), Read_attrValue(), and Read_content().

00655 {
00656     return (Is_inline(buffer) ||
00657             Is_tableref(buffer));
00658 }

Here is the call graph for this function:

BOOL Is_switchPage P_WBXML_INFO  buffer  ) 
 

Definition at line 660 of file decompile.c.

References BOOL, IsTag(), P_WBXML_INFO, and TAG_SWITCH_PAGE.

Referenced by Is_attrValue(), Is_extension(), Read_attrStart(), Read_attrValue(), Read_element(), and Read_extension().

00661 {
00662     return IsTag(buffer, TAG_SWITCH_PAGE);
00663 }

Here is the call graph for this function:

BOOL Is_tableref P_WBXML_INFO  buffer  ) 
 

Definition at line 670 of file decompile.c.

References BOOL, IsTag(), P_WBXML_INFO, and TAG_STR_T.

Referenced by Is_string(), and Read_string().

00671 {
00672     return IsTag(buffer, TAG_STR_T);
00673 }

Here is the call graph for this function:

BOOL Is_zero P_WBXML_INFO  buffer  ) 
 

Definition at line 690 of file decompile.c.

References BOOL, BytesLeft(), ERR_END_OF_DATA, ERR_INTERNAL_BAD_PARAM, tagWBXML_INFO::m_curpos, P_WBXML_INFO, ParseError(), and result.

Referenced by Read_publicid().

00691 {
00692   BOOL result = FALSE;
00693 
00694   if (buffer) 
00695   {
00696     if (BytesLeft(buffer) >= 1) 
00697     {
00698       result = ((*buffer->m_curpos) == 0);
00699     }
00700     else
00701     {
00702       ParseError(ERR_END_OF_DATA);
00703     }
00704   }
00705   else
00706   {
00707     ParseError(ERR_INTERNAL_BAD_PARAM);
00708   }
00709 
00710   return result;
00711 }

Here is the call graph for this function:

BOOL IsCodepageTag P_WBXML_INFO  buffer,
CP_TAG_TYPE  type
 

Definition at line 594 of file decompile.c.

References BOOL, CP_TAG_ATTRSTART, CP_TAG_ATTRVALUE, CP_TAG_TAG, tagWBXML_INFO::m_curpos, P_WBXML_INFO, result, and WBXML_U_INT8.

Referenced by Is_attrValue(), Read_attrStart(), Read_attrValue(), and Read_stag().

00595 {
00596     WBXML_U_INT8 result = *(buffer->m_curpos);
00597 
00598     /* NOTE THAT THESE ARE NOT UNIQUE! */
00599     switch (type)
00600     {
00601         case CP_TAG_TAG:
00602             return TRUE;
00603         case CP_TAG_ATTRSTART:
00604             return ((result & 0x80) != 0x80);
00605         case CP_TAG_ATTRVALUE:
00606             return ((result & 0x80) == 0x80);
00607         default:
00608             return FALSE;
00609     }
00610 }

BOOL IsTag P_WBXML_INFO  buffer,
WBXML_TAG  tag
 

Definition at line 570 of file decompile.c.

References BOOL, BytesLeft(), ERR_INTERNAL_BAD_PARAM, tagWBXML_INFO::m_curpos, P_WBXML_INFO, ParseError(), result, and WBXML_TAG.

Referenced by Is_entity(), Is_extension(), Is_inline(), Is_opaque(), Is_pi(), Is_switchPage(), Is_tableref(), Read_attrStart(), Read_element(), Read_extension(), and Read_stag().

00571 {
00572   BOOL result = FALSE;
00573 
00574   if (buffer)
00575   {
00576     if (BytesLeft(buffer) >= sizeof(WBXML_TAG))
00577     {
00578       result = ((*((WBXML_TAG*) buffer->m_curpos)) == tag);
00579     }
00580     else
00581     {
00582         /* No more data, so nope, not this tag */
00583       result = FALSE;
00584     }
00585   }
00586   else
00587   {
00588     ParseError(ERR_INTERNAL_BAD_PARAM);
00589   }
00590 
00591   return result;
00592 }

Here is the call graph for this function:

long mb_u_int32_to_long P_WBXML_MB_U_INT32  value  ) 
 

Definition at line 873 of file decompile.c.

References ERR_INTERNAL_BAD_PARAM, ParseError(), and result.

Referenced by DumpNode(), GetStringTableString(), Read_opaque(), and Read_strtbl().

00874 {
00875   long result = 0;
00876 
00877   if (value)
00878   {
00879     int i;
00880     for (i = 0; i < MAX_MB_U_INT32_BYTES; i++)
00881     {
00882       result <<= 7;
00883       result |= ((*value)[i] & 0x7f);
00884 
00885       if ( !( (*value)[i] & 0x80 ) )
00886         break;
00887     }
00888   }
00889   else
00890   {
00891     ParseError(ERR_INTERNAL_BAD_PARAM);
00892   }
00893 
00894   return result;
00895 }

Here is the call graph for this function:

void Message char *  msg  ) 
 

Definition at line 485 of file decompile.c.

Referenced by ParseError(), and ParseWarning().

00486 {
00487   printf("%s\n", msg);
00488 }

void ParseError WBXML_PARSE_ERROR  error  ) 
 

Definition at line 490 of file decompile.c.

References ERR_END_OF_DATA, ERR_FILE_NOT_FOUND, ERR_FILE_NOT_READ, ERR_INTERNAL_BAD_PARAM, ERR_NOT_ENOUGH_MEMORY, ERR_TAG_NOT_FOUND, error(), and Message().

Referenced by BytesLeft(), CodepageAttrstartName(), CodepageAttrvalueName(), Is_zero(), IsTag(), main(), mb_u_int32_to_long(), NewNode(), Read_attrStart(), Read_attrValue(), Read_bytes(), Read_extension(), Read_mb_u_int32(), Read_stag(), Read_string(), Read_termstr_rtn(), Read_u_int8(), Read_zero(), ReadBinary(), ReadCodepageTag(), and ReadFixedTag().

00491 {
00492   switch (error)
00493   {
00494     case ERR_END_OF_DATA:
00495       Message("Input stream is incomplete (EOF).");
00496       break;
00497 
00498     case ERR_INTERNAL_BAD_PARAM:
00499       Message("Internal error: Bad parameter.");
00500       break;
00501 
00502     case ERR_TAG_NOT_FOUND:
00503       Message("Tag not found.");
00504       break;
00505         
00506     case ERR_FILE_NOT_FOUND:
00507       Message("File not found.");
00508       break;
00509 
00510     case ERR_FILE_NOT_READ:
00511       Message("File read error.");
00512       break;
00513 
00514     case ERR_NOT_ENOUGH_MEMORY:
00515       Message("Not enough memory");
00516       break;
00517 
00518     default:
00519       Message("Unknown error.");
00520       break;
00521   }
00522 
00523   exit(error);
00524 }

Here is the call graph for this function:

void ParseWarning WBXML_PARSE_WARNING  warning  ) 
 

Definition at line 526 of file decompile.c.

References Message(), WARN_FUTURE_EXPANSION_EXT_0, WARN_FUTURE_EXPANSION_EXT_1, and WARN_FUTURE_EXPANSION_EXT_2.

Referenced by Read_extension().

00527 {
00528   switch (warning)
00529   {
00530     case WARN_FUTURE_EXPANSION_EXT_0:
00531       Message("Token EXT_0 encountered. This token is reserved for future expansion.");
00532       break;
00533 
00534     case WARN_FUTURE_EXPANSION_EXT_1:
00535       Message("Token EXT_1 encountered. This token is reserved for future expansion.");
00536       break;
00537 
00538     case WARN_FUTURE_EXPANSION_EXT_2:
00539       Message("Token EXT_2 encountered. This token is reserved for future expansion.");
00540       break;
00541 
00542     default:
00543       Message("Unknown warning.");
00544       break;
00545   }
00546 }

Here is the call graph for this function:

void Read_attribute P_WBXML_INFO  buffer  ) 
 

Definition at line 1067 of file decompile.c.

References Is_attrValue(), P_WBXML_INFO, Read_attrStart(), and Read_attrValue().

Referenced by Read_element().

01068 {
01069     Read_attrStart(buffer);
01070 
01071     while (Is_attrValue(buffer))
01072     {
01073         Read_attrValue(buffer);
01074     }
01075 }

Here is the call graph for this function:

void Read_attrStart P_WBXML_INFO  buffer  ) 
 

Definition at line 1077 of file decompile.c.

References AddAttrStartLiteralNode(), AddAttrStartNode(), CP_TAG_ATTRSTART, ERR_TAG_NOT_FOUND, Is_switchPage(), IsCodepageTag(), IsTag(), P_WBXML_INFO, ParseError(), Read_index(), Read_switchPage(), ReadCodepageTag(), ReadFixedTag(), TAG_LITERAL, WBXML_MB_U_INT32, and WBXML_TAG.

Referenced by Read_attribute(), and Read_pi().

01078 {
01079   if (Is_switchPage(buffer))
01080   {
01081     WBXML_TAG tag;
01082     Read_switchPage(buffer);
01083     tag = ReadCodepageTag(buffer, CP_TAG_ATTRSTART);
01084 
01085     AddAttrStartNode(buffer, tag);
01086   }
01087   else if (IsCodepageTag(buffer, CP_TAG_ATTRSTART))
01088   {
01089     WBXML_TAG tag;
01090     tag = ReadCodepageTag(buffer, CP_TAG_ATTRSTART);
01091 
01092     AddAttrStartNode(buffer, tag);
01093   }
01094   else if (IsTag(buffer, TAG_LITERAL))
01095   {
01096     WBXML_MB_U_INT32 index;
01097 
01098     ReadFixedTag(buffer, TAG_LITERAL);
01099     Read_index(buffer, &index);
01100 
01101     AddAttrStartLiteralNode(buffer, index);
01102   }
01103   else
01104   {
01105     ParseError(ERR_TAG_NOT_FOUND);
01106   }
01107 }

Here is the call graph for this function:

void Read_attrValue P_WBXML_INFO  buffer  ) 
 

Definition at line 1109 of file decompile.c.

References AddAttrValueNode(), CP_TAG_ATTRVALUE, ERR_TAG_NOT_FOUND, Is_entity(), Is_extension(), Is_opaque(), Is_string(), Is_switchPage(), IsCodepageTag(), P_WBXML_INFO, ParseError(), Read_entity(), Read_extension(), Read_opaque(), Read_string(), Read_switchPage(), ReadCodepageTag(), and WBXML_TAG.

Referenced by Read_attribute(), and Read_pi().

01110 {
01111   if (Is_switchPage(buffer))
01112   {
01113     WBXML_TAG tag;
01114     Read_switchPage(buffer);
01115     tag = ReadCodepageTag(buffer, CP_TAG_ATTRVALUE);
01116     AddAttrValueNode(buffer, tag);
01117   }
01118   else if (IsCodepageTag(buffer, CP_TAG_ATTRVALUE))
01119   {
01120     WBXML_TAG tag;
01121     tag = ReadCodepageTag(buffer, CP_TAG_ATTRVALUE);
01122     AddAttrValueNode(buffer, tag);
01123   }
01124   else if (Is_string(buffer))
01125   {
01126     Read_string(buffer);
01127   }
01128   else if (Is_extension(buffer))
01129   {
01130     Read_extension(buffer);
01131   }
01132   else if (Is_entity(buffer))
01133   {
01134     Read_entity(buffer);
01135   }
01136   else if (Is_opaque(buffer))
01137   {
01138     Read_opaque(buffer);
01139   }
01140   else
01141   {
01142     ParseError(ERR_TAG_NOT_FOUND);
01143   }
01144 }

Here is the call graph for this function:

void Read_body P_WBXML_INFO  buffer  ) 
 

Definition at line 953 of file decompile.c.

References Is_pi(), P_WBXML_INFO, Read_element(), and Read_pi().

Referenced by Read_start().

00954 {
00955   while (Is_pi(buffer))
00956   {
00957     Read_pi(buffer);
00958   }
00959 
00960   Read_element(buffer);
00961 
00962   while (Is_pi(buffer))
00963   {
00964     Read_pi(buffer);
00965   }
00966 }

Here is the call graph for this function:

void Read_bytes P_WBXML_INFO  buffer,
WBXML_LENGTH  length,
P_WBXML_BYTES  result
 

Definition at line 765 of file decompile.c.

References BytesLeft(), ERR_END_OF_DATA, ERR_INTERNAL_BAD_PARAM, tagWBXML_INFO::m_curpos, malloc, P_WBXML_INFO, ParseError(), and result.

Referenced by Read_opaque(), and Read_strtbl().

00766 {
00767   if (buffer && result)
00768   {
00769     if (BytesLeft(buffer) >= length) 
00770     {
00771       *result = (WBXML_BYTES) malloc(length*sizeof(unsigned char));
00772       memcpy(*result, buffer->m_curpos, length);
00773       buffer->m_curpos += length;
00774     }
00775     else
00776     {
00777       ParseError(ERR_END_OF_DATA);
00778     }
00779   }
00780   else
00781   {
00782     ParseError(ERR_INTERNAL_BAD_PARAM);
00783   }
00784 }

Here is the call graph for this function:

void Read_charset P_WBXML_INFO  buffer  ) 
 

Definition at line 1334 of file decompile.c.

References P_WBXML_INFO, Read_mb_u_int32(), result, and WBXML_MB_U_INT32.

Referenced by Read_start().

01335 {
01336   WBXML_MB_U_INT32 result;
01337 
01338   Read_mb_u_int32(buffer, &result);
01339 }

Here is the call graph for this function:

void Read_content P_WBXML_INFO  buffer  ) 
 

Definition at line 1011 of file decompile.c.

References Is_entity(), Is_extension(), Is_opaque(), Is_pi(), Is_string(), P_WBXML_INFO, Read_element(), Read_entity(), Read_extension(), Read_opaque(), Read_pi(), and Read_string().

Referenced by Read_element().

01012 {
01013     if (Is_string(buffer))
01014     {
01015         Read_string(buffer);
01016     }
01017     else if (Is_extension(buffer))
01018     {
01019         Read_extension(buffer);
01020     }
01021     else if (Is_entity(buffer))
01022     {
01023         Read_entity(buffer);
01024     }
01025     else if (Is_pi(buffer))
01026     {
01027         Read_pi(buffer);
01028     }
01029     else if (Is_opaque(buffer))
01030     {
01031         Read_opaque(buffer);
01032     }
01033     else
01034     {
01035         /* Assume it is an element */
01036         Read_element(buffer);
01037     }
01038 }

Here is the call graph for this function:

void Read_element P_WBXML_INFO  buffer  ) 
 

Definition at line 968 of file decompile.c.

References AddAttrEndNode(), Is_switchPage(), IsTag(), tagWBXML_NODE::m_child, tagWBXML_INFO::m_curnode, tagWBXML_NODE::m_parent, tagWBXML_INFO::m_tree, P_WBXML_INFO, Read_attribute(), Read_content(), Read_stag(), Read_switchPage(), ReadFixedTag(), TAG_END, and WBXML_TAG.

Referenced by Read_body(), and Read_content().

00969 {
00970   WBXML_TAG stagvalue = 0;
00971 
00972   if (Is_switchPage(buffer))
00973   {
00974     Read_switchPage(buffer);
00975   }
00976 
00977   stagvalue = Read_stag(buffer);
00978 
00979   /* move the current node down to this one in the tree */
00980   if (buffer->m_curnode)
00981       buffer->m_curnode = buffer->m_curnode->m_child;
00982   else buffer->m_curnode = buffer->m_tree;
00983 
00984   if ((stagvalue & CODEPAGE_TAG_HAS_ATTRS) == CODEPAGE_TAG_HAS_ATTRS)
00985   {
00986     do
00987     {
00988       Read_attribute(buffer);
00989 
00990     } while (!IsTag(buffer, TAG_END));
00991 
00992     ReadFixedTag(buffer, TAG_END);
00993 
00994     AddAttrEndNode(buffer);
00995   }
00996 
00997   if ((stagvalue & CODEPAGE_TAG_HAS_CONTENT) == CODEPAGE_TAG_HAS_CONTENT)
00998   {
00999     while (!IsTag(buffer, TAG_END))
01000     {
01001       Read_content(buffer);
01002     }
01003 
01004     ReadFixedTag(buffer, TAG_END);
01005   }
01006 
01007   /* move the current node back up one */
01008   buffer->m_curnode = buffer->m_curnode->m_parent;
01009 }

Here is the call graph for this function:

void Read_entcode P_WBXML_INFO  buffer  ) 
 

Definition at line 1278 of file decompile.c.

References P_WBXML_INFO, Read_mb_u_int32(), result, and WBXML_MB_U_INT32.

Referenced by Read_entity().

01279 {
01280     WBXML_MB_U_INT32 result;
01281     Read_mb_u_int32(buffer, &result);
01282 }

Here is the call graph for this function:

void Read_entity P_WBXML_INFO  buffer  ) 
 

Definition at line 1272 of file decompile.c.

References P_WBXML_INFO, Read_entcode(), ReadFixedTag(), and TAG_ENTITY.

Referenced by Read_attrValue(), and Read_content().

01273 {
01274     ReadFixedTag(buffer, TAG_ENTITY);
01275     Read_entcode(buffer);
01276 }

Here is the call graph for this function:

void Read_extension P_WBXML_INFO  buffer  ) 
 

Definition at line 1146 of file decompile.c.

References AddVariableIndexNode(), AddVariableStringNode(), ERR_TAG_NOT_FOUND, Is_switchPage(), IsTag(), P_WBXML_INFO, ParseError(), ParseWarning(), Read_index(), Read_switchPage(), Read_termstr_rtn(), ReadFixedTag(), TAG_EXT_0, TAG_EXT_1, TAG_EXT_2, TAG_EXT_I_0, TAG_EXT_I_1, TAG_EXT_I_2, TAG_EXT_T_0, TAG_EXT_T_1, TAG_EXT_T_2, VAR_ESCAPED, VAR_UNCHANGED, VAR_UNESCAPED, WARN_FUTURE_EXPANSION_EXT_0, WARN_FUTURE_EXPANSION_EXT_1, WARN_FUTURE_EXPANSION_EXT_2, and WBXML_MB_U_INT32.

Referenced by Read_attrValue(), and Read_content().

01147 {
01148     if (Is_switchPage(buffer))
01149     {
01150         Read_switchPage(buffer);
01151     }
01152 
01153     if (IsTag(buffer, TAG_EXT_I_0))
01154     {
01155         char* str = NULL;
01156 
01157         ReadFixedTag(buffer, TAG_EXT_I_0);
01158         Read_termstr_rtn(buffer, &str);
01159 
01160         AddVariableStringNode(buffer, str, VAR_ESCAPED); 
01161     }
01162     else if (IsTag(buffer, TAG_EXT_I_1))
01163     {
01164         char* str = NULL;
01165 
01166         ReadFixedTag(buffer, TAG_EXT_I_1);
01167         Read_termstr_rtn(buffer, &str);
01168 
01169         AddVariableStringNode(buffer, str, VAR_UNESCAPED); 
01170     }
01171     else if (IsTag(buffer, TAG_EXT_I_2))
01172     {
01173         char* str = NULL;
01174 
01175         ReadFixedTag(buffer, TAG_EXT_I_2);
01176         Read_termstr_rtn(buffer, &str);
01177 
01178         AddVariableStringNode(buffer, str, VAR_UNCHANGED); 
01179     }
01180     else if (IsTag(buffer, TAG_EXT_T_0))
01181     {
01182         WBXML_MB_U_INT32 index;
01183 
01184         ReadFixedTag(buffer, TAG_EXT_T_0);
01185         Read_index(buffer, &index);
01186 
01187         AddVariableIndexNode(buffer, index, VAR_ESCAPED);
01188     }
01189     else if (IsTag(buffer, TAG_EXT_T_1))
01190     {
01191         WBXML_MB_U_INT32 index;
01192 
01193         ReadFixedTag(buffer, TAG_EXT_T_1);
01194         Read_index(buffer, &index);
01195 
01196         AddVariableIndexNode(buffer, index, VAR_UNESCAPED);
01197     }
01198     else if (IsTag(buffer, TAG_EXT_T_2))
01199     {
01200         WBXML_MB_U_INT32 index;
01201 
01202         ReadFixedTag(buffer, TAG_EXT_T_2);
01203         Read_index(buffer, &index);
01204 
01205         AddVariableIndexNode(buffer, index, VAR_UNCHANGED);
01206     }
01207     else if (IsTag(buffer, TAG_EXT_0))
01208     {
01209         ReadFixedTag(buffer, TAG_EXT_0);
01210 
01211         ParseWarning(WARN_FUTURE_EXPANSION_EXT_0);
01212     }
01213     else if (IsTag(buffer, TAG_EXT_1))
01214     {
01215         ReadFixedTag(buffer, TAG_EXT_1);
01216 
01217         ParseWarning(WARN_FUTURE_EXPANSION_EXT_1);
01218     }
01219     else if (IsTag(buffer, TAG_EXT_2))
01220     {
01221         ReadFixedTag(buffer, TAG_EXT_2);
01222 
01223         ParseWarning(WARN_FUTURE_EXPANSION_EXT_2);
01224     }
01225     else
01226     {
01227         ParseError(ERR_TAG_NOT_FOUND);
01228     }
01229 }

Here is the call graph for this function:

void Read_index P_WBXML_INFO  buffer,
P_WBXML_MB_U_INT32  result
 

Definition at line 1398 of file decompile.c.

References P_WBXML_INFO, Read_mb_u_int32(), and result.

Referenced by Read_attrStart(), Read_extension(), Read_publicid(), Read_stag(), and Read_tableref().

01399 {
01400   Read_mb_u_int32(buffer, result);
01401 }

Here is the call graph for this function:

void Read_inline P_WBXML_INFO  buffer  ) 
 

Definition at line 1258 of file decompile.c.

References P_WBXML_INFO, Read_termstr(), ReadFixedTag(), and TAG_STR_I.

Referenced by Read_string().

01259 {
01260     ReadFixedTag(buffer, TAG_STR_I);
01261     Read_termstr(buffer);
01262 }

Here is the call graph for this function:

void Read_length P_WBXML_INFO  buffer,
P_WBXML_MB_U_INT32  result
 

Definition at line 1403 of file decompile.c.

References P_WBXML_INFO, Read_mb_u_int32(), and result.

Referenced by Read_opaque().

01404 {
01405   Read_mb_u_int32(buffer, result);
01406 }

Here is the call graph for this function:

void Read_mb_u_int32 P_WBXML_INFO  buffer,
P_WBXML_MB_U_INT32  result
 

Definition at line 738 of file decompile.c.

References BytesLeft(), ERR_END_OF_DATA, ERR_INTERNAL_BAD_PARAM, tagWBXML_INFO::m_curpos, P_WBXML_INFO, and ParseError().

Referenced by Read_charset(), Read_entcode(), Read_index(), Read_length(), Read_publicid(), and Read_strtbl().

00739 {
00740   if (buffer && result)
00741   {
00742     int i;
00743     for (i = 0; i < MAX_MB_U_INT32_BYTES; i++)
00744     {
00745       if (BytesLeft(buffer) >= 1)
00746       {
00747         (*result)[i] = *(buffer->m_curpos);
00748         (buffer->m_curpos)++;
00749 
00750         if ( !( (*result)[i] & 0x80 ) )
00751           break;
00752       }
00753       else
00754       {
00755         ParseError(ERR_END_OF_DATA);
00756       }
00757     }
00758   }
00759   else
00760   {
00761     ParseError(ERR_INTERNAL_BAD_PARAM);
00762   }
00763 }

Here is the call graph for this function:

void Read_opaque P_WBXML_INFO  buffer  ) 
 

Definition at line 1297 of file decompile.c.

References data, mb_u_int32_to_long(), P_WBXML_INFO, Read_bytes(), Read_length(), ReadFixedTag(), TAG_OPAQUE, WBXML_BYTES, and WBXML_MB_U_INT32.

Referenced by Read_attrValue(), and Read_content().

01298 {
01299   WBXML_MB_U_INT32 length;
01300   WBXML_BYTES      data;
01301 
01302   ReadFixedTag(buffer, TAG_OPAQUE);
01303   Read_length(buffer, &length);
01304   Read_bytes(buffer, mb_u_int32_to_long(&length), &data);
01305 }

Here is the call graph for this function:

void Read_pageindex P_WBXML_INFO  buffer,
P_WBXML_U_INT8  result
 

Definition at line 1420 of file decompile.c.

References P_WBXML_INFO, Read_u_int8(), and result.

Referenced by Read_switchPage().

01421 {
01422   Read_u_int8(buffer, result);
01423 }

Here is the call graph for this function:

void Read_pi P_WBXML_INFO  buffer  ) 
 

Definition at line 1284 of file decompile.c.

References Is_attrValue(), P_WBXML_INFO, Read_attrStart(), Read_attrValue(), ReadFixedTag(), TAG_END, and TAG_PI.

Referenced by Read_body(), and Read_content().

01285 {
01286   ReadFixedTag(buffer, TAG_PI);
01287   Read_attrStart(buffer);
01288   
01289   while (Is_attrValue(buffer))
01290   {
01291     Read_attrValue(buffer);
01292   }
01293 
01294   ReadFixedTag(buffer, TAG_END);
01295 }

Here is the call graph for this function:

void Read_publicid P_WBXML_INFO  buffer  ) 
 

Definition at line 1314 of file decompile.c.

References AddDTDNode(), Is_zero(), P_WBXML_INFO, Read_index(), Read_mb_u_int32(), result, WBXML_MB_U_INT32, and ZERO_WBXML_MB_U_INT32.

Referenced by Read_start().

01315 {
01316   if (Is_zero(buffer))
01317   {
01318     WBXML_MB_U_INT32 index;
01319 
01320     Read_index(buffer, &index);
01321 
01322     AddDTDNode(buffer, ZERO_WBXML_MB_U_INT32, index);
01323   }
01324   else
01325   {
01326     WBXML_MB_U_INT32 result;
01327 
01328     Read_mb_u_int32(buffer, &result);
01329 
01330     AddDTDNode(buffer, result, ZERO_WBXML_MB_U_INT32);
01331   }
01332 }

Here is the call graph for this function:

WBXML_TAG Read_stag P_WBXML_INFO  buffer  ) 
 

Definition at line 1040 of file decompile.c.

References AddCodepageLiteralTagNode(), AddCodepageTagNode(), CP_TAG_TAG, ERR_TAG_NOT_FOUND, IsCodepageTag(), IsTag(), P_WBXML_INFO, ParseError(), Read_index(), ReadCodepageTag(), ReadFixedTag(), TAG_LITERAL, WBXML_MB_U_INT32, and WBXML_TAG.

Referenced by Read_element().

01041 {
01042     if (IsCodepageTag(buffer, CP_TAG_TAG))
01043     {
01044         WBXML_TAG tag = ReadCodepageTag(buffer, CP_TAG_TAG);
01045 
01046         AddCodepageTagNode(buffer, tag);
01047 
01048         return tag;
01049     }
01050     else if (IsTag(buffer, TAG_LITERAL))
01051     {
01052         WBXML_MB_U_INT32 index;
01053 
01054         ReadFixedTag(buffer, TAG_LITERAL);
01055         Read_index(buffer, &index);
01056 
01057         AddCodepageLiteralTagNode(buffer, index);
01058     }
01059     else
01060     {
01061         ParseError(ERR_TAG_NOT_FOUND);
01062     }
01063 
01064     return 0;
01065 }

Here is the call graph for this function:

void Read_start P_WBXML_INFO  buffer  ) 
 

Definition at line 935 of file decompile.c.

References P_WBXML_INFO, Read_body(), Read_charset(), Read_publicid(), Read_strtbl(), and Read_version().

Referenced by main().

00936 {
00937   Read_version(buffer);
00938   Read_publicid(buffer);
00939   Read_charset(buffer);
00940   Read_strtbl(buffer);
00941   Read_body(buffer);
00942 }

Here is the call graph for this function:

void Read_string P_WBXML_INFO  buffer  ) 
 

Definition at line 1231 of file decompile.c.

References ERR_TAG_NOT_FOUND, Is_inline(), Is_tableref(), P_WBXML_INFO, ParseError(), Read_inline(), and Read_tableref().

Referenced by Read_attrValue(), and Read_content().

01232 {
01233     if (Is_inline(buffer))
01234     {
01235         Read_inline(buffer);
01236     }
01237     else if (Is_tableref(buffer))
01238     {
01239         Read_tableref(buffer);
01240     }
01241     else
01242     {
01243         ParseError(ERR_TAG_NOT_FOUND);
01244     }
01245 }

Here is the call graph for this function:

void Read_strtbl P_WBXML_INFO  buffer  ) 
 

Definition at line 944 of file decompile.c.

References AddStringTableNode(), tagWBXML_STRING_TABLE::m_length, tagWBXML_STRING_TABLE::m_strings, mb_u_int32_to_long(), P_WBXML_INFO, Read_bytes(), Read_mb_u_int32(), result, and WBXML_STRING_TABLE.

Referenced by Read_start().

00945 {
00946   WBXML_STRING_TABLE result;
00947   Read_mb_u_int32(buffer, &(result.m_length));
00948   Read_bytes(buffer, mb_u_int32_to_long(&(result.m_length)), &(result.m_strings));
00949 
00950   AddStringTableNode(buffer, &result);
00951 }

Here is the call graph for this function:

void Read_switchPage P_WBXML_INFO  buffer  ) 
 

Definition at line 1247 of file decompile.c.

References tagWBXML_INFO::m_curpage, P_WBXML_INFO, Read_pageindex(), ReadFixedTag(), TAG_SWITCH_PAGE, and WBXML_U_INT8.

Referenced by Read_attrStart(), Read_attrValue(), Read_element(), and Read_extension().

01248 {
01249   WBXML_U_INT8 pageindex;
01250 
01251   ReadFixedTag(buffer, TAG_SWITCH_PAGE);
01252   Read_pageindex(buffer, &pageindex);
01253 
01254   /* Use the new codepage */
01255   buffer->m_curpage = pageindex;
01256 }

Here is the call graph for this function:

void Read_tableref P_WBXML_INFO  buffer  ) 
 

Definition at line 1264 of file decompile.c.

References P_WBXML_INFO, Read_index(), ReadFixedTag(), TAG_STR_T, and WBXML_MB_U_INT32.

Referenced by Read_string().

01265 {
01266   WBXML_MB_U_INT32 index;
01267 
01268   ReadFixedTag(buffer, TAG_STR_T);
01269   Read_index(buffer, &index);
01270 }

Here is the call graph for this function:

void Read_termstr P_WBXML_INFO  buffer  ) 
 

Definition at line 1387 of file decompile.c.

References AddStringNode(), free, P_WBXML_INFO, and Read_termstr_rtn().

Referenced by Read_inline().

01388 {
01389     char* strbuf = NULL;
01390 
01391     Read_termstr_rtn(buffer, &strbuf);
01392 
01393     AddStringNode(buffer, strbuf);
01394 
01395     free(strbuf);
01396 }

Here is the call graph for this function:

void Read_termstr_rtn P_WBXML_INFO  buffer,
char **  result
 

Definition at line 1341 of file decompile.c.

References BOOL, BytesLeft(), ERR_INTERNAL_BAD_PARAM, free, tagWBXML_INFO::m_curpos, malloc, P_WBXML_INFO, ParseError(), realloc, and result.

Referenced by Read_extension(), and Read_termstr().

01342 {
01343 
01344 #define STRING_BLOCK_SIZE 256
01345 
01346     int buflen = STRING_BLOCK_SIZE;
01347     char* strbuf = (char*) malloc(buflen);
01348     BOOL doubled = FALSE;
01349     int i = 0;
01350 
01351     if (!result)
01352         ParseError(ERR_INTERNAL_BAD_PARAM);
01353 
01354     while ( (BytesLeft(buffer) >= 1) && (*(buffer->m_curpos) != 0) )
01355     {
01356         if (i>=buflen)
01357         {
01358             buflen += STRING_BLOCK_SIZE;
01359             strbuf = realloc(strbuf, buflen);
01360         }
01361 
01362         if (*(buffer->m_curpos) != '$' || doubled == TRUE)
01363         {
01364             strbuf[i] = *(buffer->m_curpos);
01365             buffer->m_curpos++;
01366             i++;
01367             if (doubled == TRUE)
01368                 doubled = FALSE;
01369         }
01370         else
01371         {
01372             strbuf[i] = *(buffer->m_curpos);
01373             i++;
01374             doubled = TRUE;
01375         }
01376     }
01377 
01378     strbuf[i] = 0;
01379     buffer->m_curpos++;
01380 
01381     if (*result)
01382         free(*result);
01383 
01384     *result = strbuf;
01385 }

Here is the call graph for this function:

void Read_u_int8 P_WBXML_INFO  buffer,
P_WBXML_U_INT8  result
 

Definition at line 718 of file decompile.c.

References BytesLeft(), ERR_END_OF_DATA, ERR_INTERNAL_BAD_PARAM, tagWBXML_INFO::m_curpos, P_WBXML_INFO, ParseError(), and result.

Referenced by Read_pageindex(), Read_version(), and Read_zero().

00719 {
00720   if (buffer && result)
00721   {
00722     if (BytesLeft(buffer) >= 1) 
00723     {
00724       *result = *(buffer->m_curpos);
00725       (buffer->m_curpos)++;
00726     }
00727     else
00728     {
00729       ParseError(ERR_END_OF_DATA);
00730     }
00731   }
00732   else
00733   {
00734     ParseError(ERR_INTERNAL_BAD_PARAM);
00735   }
00736 }

Here is the call graph for this function:

void Read_version P_WBXML_INFO  buffer  ) 
 

Definition at line 1307 of file decompile.c.

References P_WBXML_INFO, Read_u_int8(), result, and WBXML_U_INT8.

Referenced by Read_start().

01308 {
01309   WBXML_U_INT8 result;
01310 
01311   Read_u_int8(buffer, &result);
01312 }

Here is the call graph for this function:

void Read_zero P_WBXML_INFO  buffer  ) 
 

Definition at line 1408 of file decompile.c.

References ERR_TAG_NOT_FOUND, P_WBXML_INFO, ParseError(), Read_u_int8(), result, and WBXML_U_INT8.

01409 {
01410   WBXML_U_INT8 result;
01411 
01412   Read_u_int8(buffer, &result);
01413 
01414   if (result != (WBXML_U_INT8) 0)
01415   {
01416     ParseError(ERR_TAG_NOT_FOUND);
01417   }
01418 }

Here is the call graph for this function:

WBXML_TAG ReadCodepageTag P_WBXML_INFO  buffer,
CP_TAG_TYPE  type
 

Definition at line 812 of file decompile.c.

References BytesLeft(), CP_TAG_ATTRSTART, CP_TAG_ATTRVALUE, CP_TAG_TAG, ERR_END_OF_DATA, ERR_INTERNAL_BAD_PARAM, ERR_TAG_NOT_FOUND, tagWBXML_INFO::m_curpos, P_WBXML_INFO, ParseError(), and WBXML_TAG.

Referenced by Read_attrStart(), Read_attrValue(), and Read_stag().

00813 {
00814   WBXML_TAG tag = 0;
00815 
00816   if (buffer)
00817   {
00818     if (BytesLeft(buffer) >= sizeof(WBXML_TAG))
00819     {
00820       tag = *((WBXML_TAG*) buffer->m_curpos);
00821 
00822       switch (type)
00823       {
00824         case CP_TAG_TAG:
00825           buffer->m_curpos += sizeof(WBXML_TAG);
00826           break;
00827 
00828         case CP_TAG_ATTRSTART:
00829           if ((tag & 0x80) != 0x80)
00830           {
00831             buffer->m_curpos += sizeof(WBXML_TAG);
00832           }
00833           else
00834           {
00835               ParseError(ERR_TAG_NOT_FOUND);
00836           }
00837           break;
00838 
00839         case CP_TAG_ATTRVALUE:
00840           if ((tag & 0x80) == 0x80)
00841           {
00842             buffer->m_curpos += sizeof(WBXML_TAG);
00843           }
00844           else
00845           {
00846               ParseError(ERR_TAG_NOT_FOUND);
00847           }
00848           break;
00849 
00850         default:
00851           ParseError(ERR_TAG_NOT_FOUND);
00852           break;
00853       }
00854     }
00855     else
00856     {
00857       ParseError(ERR_END_OF_DATA);
00858     }
00859   }
00860   else
00861   {
00862     ParseError(ERR_INTERNAL_BAD_PARAM);
00863   }
00864 
00865   return tag;
00866 }

Here is the call graph for this function:

void ReadFixedTag P_WBXML_INFO  buffer,
WBXML_TAG  tag
 

Definition at line 786 of file decompile.c.

References BytesLeft(), ERR_END_OF_DATA, ERR_INTERNAL_BAD_PARAM, ERR_TAG_NOT_FOUND, tagWBXML_INFO::m_curpos, P_WBXML_INFO, ParseError(), and WBXML_TAG.

Referenced by Read_attrStart(), Read_element(), Read_entity(), Read_extension(), Read_inline(), Read_opaque(), Read_pi(), Read_stag(), Read_switchPage(), and Read_tableref().

00787 {
00788   if (buffer)
00789   {
00790     if (BytesLeft(buffer) >= sizeof(WBXML_TAG))
00791     {
00792       if ((*((WBXML_TAG*) buffer->m_curpos)) == tag)
00793       {
00794         buffer->m_curpos += sizeof(WBXML_TAG);
00795       }
00796       else
00797       {
00798         ParseError(ERR_TAG_NOT_FOUND);
00799       }
00800     }
00801     else
00802     {
00803       ParseError(ERR_END_OF_DATA);
00804     }
00805   }
00806   else
00807   {
00808     ParseError(ERR_INTERNAL_BAD_PARAM);
00809   }
00810 }

Here is the call graph for this function:


Variable Documentation

const WBXML_MB_U_INT32 ZERO_WBXML_MB_U_INT32
 

Definition at line 72 of file decompile.c.

Referenced by Read_publicid().

See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.