Data Structures | Defines | Typedefs | Functions | Variables

xml-tree.c File Reference

#include "wizard/studio.h"
#include "wizard/blob.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/log.h"
#include "wizard/memory_.h"
#include "wizard/semaphore.h"
#include "wizard/splay-tree.h"
#include "wizard/string_.h"
#include "wizard/string-private.h"
#include "wizard/xml-tree.h"
#include "wizard/utility.h"

Data Structures

struct  _XMLTreeInfo
struct  _XMLTreeRoot

Defines

#define NumberPredefinedEntities   10
#define XMLWhitespace   "\t\r\n "

Typedefs

typedef struct _XMLTreeRoot XMLTreeRoot

Functions

WizardExport XMLTreeInfoAddChildToXMLTree (XMLTreeInfo *xml_info, const char *tag, const size_t offset)
WizardExport XMLTreeInfoAddPathToXMLTree (XMLTreeInfo *xml_info, const char *path, const size_t offset)
static unsigned char * ConvertLatin1ToUTF8 (const unsigned char *content)
WizardExport char * CanonicalXMLContent (const char *content, const WizardBooleanType pedantic)
static char ** DestroyXMLTreeAttributes (char **attributes)
WizardExport XMLTreeInfoDestroyXMLTree (XMLTreeInfo *xml_info)
WizardExport XMLTreeInfoGetNextXMLTreeTag (XMLTreeInfo *xml_info)
WizardExport const char * GetXMLTreeAttribute (XMLTreeInfo *xml_info, const char *tag)
WizardExport WizardBooleanType GetXMLTreeAttributes (const XMLTreeInfo *xml_info, SplayTreeInfo *attributes)
WizardExport XMLTreeInfoGetXMLTreeChild (XMLTreeInfo *xml_info, const char *tag)
WizardExport const char * GetXMLTreeContent (XMLTreeInfo *xml_info)
WizardExport XMLTreeInfoGetXMLTreeOrdered (XMLTreeInfo *xml_info)
WizardExport XMLTreeInfoGetXMLTreePath (XMLTreeInfo *xml_info, const char *path)
WizardExport const char ** GetXMLTreeProcessingInstructions (XMLTreeInfo *xml_info, const char *target)
WizardExport XMLTreeInfoGetXMLTreeSibling (XMLTreeInfo *xml_info)
WizardExport const char * GetXMLTreeTag (XMLTreeInfo *xml_info)
WizardExport XMLTreeInfoInsertTagIntoXMLTree (XMLTreeInfo *xml_info, XMLTreeInfo *child, const size_t offset)
static char * ConvertUTF16ToUTF8 (const char *content, size_t *length)
static char * ParseEntities (char *xml, char **entities, int state)
void ParseCharacterContent (XMLTreeRoot *root, char *xml, const size_t length, const char state)
static XMLTreeInfoParseCloseTag (XMLTreeRoot *root, char *tag, char *wizard_unused(xml), ExceptionInfo *exception)
static WizardBooleanType ValidateEntities (char *tag, char *xml, char **entities)
static void ParseProcessingInstructions (XMLTreeRoot *root, char *xml, size_t length)
static WizardBooleanType ParseInternalDoctype (XMLTreeRoot *root, char *xml, size_t length, ExceptionInfo *exception)
static void ParseOpenTag (XMLTreeRoot *root, char *tag, char **attributes)
WizardExport XMLTreeInfoNewXMLTree (const char *xml, ExceptionInfo *exception)
WizardExport XMLTreeInfoNewXMLTreeTag (const char *tag)
WizardExport XMLTreeInfoPruneTagFromXMLTree (XMLTreeInfo *xml_info)
WizardExport XMLTreeInfoSetXMLTreeAttribute (XMLTreeInfo *xml_info, const char *tag, const char *value)
WizardExport XMLTreeInfoSetXMLTreeContent (XMLTreeInfo *xml_info, const char *content)
static char * EncodePredefinedEntities (const char *source, ssize_t offset, char **destination, size_t *length, size_t *extent, WizardBooleanType pedantic)
static char * XMLTreeTagToXML (XMLTreeInfo *xml_info, char **source, size_t *length, size_t *extent, size_t start, char ***attributes)
WizardExport char * XMLTreeInfoToXML (XMLTreeInfo *xml_info)

Variables

static char * sentinel [] = { (char *) NULL }

Define Documentation

#define NumberPredefinedEntities   10

Referenced by DestroyXMLTree(), and NewXMLTreeTag().

#define XMLWhitespace   "\t\r\n "

Typedef Documentation

typedef struct _XMLTreeRoot XMLTreeRoot

Function Documentation

WizardExport XMLTreeInfo* AddChildToXMLTree ( XMLTreeInfo xml_info,
const char *  tag,
const size_t  offset 
)
WizardExport XMLTreeInfo* AddPathToXMLTree ( XMLTreeInfo xml_info,
const char *  path,
const size_t  offset 
)
WizardExport char* CanonicalXMLContent ( const char *  content,
const WizardBooleanType  pedantic 
)
static unsigned char* ConvertLatin1ToUTF8 ( const unsigned char *  content  )  [static]

References AcquireQuantumMemory().

Referenced by CanonicalXMLContent().

static char* ConvertUTF16ToUTF8 ( const char *  content,
size_t *  length 
) [static]
WizardExport XMLTreeInfo* DestroyXMLTree ( XMLTreeInfo xml_info  ) 
static char** DestroyXMLTreeAttributes ( char **  attributes  )  [static]
static char* EncodePredefinedEntities ( const char *  source,
ssize_t  offset,
char **  destination,
size_t *  length,
size_t *  extent,
WizardBooleanType  pedantic 
) [static]
WizardExport XMLTreeInfo* GetNextXMLTreeTag ( XMLTreeInfo xml_info  ) 
WizardExport const char* GetXMLTreeAttribute ( XMLTreeInfo xml_info,
const char *  tag 
)
WizardExport WizardBooleanType GetXMLTreeAttributes ( const XMLTreeInfo xml_info,
SplayTreeInfo attributes 
)
WizardExport XMLTreeInfo* GetXMLTreeChild ( XMLTreeInfo xml_info,
const char *  tag 
)
WizardExport const char* GetXMLTreeContent ( XMLTreeInfo xml_info  ) 
WizardExport XMLTreeInfo* GetXMLTreeOrdered ( XMLTreeInfo xml_info  ) 
WizardExport XMLTreeInfo* GetXMLTreePath ( XMLTreeInfo xml_info,
const char *  path 
)
WizardExport const char** GetXMLTreeProcessingInstructions ( XMLTreeInfo xml_info,
const char *  target 
)
WizardExport XMLTreeInfo* GetXMLTreeSibling ( XMLTreeInfo xml_info  ) 
WizardExport const char* GetXMLTreeTag ( XMLTreeInfo xml_info  ) 
WizardExport XMLTreeInfo* InsertTagIntoXMLTree ( XMLTreeInfo xml_info,
XMLTreeInfo child,
const size_t  offset 
)
WizardExport XMLTreeInfo* NewXMLTree ( const char *  xml,
ExceptionInfo exception 
)
WizardExport XMLTreeInfo* NewXMLTreeTag ( const char *  tag  ) 
void ParseCharacterContent ( XMLTreeRoot root,
char *  xml,
const size_t  length,
const char  state 
)
static XMLTreeInfo* ParseCloseTag ( XMLTreeRoot root,
char *  tag,
char *  wizard_unusedxml,
ExceptionInfo exception 
) [static]
static char* ParseEntities ( char *  xml,
char **  entities,
int  state 
) [static]
static WizardBooleanType ParseInternalDoctype ( XMLTreeRoot root,
char *  xml,
size_t  length,
ExceptionInfo exception 
) [static]
static void ParseOpenTag ( XMLTreeRoot root,
char *  tag,
char **  attributes 
) [static]
static void ParseProcessingInstructions ( XMLTreeRoot root,
char *  xml,
size_t  length 
) [static]
WizardExport XMLTreeInfo* PruneTagFromXMLTree ( XMLTreeInfo xml_info  ) 
WizardExport XMLTreeInfo* SetXMLTreeAttribute ( XMLTreeInfo xml_info,
const char *  tag,
const char *  value 
)
WizardExport XMLTreeInfo* SetXMLTreeContent ( XMLTreeInfo xml_info,
const char *  content 
)
static WizardBooleanType ValidateEntities ( char *  tag,
char *  xml,
char **  entities 
) [static]

References WizardFalse, and WizardTrue.

Referenced by ParseInternalDoctype().

WizardExport char* XMLTreeInfoToXML ( XMLTreeInfo xml_info  ) 
static char* XMLTreeTagToXML ( XMLTreeInfo xml_info,
char **  source,
size_t *  length,
size_t *  extent,
size_t  start,
char ***  attributes 
) [static]

Variable Documentation

char* sentinel[] = { (char *) NULL } [static]