MagickCore 7.1.0
Convert, Edit, Or Compose Bitmap Images
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


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


typedef struct _XMLTreeRoot XMLTreeRoot


MagickExport XMLTreeInfoAddChildToXMLTree (XMLTreeInfo *xml_info, const char *tag, const size_t offset)
MagickPrivate XMLTreeInfoAddPathToXMLTree (XMLTreeInfo *xml_info, const char *path, const size_t offset)
MagickPrivate char * CanonicalXMLContent (const char *content, const MagickBooleanType pedantic)
static char ** DestroyXMLTreeAttributes (char **attributes)
static void DestroyXMLTreeChild (XMLTreeInfo *xml_info)
static void DestroyXMLTreeOrdered (XMLTreeInfo *xml_info)
static void DestroyXMLTreeRoot (XMLTreeInfo *xml_info)
MagickExport XMLTreeInfoDestroyXMLTree (XMLTreeInfo *xml_info)
MagickPrivate char * FileToXML (const char *filename, const size_t extent)
MagickExport XMLTreeInfoGetNextXMLTreeTag (XMLTreeInfo *xml_info)
MagickExport const char * GetXMLTreeAttribute (XMLTreeInfo *xml_info, const char *tag)
MagickPrivate MagickBooleanType GetXMLTreeAttributes (const XMLTreeInfo *xml_info, SplayTreeInfo *attributes)
MagickExport XMLTreeInfoGetXMLTreeChild (XMLTreeInfo *xml_info, const char *tag)
MagickExport const char * GetXMLTreeContent (XMLTreeInfo *xml_info)
MagickPrivate XMLTreeInfoGetXMLTreeOrdered (XMLTreeInfo *xml_info)
MagickPrivate XMLTreeInfoGetXMLTreePath (XMLTreeInfo *xml_info, const char *path)
MagickPrivate const char ** GetXMLTreeProcessingInstructions (XMLTreeInfo *xml_info, const char *target)
MagickExport XMLTreeInfoGetXMLTreeSibling (XMLTreeInfo *xml_info)
MagickExport const char * GetXMLTreeTag (XMLTreeInfo *xml_info)
MagickPrivate 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)
static void ParseCharacterContent (XMLTreeRoot *root, char *xml, const size_t length, const char state)
static XMLTreeInfoParseCloseTag (XMLTreeRoot *root, char *tag, ExceptionInfo *exception)
static MagickBooleanType ValidateEntities (char *tag, char *xml, const size_t depth, char **entities)
static void ParseProcessingInstructions (XMLTreeRoot *root, char *xml, size_t length)
static MagickBooleanType ParseInternalDoctype (XMLTreeRoot *root, char *xml, size_t length, ExceptionInfo *exception)
static void ParseOpenTag (XMLTreeRoot *root, char *tag, char **attributes)
static MagickBooleanType IsSkipTag (const char *tag)
MagickExport XMLTreeInfoNewXMLTree (const char *xml, ExceptionInfo *exception)
MagickExport XMLTreeInfoNewXMLTreeTag (const char *tag)
MagickPrivate XMLTreeInfoPruneTagFromXMLTree (XMLTreeInfo *xml_info)
MagickPrivate XMLTreeInfoSetXMLTreeAttribute (XMLTreeInfo *xml_info, const char *tag, const char *value)
MagickExport XMLTreeInfoSetXMLTreeContent (XMLTreeInfo *xml_info, const char *content)
static char * EncodePredefinedEntities (const char *source, ssize_t offset, char **destination, size_t *length, size_t *extent, MagickBooleanType pedantic)
static char * XMLTreeTagToXML (XMLTreeInfo *xml_info, char **source, size_t *length, size_t *extent, size_t start, char ***attributes)
MagickExport char * XMLTreeInfoToXML (XMLTreeInfo *xml_info)


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

Macro Definition Documentation

◆ NumberPredefinedEntities

#define NumberPredefinedEntities   10

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

◆ XMLWhitespace

#define XMLWhitespace   "\t\r\n "

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

Typedef Documentation

◆ XMLTreeRoot

typedef struct _XMLTreeRoot XMLTreeRoot

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

Function Documentation

◆ AddChildToXMLTree()

◆ AddPathToXMLTree()

◆ CanonicalXMLContent()

MagickPrivate char * CanonicalXMLContent ( const char *  content,
const MagickBooleanType  pedantic 

◆ ConvertUTF16ToUTF8()

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

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

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

Referenced by NewXMLTree().

◆ DestroyXMLTree()

◆ DestroyXMLTreeAttributes()

static char ** DestroyXMLTreeAttributes ( char **  attributes)

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

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

Referenced by DestroyXMLTree(), and NewXMLTree().

◆ DestroyXMLTreeChild()

static void DestroyXMLTreeChild ( XMLTreeInfo xml_info)

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

References _XMLTreeInfo::child, and DestroyXMLTree().

Referenced by DestroyXMLTree().

◆ DestroyXMLTreeOrdered()

static void DestroyXMLTreeOrdered ( XMLTreeInfo xml_info)

Definition at line 404 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,
MagickBooleanType  pedantic 

◆ FileToXML()

◆ GetNextXMLTreeTag()

◆ GetXMLTreeAttribute()

◆ GetXMLTreeAttributes()

◆ GetXMLTreeChild()

◆ GetXMLTreeContent()

◆ GetXMLTreeOrdered()

◆ GetXMLTreePath()

◆ GetXMLTreeProcessingInstructions()

MagickPrivate const char ** GetXMLTreeProcessingInstructions ( XMLTreeInfo xml_info,
const char *  target 

◆ GetXMLTreeSibling()

◆ GetXMLTreeTag()

MagickExport const char * GetXMLTreeTag ( XMLTreeInfo xml_info)

◆ InsertTagIntoXMLTree()

MagickPrivate XMLTreeInfo * InsertTagIntoXMLTree ( XMLTreeInfo xml_info,
XMLTreeInfo child,
const size_t  offset 

◆ IsSkipTag()

static MagickBooleanType IsSkipTag ( const char *  tag)

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

References ignore_tags, LocaleCompare(), MagickFalse, and MagickTrue.

Referenced by NewXMLTree().

◆ NewXMLTree()

◆ NewXMLTreeTag()

◆ ParseCharacterContent()

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

◆ ParseCloseTag()

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

◆ ParseEntities()

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

◆ ParseInternalDoctype()

◆ ParseOpenTag()

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

◆ ParseProcessingInstructions()

◆ PruneTagFromXMLTree()

◆ SetXMLTreeAttribute()

◆ SetXMLTreeContent()

◆ ValidateEntities()

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

◆ XMLTreeInfoToXML()

◆ XMLTreeTagToXML()

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

Variable Documentation

◆ ignore_tags

const char* ignore_tags[3]
Initial value:
(const char *) NULL

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

Referenced by IsSkipTag().

◆ sentinel