|
MagickCore 7.0.10
|
#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/xml-tree-private.h"#include "wizard/utility.h"#include "wizard/utility-private.h"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 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) |
| 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 XMLTreeInfo * | DestroyXMLTree (XMLTreeInfo *xml_info) |
| WizardPrivate char * | FileToXML (const char *filename, const size_t extent) |
| 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) |
| 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 XMLTreeInfo * | ParseCloseTag (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 XMLTreeInfo * | NewXMLTree (const char *xml, ExceptionInfo *exception) |
| WizardExport XMLTreeInfo * | NewXMLTreeTag (const char *tag) |
| 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 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] |
| #define NumberPredefinedEntities 10 |
Definition at line 68 of file xml-tree.c.
| #define XMLWhitespace "\t\r\n " |
Definition at line 69 of file xml-tree.c.
| typedef struct _XMLTreeRoot XMLTreeRoot |
Definition at line 102 of file xml-tree.c.
| WizardExport XMLTreeInfo * AddChildToXMLTree | ( | XMLTreeInfo * | xml_info, |
| const char * | tag, | ||
| const size_t | offset | ||
| ) |
Definition at line 164 of file xml-tree.c.
References AcquireWizardMemory(), _XMLTreeInfo::attributes, _XMLTreeInfo::child, ConstantString(), _XMLTreeInfo::content, _XMLTreeInfo::debug, InsertTagIntoXMLTree(), IsEventLogging(), _XMLTreeInfo::offset, sentinel, _XMLTreeInfo::signature, _XMLTreeInfo::tag, and WizardSignature.
Referenced by AddPathToXMLTree(), and ParseOpenTag().
| WizardExport XMLTreeInfo * AddPathToXMLTree | ( | XMLTreeInfo * | xml_info, |
| const char * | path, | ||
| const size_t | offset | ||
| ) |
Definition at line 212 of file xml-tree.c.
References AddChildToXMLTree(), CanonicalPath, _XMLTreeInfo::child, DestroyString(), GetPathComponent(), GetPathComponents(), GetWizardModule, GetXMLTreeChild(), GetXMLTreeOrdered(), LogWizardEvent(), _XMLTreeInfo::offset, RelinquishWizardMemory(), ResourceDomain, _XMLTreeInfo::signature, StringToLong(), SubnodePath, _XMLTreeInfo::tag, TraceEvent, WizardAssert, WizardPathExtent, and WizardSignature.
| WizardExport char * CanonicalXMLContent | ( | const char * | content, |
| const WizardBooleanType | pedantic | ||
| ) |
Definition at line 337 of file xml-tree.c.
References AcquireString(), Base64Encode(), ConcatenateString(), _XMLTreeInfo::content, ConvertLatin1ToUTF8(), DestroyString(), FormatLocaleString(), RelinquishWizardMemory(), ResizeQuantumMemory(), WizardFalse, and WizardPathExtent.
Referenced by EncodePredefinedEntities(), and PrintKeyringProperties().
|
static |
Definition at line 296 of file xml-tree.c.
References AcquireQuantumMemory(), and _XMLTreeInfo::content.
Referenced by CanonicalXMLContent().
|
static |
Definition at line 1313 of file xml-tree.c.
References AcquireQuantumMemory(), ResizeQuantumMemory(), and WizardPathExtent.
Referenced by NewXMLTree().
| WizardExport XMLTreeInfo * DestroyXMLTree | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 593 of file xml-tree.c.
References _XMLTreeInfo::attributes, _XMLTreeInfo::content, DestroyString(), DestroyXMLTreeAttributes(), DestroyXMLTreeChild(), DestroyXMLTreeOrdered(), DestroyXMLTreeRoot(), GetWizardModule, LogWizardEvent(), RelinquishWizardMemory(), ResourceDomain, _XMLTreeInfo::signature, _XMLTreeInfo::tag, TraceEvent, WizardAssert, and WizardSignature.
Referenced by DestroyXMLTreeChild(), DestroyXMLTreeOrdered(), LoadConfigureCache(), and LoadMimeCache().
|
static |
Definition at line 476 of file xml-tree.c.
References _XMLTreeInfo::attributes, DestroyString(), RelinquishWizardMemory(), and sentinel.
Referenced by DestroyXMLTree(), and NewXMLTree().
|
static |
Definition at line 500 of file xml-tree.c.
References _XMLTreeInfo::child, and DestroyXMLTree().
Referenced by DestroyXMLTree().
|
static |
Definition at line 516 of file xml-tree.c.
References DestroyXMLTree(), and _XMLTreeInfo::ordered.
Referenced by DestroyXMLTree().
|
static |
Definition at line 532 of file xml-tree.c.
References _XMLTreeInfo::attributes, _XMLTreeRoot::attributes, DestroyString(), _XMLTreeRoot::entities, NumberPredefinedEntities, _XMLTreeInfo::parent, _XMLTreeRoot::processing_instructions, RelinquishWizardMemory(), _XMLTreeInfo::signature, and WizardSignature.
Referenced by DestroyXMLTree().
|
static |
Definition at line 2650 of file xml-tree.c.
References AcquireString(), CanonicalXMLContent(), DestroyString(), FormatLocaleString(), ResizeQuantumMemory(), and WizardPathExtent.
Referenced by XMLTreeTagToXML().
| WizardPrivate char * FileToXML | ( | const char * | filename, |
| const size_t | extent | ||
| ) |
Definition at line 633 of file xml-tree.c.
References AcquireQuantumMemory(), LocaleCompare(), MapBlob(), O_BINARY, _XMLTreeInfo::offset, open_utf8(), ReadMode, RelinquishWizardMemory(), ResizeQuantumMemory(), UnmapBlob(), WizardMaxBufferExtent, WizardMin, and WizardPathExtent.
Referenced by LoadConfigureCache(), LoadLocaleCache(), LoadLogCache(), and LoadMimeCache().
| WizardExport XMLTreeInfo * GetNextXMLTreeTag | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 778 of file xml-tree.c.
References GetWizardModule, LogWizardEvent(), _XMLTreeInfo::next, ResourceDomain, _XMLTreeInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by LoadConfigureCache(), and LoadMimeCache().
| WizardExport const char * GetXMLTreeAttribute | ( | XMLTreeInfo * | xml_info, |
| const char * | tag | ||
| ) |
Definition at line 812 of file xml-tree.c.
References _XMLTreeInfo::attributes, _XMLTreeRoot::attributes, GetWizardModule, LogWizardEvent(), _XMLTreeInfo::parent, ResourceDomain, _XMLTreeRoot::root, _XMLTreeInfo::signature, _XMLTreeInfo::tag, TraceEvent, WizardAssert, and WizardSignature.
Referenced by LoadConfigureCache(), LoadMimeCache(), and XMLTreeTagToXML().
| WizardExport WizardBooleanType GetXMLTreeAttributes | ( | const XMLTreeInfo * | xml_info, |
| SplayTreeInfo * | attributes | ||
| ) |
Definition at line 880 of file xml-tree.c.
References AddValueToSplayTree(), _XMLTreeInfo::attributes, ConstantString(), GetWizardModule, LogWizardEvent(), ResourceDomain, _XMLTreeInfo::signature, TraceEvent, WizardAssert, WizardSignature, and WizardTrue.
| WizardExport XMLTreeInfo * GetXMLTreeChild | ( | XMLTreeInfo * | xml_info, |
| const char * | tag | ||
| ) |
Definition at line 927 of file xml-tree.c.
References _XMLTreeInfo::child, GetWizardModule, LogWizardEvent(), ResourceDomain, _XMLTreeInfo::sibling, _XMLTreeInfo::signature, _XMLTreeInfo::tag, TraceEvent, WizardAssert, and WizardSignature.
Referenced by AddPathToXMLTree(), GetXMLTreePath(), LoadConfigureCache(), and LoadMimeCache().
| WizardExport const char * GetXMLTreeContent | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 966 of file xml-tree.c.
References _XMLTreeInfo::content, GetWizardModule, LogWizardEvent(), ResourceDomain, _XMLTreeInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
| WizardExport XMLTreeInfo * GetXMLTreeOrdered | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 997 of file xml-tree.c.
References GetWizardModule, LogWizardEvent(), _XMLTreeInfo::ordered, ResourceDomain, _XMLTreeInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
Referenced by AddPathToXMLTree(), and GetXMLTreePath().
| WizardExport XMLTreeInfo * GetXMLTreePath | ( | XMLTreeInfo * | xml_info, |
| const char * | path | ||
| ) |
Definition at line 1031 of file xml-tree.c.
References CanonicalPath, DestroyString(), GetPathComponent(), GetPathComponents(), GetWizardModule, GetXMLTreeChild(), GetXMLTreeOrdered(), LogWizardEvent(), RelinquishWizardMemory(), ResourceDomain, _XMLTreeInfo::signature, StringToLong(), SubnodePath, TraceEvent, WizardAssert, WizardPathExtent, and WizardSignature.
| WizardExport const char ** GetXMLTreeProcessingInstructions | ( | XMLTreeInfo * | xml_info, |
| const char * | target | ||
| ) |
Definition at line 1105 of file xml-tree.c.
References GetWizardModule, LogWizardEvent(), _XMLTreeInfo::parent, _XMLTreeRoot::processing_instructions, ResourceDomain, _XMLTreeRoot::root, sentinel, _XMLTreeInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
| WizardExport XMLTreeInfo * GetXMLTreeSibling | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 1152 of file xml-tree.c.
References GetWizardModule, LogWizardEvent(), ResourceDomain, _XMLTreeInfo::sibling, _XMLTreeInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
| WizardExport const char * GetXMLTreeTag | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 1183 of file xml-tree.c.
References GetWizardModule, LogWizardEvent(), ResourceDomain, _XMLTreeInfo::signature, _XMLTreeInfo::tag, TraceEvent, WizardAssert, and WizardSignature.
| WizardExport XMLTreeInfo * InsertTagIntoXMLTree | ( | XMLTreeInfo * | xml_info, |
| XMLTreeInfo * | child, | ||
| const size_t | offset | ||
| ) |
Definition at line 1220 of file xml-tree.c.
References _XMLTreeInfo::child, _XMLTreeInfo::next, _XMLTreeInfo::offset, _XMLTreeInfo::ordered, _XMLTreeInfo::parent, _XMLTreeInfo::sibling, and _XMLTreeInfo::tag.
Referenced by AddChildToXMLTree().
|
inlinestatic |
Definition at line 1973 of file xml-tree.c.
References ignore_tags, LocaleCompare(), WizardFalse, and WizardTrue.
Referenced by NewXMLTree().
| WizardExport XMLTreeInfo * NewXMLTree | ( | const char * | xml, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 1988 of file xml-tree.c.
References AcquireQuantumMemory(), _XMLTreeRoot::attributes, ConstantString(), ConvertUTF16ToUTF8(), DestroyString(), DestroyXMLTreeAttributes(), _XMLTreeRoot::entities, GetWizardModule, IsSkipTag(), NewXMLTreeTag(), _XMLTreeRoot::node, OptionWarning, ParseCharacterContent(), ParseCloseTag(), ParseEntities(), ParseInternalDoctype(), ParseOpenTag(), ParseProcessingInstructions(), ResizeQuantumMemory(), ResourceError, _XMLTreeRoot::root, sentinel, _XMLTreeInfo::tag, ThrowWizardException(), WizardFalse, and XMLWhitespace.
Referenced by LoadConfigureCache(), and LoadMimeCache().
| WizardExport XMLTreeInfo * NewXMLTreeTag | ( | const char * | tag | ) |
Definition at line 2394 of file xml-tree.c.
References AcquireWizardMemory(), _XMLTreeInfo::attributes, _XMLTreeRoot::attributes, ConstantString(), _XMLTreeInfo::content, _XMLTreeRoot::debug, _XMLTreeRoot::entities, IsEventLogging(), _XMLTreeRoot::node, NumberPredefinedEntities, _XMLTreeRoot::processing_instructions, _XMLTreeRoot::root, sentinel, _XMLTreeRoot::signature, _XMLTreeInfo::tag, and WizardSignature.
Referenced by NewXMLTree().
| void ParseCharacterContent | ( | XMLTreeRoot * | root, |
| char * | xml, | ||
| const size_t | length, | ||
| const char | state | ||
| ) |
Definition at line 1573 of file xml-tree.c.
References ConcatenateString(), _XMLTreeInfo::content, DestroyString(), _XMLTreeRoot::entities, _XMLTreeRoot::node, ParseEntities(), and _XMLTreeInfo::tag.
Referenced by NewXMLTree().
|
static |
Definition at line 1598 of file xml-tree.c.
References GetWizardModule, _XMLTreeRoot::node, OptionWarning, _XMLTreeInfo::parent, _XMLTreeRoot::root, _XMLTreeInfo::tag, and ThrowWizardException().
Referenced by NewXMLTree().
|
static |
Definition at line 1394 of file xml-tree.c.
References AcquireQuantumMemory(), ConstantString(), CopyWizardString(), ResizeQuantumMemory(), ResourceFatalError, and ThrowFatalException.
Referenced by NewXMLTree(), ParseCharacterContent(), and ParseInternalDoctype().
|
static |
Definition at line 1719 of file xml-tree.c.
References AcquireQuantumMemory(), AcquireWizardMemory(), _XMLTreeRoot::attributes, ConstantString(), DestroyString(), _XMLTreeRoot::entities, GetWizardModule, OptionWarning, ParseEntities(), ParseProcessingInstructions(), RelinquishWizardMemory(), ResizeQuantumMemory(), ResourceError, ResourceFatalError, sentinel, _XMLTreeRoot::standalone, ThrowFatalException, ThrowWizardException(), ValidateEntities(), WizardFalse, WizardTrue, and XMLWhitespace.
Referenced by NewXMLTree().
|
static |
Definition at line 1950 of file xml-tree.c.
References AddChildToXMLTree(), _XMLTreeInfo::attributes, ConstantString(), _XMLTreeInfo::content, _XMLTreeRoot::node, and _XMLTreeInfo::tag.
Referenced by NewXMLTree().
|
static |
Definition at line 1642 of file xml-tree.c.
References AcquireQuantumMemory(), AcquireWizardMemory(), ConstantString(), CopyWizardString(), _XMLTreeRoot::processing_instructions, ResizeQuantumMemory(), ResourceFatalError, _XMLTreeRoot::root, _XMLTreeRoot::standalone, _XMLTreeInfo::tag, ThrowFatalException, WizardTrue, and XMLWhitespace.
Referenced by NewXMLTree(), and ParseInternalDoctype().
| WizardExport XMLTreeInfo * PruneTagFromXMLTree | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 2450 of file xml-tree.c.
References _XMLTreeInfo::child, GetWizardModule, LogWizardEvent(), _XMLTreeInfo::next, _XMLTreeInfo::ordered, _XMLTreeInfo::parent, ResourceDomain, _XMLTreeInfo::sibling, _XMLTreeInfo::signature, _XMLTreeInfo::tag, TraceEvent, WizardAssert, and WizardSignature.
| WizardExport XMLTreeInfo * SetXMLTreeAttribute | ( | XMLTreeInfo * | xml_info, |
| const char * | tag, | ||
| const char * | value | ||
| ) |
Definition at line 2523 of file xml-tree.c.
References AcquireQuantumMemory(), _XMLTreeInfo::attributes, ConstantString(), DestroyString(), GetWizardModule, LogWizardEvent(), ResizeQuantumMemory(), ResourceDomain, ResourceFatalError, sentinel, _XMLTreeInfo::signature, ThrowFatalException, TraceEvent, WizardAssert, and WizardSignature.
| WizardExport XMLTreeInfo * SetXMLTreeContent | ( | XMLTreeInfo * | xml_info, |
| const char * | content | ||
| ) |
Definition at line 2614 of file xml-tree.c.
References ConstantString(), _XMLTreeInfo::content, DestroyString(), GetWizardModule, LogWizardEvent(), ResourceDomain, _XMLTreeInfo::signature, TraceEvent, WizardAssert, and WizardSignature.
|
static |
Definition at line 1612 of file xml-tree.c.
References ValidateEntities(), WizardFalse, WizardMaxRecursionDepth, and WizardTrue.
Referenced by ParseInternalDoctype(), and ValidateEntities().
| WizardExport char * XMLTreeInfoToXML | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 2790 of file xml-tree.c.
References AcquireString(), _XMLTreeRoot::attributes, FormatLocaleString(), GetWizardModule, LogWizardEvent(), _XMLTreeInfo::ordered, _XMLTreeInfo::parent, _XMLTreeRoot::processing_instructions, ResizeQuantumMemory(), ResourceDomain, _XMLTreeRoot::root, _XMLTreeInfo::signature, _XMLTreeInfo::tag, TraceEvent, WizardAssert, WizardPathExtent, WizardSignature, and XMLTreeTagToXML().
|
static |
Definition at line 2684 of file xml-tree.c.
References _XMLTreeInfo::attributes, _XMLTreeInfo::child, _XMLTreeInfo::content, EncodePredefinedEntities(), FormatLocaleString(), GetXMLTreeAttribute(), _XMLTreeInfo::offset, _XMLTreeInfo::ordered, _XMLTreeInfo::parent, ResizeQuantumMemory(), _XMLTreeInfo::tag, WizardFalse, WizardPathExtent, WizardTrue, and XMLTreeTagToXML().
Referenced by XMLTreeInfoToXML(), and XMLTreeTagToXML().
|
static |
Definition at line 1966 of file xml-tree.c.
Referenced by IsSkipTag().
|
static |
Definition at line 134 of file xml-tree.c.
Referenced by AddChildToXMLTree(), DestroyXMLTreeAttributes(), GetXMLTreeProcessingInstructions(), NewXMLTree(), NewXMLTreeTag(), ParseInternalDoctype(), and SetXMLTreeAttribute().