18#ifndef MAGICKCORE_XML_TREE_PRIVATE_H
19#define MAGICKCORE_XML_TREE_PRIVATE_H
21#include "MagickCore/locale_.h"
22#include "MagickCore/memory_.h"
23#include "MagickCore/string_.h"
24#include "MagickCore/splay-tree.h"
25#include "MagickCore/xml-tree.h"
27#if defined(__cplusplus) || defined(c_plusplus)
31static inline char *SubstituteXMLEntities(
const char *content,
32 const MagickBooleanType pedantic)
50 canonical_content=AcquireString((
char *) NULL);
51 extent=MagickPathExtent;
52 for (p=content; *p !=
'\0'; p++)
54 if ((i+MagickPathExtent) > (ssize_t) extent)
56 extent+=MagickPathExtent;
57 canonical_content=(
char *) ResizeQuantumMemory(canonical_content,extent,
58 sizeof(*canonical_content));
59 if (canonical_content == (
char *) NULL)
60 return(canonical_content);
66 i+=FormatLocaleString(canonical_content+i,extent,
"&");
71 i+=FormatLocaleString(canonical_content+i,extent,
"<");
76 i+=FormatLocaleString(canonical_content+i,extent,
">");
81 i+=FormatLocaleString(canonical_content+i,extent,
""");
86 if (pedantic == MagickFalse)
88 canonical_content[i++]=(char) (*p);
91 i+=FormatLocaleString(canonical_content+i,extent,
"
");
96 if (pedantic == MagickFalse)
98 canonical_content[i++]=(char) (*p);
101 i+=FormatLocaleString(canonical_content+i,extent,
"	");
106 i+=FormatLocaleString(canonical_content+i,extent,
"
");
111 canonical_content[i++]=(char) (*p);
116 canonical_content[i]=
'\0';
117 return(canonical_content);
120extern MagickPrivate
char
121 *CanonicalXMLContent(
const char *,
const MagickBooleanType),
122 *FileToXML(
const char *,
const size_t);
124extern MagickPrivate
const char
125 **GetXMLTreeProcessingInstructions(XMLTreeInfo *,
const char *);
127extern MagickPrivate MagickBooleanType
128 GetXMLTreeAttributes(
const XMLTreeInfo *,SplayTreeInfo *);
130extern MagickPrivate XMLTreeInfo
131 *AddPathToXMLTree(XMLTreeInfo *,
const char *,
const size_t),
132 *GetXMLTreeOrdered(XMLTreeInfo *),
133 *GetXMLTreePath(XMLTreeInfo *,
const char *),
134 *InsertTagIntoXMLTree(XMLTreeInfo *,XMLTreeInfo *,
const size_t),
135 *ParseTagFromXMLTree(XMLTreeInfo *),
136 *PruneTagFromXMLTree(XMLTreeInfo *),
137 *SetXMLTreeAttribute(XMLTreeInfo *,
const char *,
const char *);
139#if defined(__cplusplus) || defined(c_plusplus)