MagickCore 7.0.10
xml-tree.c File Reference
Include dependency graph for xml-tree.c:

Go to the source code of this file.

Data Structures

struct  _XMLTreeInfo
 
struct  _XMLTreeRoot
 

Macros

#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)
 
static void DestroyXMLTreeChild (XMLTreeInfo *xml_info)
 
static void DestroyXMLTreeOrdered (XMLTreeInfo *xml_info)
 
static void DestroyXMLTreeRoot (XMLTreeInfo *xml_info)
 
WizardExport XMLTreeInfoDestroyXMLTree (XMLTreeInfo *xml_info)
 
WizardPrivate char * FileToXML (const char *filename, const size_t extent)
 
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, ExceptionInfo *exception)
 
static WizardBooleanType ValidateEntities (char *tag, char *xml, const size_t depth, 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)
 
static WizardBooleanType IsSkipTag (const char *tag)
 
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 }
 
static const char * ignore_tags [3]
 

Macro Definition Documentation

◆ NumberPredefinedEntities

#define NumberPredefinedEntities   10

Definition at line 68 of file xml-tree.c.

◆ XMLWhitespace

#define XMLWhitespace   "\t\r\n "

Definition at line 69 of file xml-tree.c.

Typedef Documentation

◆ XMLTreeRoot

typedef struct _XMLTreeRoot XMLTreeRoot

Definition at line 102 of file xml-tree.c.

Function Documentation

◆ AddChildToXMLTree()

◆ AddPathToXMLTree()

◆ CanonicalXMLContent()

◆ ConvertLatin1ToUTF8()

static unsigned char * ConvertLatin1ToUTF8 ( const unsigned char *  content)
static

Definition at line 296 of file xml-tree.c.

References AcquireQuantumMemory(), and _XMLTreeInfo::content.

Referenced by CanonicalXMLContent().

◆ ConvertUTF16ToUTF8()

static char * ConvertUTF16ToUTF8 ( const char *  content,
size_t *  length 
)
static

Definition at line 1313 of file xml-tree.c.

References AcquireQuantumMemory(), ResizeQuantumMemory(), and WizardPathExtent.

Referenced by NewXMLTree().

◆ DestroyXMLTree()

◆ DestroyXMLTreeAttributes()

static char ** DestroyXMLTreeAttributes ( char **  attributes)
static

Definition at line 476 of file xml-tree.c.

References _XMLTreeInfo::attributes, DestroyString(), RelinquishWizardMemory(), and sentinel.

Referenced by DestroyXMLTree(), and NewXMLTree().

◆ DestroyXMLTreeChild()

static void DestroyXMLTreeChild ( XMLTreeInfo xml_info)
static

Definition at line 500 of file xml-tree.c.

References _XMLTreeInfo::child, and DestroyXMLTree().

Referenced by DestroyXMLTree().

◆ DestroyXMLTreeOrdered()

static void DestroyXMLTreeOrdered ( XMLTreeInfo xml_info)
static

Definition at line 516 of file xml-tree.c.

References DestroyXMLTree(), and _XMLTreeInfo::ordered.

Referenced by DestroyXMLTree().

◆ DestroyXMLTreeRoot()

◆ EncodePredefinedEntities()

static char * EncodePredefinedEntities ( const char *  source,
ssize_t  offset,
char **  destination,
size_t *  length,
size_t *  extent,
WizardBooleanType  pedantic 
)
static

◆ FileToXML()

◆ GetNextXMLTreeTag()

◆ GetXMLTreeAttribute()

◆ GetXMLTreeAttributes()

◆ GetXMLTreeChild()

◆ GetXMLTreeContent()

WizardExport const char * GetXMLTreeContent ( XMLTreeInfo xml_info)

◆ GetXMLTreeOrdered()

◆ GetXMLTreePath()

◆ GetXMLTreeProcessingInstructions()

WizardExport const char ** GetXMLTreeProcessingInstructions ( XMLTreeInfo xml_info,
const char *  target 
)

◆ GetXMLTreeSibling()

◆ GetXMLTreeTag()

WizardExport const char * GetXMLTreeTag ( XMLTreeInfo xml_info)

◆ InsertTagIntoXMLTree()

WizardExport XMLTreeInfo * InsertTagIntoXMLTree ( XMLTreeInfo xml_info,
XMLTreeInfo child,
const size_t  offset 
)

◆ IsSkipTag()

static WizardBooleanType IsSkipTag ( const char *  tag)
inlinestatic

Definition at line 1973 of file xml-tree.c.

References ignore_tags, LocaleCompare(), WizardFalse, and WizardTrue.

Referenced by NewXMLTree().

◆ NewXMLTree()

◆ NewXMLTreeTag()

◆ ParseCharacterContent()

void ParseCharacterContent ( XMLTreeRoot root,
char *  xml,
const size_t  length,
const char  state 
)

◆ ParseCloseTag()

static XMLTreeInfo * ParseCloseTag ( XMLTreeRoot root,
char *  tag,
ExceptionInfo exception 
)
static

◆ ParseEntities()

static char * ParseEntities ( char *  xml,
char **  entities,
int  state 
)
static

◆ ParseInternalDoctype()

◆ ParseOpenTag()

static void ParseOpenTag ( XMLTreeRoot root,
char *  tag,
char **  attributes 
)
static

◆ ParseProcessingInstructions()

◆ PruneTagFromXMLTree()

◆ SetXMLTreeAttribute()

◆ SetXMLTreeContent()

◆ ValidateEntities()

static WizardBooleanType ValidateEntities ( char *  tag,
char *  xml,
const size_t  depth,
char **  entities 
)
static

◆ XMLTreeInfoToXML()

◆ XMLTreeTagToXML()

static char * XMLTreeTagToXML ( XMLTreeInfo xml_info,
char **  source,
size_t *  length,
size_t *  extent,
size_t  start,
char ***  attributes 
)
static

Variable Documentation

◆ ignore_tags

const char* ignore_tags[3]
static
Initial value:
=
{
"rdf:Bag",
"rdf:Seq",
(const char *) NULL
}

Definition at line 1966 of file xml-tree.c.

Referenced by IsSkipTag().

◆ sentinel