|
WizardsToolkit
1.0.7
|
#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"
Go to the source code of this file.
Data Structures | |
| struct | _XMLTreeInfo |
| struct | _XMLTreeRoot |
Defines | |
| #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) |
| WizardExport XMLTreeInfo * | DestroyXMLTree (XMLTreeInfo *xml_info) |
| 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, 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 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 } |
| #define NumberPredefinedEntities 10 |
Definition at line 66 of file xml-tree.c.
Referenced by DestroyXMLTree(), and NewXMLTreeTag().
| #define XMLWhitespace "\t\r\n " |
Definition at line 67 of file xml-tree.c.
Referenced by ParseProcessingInstructions(), ParseInternalDoctype(), and NewXMLTree().
| typedef struct _XMLTreeRoot XMLTreeRoot |
Definition at line 99 of file xml-tree.c.
| WizardExport XMLTreeInfo* AddChildToXMLTree | ( | XMLTreeInfo * | xml_info, |
| const char * | tag, | ||
| const size_t | offset | ||
| ) |
Definition at line 162 of file xml-tree.c.
References _XMLTreeInfo::child, AcquireWizardMemory(), ResetWizardMemory(), _XMLTreeInfo::tag, ConstantString(), _XMLTreeInfo::attributes, sentinel, _XMLTreeInfo::content, _XMLTreeInfo::debug, IsEventLogging(), _XMLTreeInfo::signature, WizardSignature, and InsertTagIntoXMLTree().
Referenced by AddPathToXMLTree(), and ParseOpenTag().
| WizardExport XMLTreeInfo* AddPathToXMLTree | ( | XMLTreeInfo * | xml_info, |
| const char * | path, | ||
| const size_t | offset | ||
| ) |
Definition at line 210 of file xml-tree.c.
References MaxTextExtent, _XMLTreeInfo::tag, _XMLTreeInfo::child, WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, GetPathComponents(), GetPathComponent(), SubnodePath, CanonicalPath, GetXMLTreeChild(), AddChildToXMLTree(), StringToLong(), GetXMLTreeOrdered(), DestroyString(), and RelinquishWizardMemory().
| WizardExport char* CanonicalXMLContent | ( | const char * | content, |
| const WizardBooleanType | pedantic | ||
| ) |
Definition at line 335 of file xml-tree.c.
References ConvertLatin1ToUTF8(), Base64Encode(), RelinquishWizardMemory(), AcquireString(), ConcatenateString(), DestroyString(), MaxTextExtent, ResizeQuantumMemory(), FormatLocaleString(), and WizardFalse.
Referenced by PrintKeyringProperties(), and EncodePredefinedEntities().
| static unsigned char* ConvertLatin1ToUTF8 | ( | const unsigned char * | content | ) | [static] |
Definition at line 294 of file xml-tree.c.
References AcquireQuantumMemory().
Referenced by CanonicalXMLContent().
| static char* ConvertUTF16ToUTF8 | ( | const char * | content, |
| size_t * | length | ||
| ) | [static] |
Definition at line 1127 of file xml-tree.c.
References AcquireQuantumMemory(), CopyWizardMemory(), MaxTextExtent, and ResizeQuantumMemory().
Referenced by NewXMLTree().
| WizardExport XMLTreeInfo* DestroyXMLTree | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 498 of file xml-tree.c.
References _XMLTreeInfo::attributes, WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, NumberPredefinedEntities, _XMLTreeRoot::entities, DestroyString(), RelinquishWizardMemory(), _XMLTreeRoot::attributes, _XMLTreeRoot::processing_instructions, and DestroyXMLTreeAttributes().
Referenced by LoadConfigureList(), and LoadMimeList().
| static char** DestroyXMLTreeAttributes | ( | char ** | attributes | ) | [static] |
Definition at line 474 of file xml-tree.c.
References sentinel, DestroyString(), and RelinquishWizardMemory().
Referenced by DestroyXMLTree(), and NewXMLTree().
| static char* EncodePredefinedEntities | ( | const char * | source, |
| ssize_t | offset, | ||
| char ** | destination, | ||
| size_t * | length, | ||
| size_t * | extent, | ||
| WizardBooleanType | pedantic | ||
| ) | [static] |
Definition at line 2382 of file xml-tree.c.
References CanonicalXMLContent(), _XMLTreeInfo::content, AcquireString(), _XMLTreeInfo::offset, DestroyString(), MaxTextExtent, ResizeQuantumMemory(), and FormatLocaleString().
Referenced by XMLTreeTagToXML().
| WizardExport XMLTreeInfo* GetNextXMLTreeTag | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 592 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, and GetWizardModule.
Referenced by LoadConfigureList(), and LoadMimeList().
| WizardExport const char* GetXMLTreeAttribute | ( | XMLTreeInfo * | xml_info, |
| const char * | tag | ||
| ) |
Definition at line 626 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, _XMLTreeRoot::attributes, _XMLTreeRoot::root, and _XMLTreeInfo::parent.
Referenced by LoadConfigureList(), LoadMimeList(), and XMLTreeTagToXML().
| WizardExport WizardBooleanType GetXMLTreeAttributes | ( | const XMLTreeInfo * | xml_info, |
| SplayTreeInfo * | attributes | ||
| ) |
Definition at line 694 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, _XMLTreeRoot::attributes, WizardTrue, AddValueToSplayTree(), and ConstantString().
| WizardExport XMLTreeInfo* GetXMLTreeChild | ( | XMLTreeInfo * | xml_info, |
| const char * | tag | ||
| ) |
Definition at line 741 of file xml-tree.c.
References _XMLTreeInfo::child, WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, _XMLTreeInfo::tag, and _XMLTreeInfo::sibling.
Referenced by LoadConfigureList(), LoadMimeList(), AddPathToXMLTree(), and GetXMLTreePath().
| WizardExport const char* GetXMLTreeContent | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 780 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, and GetWizardModule.
| WizardExport XMLTreeInfo* GetXMLTreeOrdered | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 811 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, and GetWizardModule.
Referenced by AddPathToXMLTree(), and GetXMLTreePath().
| WizardExport XMLTreeInfo* GetXMLTreePath | ( | XMLTreeInfo * | xml_info, |
| const char * | path | ||
| ) |
Definition at line 845 of file xml-tree.c.
References MaxTextExtent, _XMLTreeInfo::tag, WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, GetPathComponents(), GetPathComponent(), SubnodePath, CanonicalPath, GetXMLTreeChild(), StringToLong(), GetXMLTreeOrdered(), DestroyString(), and RelinquishWizardMemory().
| WizardExport const char** GetXMLTreeProcessingInstructions | ( | XMLTreeInfo * | xml_info, |
| const char * | target | ||
| ) |
Definition at line 919 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, _XMLTreeRoot::root, _XMLTreeInfo::parent, _XMLTreeRoot::processing_instructions, and sentinel.
| WizardExport XMLTreeInfo* GetXMLTreeSibling | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 966 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, and GetWizardModule.
| WizardExport const char* GetXMLTreeTag | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 997 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, and GetWizardModule.
| WizardExport XMLTreeInfo* InsertTagIntoXMLTree | ( | XMLTreeInfo * | xml_info, |
| XMLTreeInfo * | child, | ||
| const size_t | offset | ||
| ) |
Definition at line 1034 of file xml-tree.c.
References _XMLTreeInfo::ordered, _XMLTreeInfo::sibling, _XMLTreeInfo::next, _XMLTreeInfo::offset, _XMLTreeInfo::parent, _XMLTreeInfo::child, and _XMLTreeInfo::tag.
Referenced by AddChildToXMLTree().
| WizardExport XMLTreeInfo* NewXMLTree | ( | const char * | xml, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 1749 of file xml-tree.c.
References _XMLTreeInfo::attributes, _XMLTreeInfo::tag, ThrowWizardException(), GetWizardModule, OptionWarning, NewXMLTreeTag(), ConvertUTF16ToUTF8(), ResourceError, DestroyString(), sentinel, _XMLTreeRoot::node, _XMLTreeRoot::root, XMLWhitespace, _XMLTreeRoot::attributes, AcquireQuantumMemory(), ResizeQuantumMemory(), ConstantString(), DestroyXMLTreeAttributes(), ParseEntities(), _XMLTreeRoot::entities, ParseOpenTag(), ParseCloseTag(), ParseCharacterContent(), ParseInternalDoctype(), WizardFalse, and ParseProcessingInstructions().
Referenced by LoadConfigureList(), and LoadMimeList().
| WizardExport XMLTreeInfo* NewXMLTreeTag | ( | const char * | tag | ) |
Definition at line 2123 of file xml-tree.c.
References NumberPredefinedEntities, AcquireWizardMemory(), ResetWizardMemory(), _XMLTreeRoot::root, _XMLTreeInfo::tag, ConstantString(), _XMLTreeRoot::node, _XMLTreeInfo::content, _XMLTreeRoot::entities, CopyWizardMemory(), _XMLTreeInfo::attributes, sentinel, _XMLTreeRoot::attributes, _XMLTreeRoot::processing_instructions, _XMLTreeRoot::debug, IsEventLogging(), _XMLTreeRoot::signature, and WizardSignature.
Referenced by NewXMLTree().
| void ParseCharacterContent | ( | XMLTreeRoot * | root, |
| char * | xml, | ||
| const size_t | length, | ||
| const char | state | ||
| ) |
Definition at line 1368 of file xml-tree.c.
References _XMLTreeRoot::node, _XMLTreeInfo::tag, ParseEntities(), _XMLTreeRoot::entities, _XMLTreeInfo::content, ConcatenateString(), and DestroyString().
Referenced by NewXMLTree().
| static XMLTreeInfo* ParseCloseTag | ( | XMLTreeRoot * | root, |
| char * | tag, | ||
| char * | wizard_unusedxml, | ||
| ExceptionInfo * | exception | ||
| ) | [static] |
Definition at line 1393 of file xml-tree.c.
References _XMLTreeRoot::node, _XMLTreeInfo::tag, ThrowWizardException(), GetWizardModule, OptionWarning, _XMLTreeRoot::root, and _XMLTreeInfo::parent.
Referenced by NewXMLTree().
| static char* ParseEntities | ( | char * | xml, |
| char ** | entities, | ||
| int | state | ||
| ) | [static] |
Definition at line 1204 of file xml-tree.c.
References _XMLTreeInfo::offset, CopyWizardMemory(), ResizeQuantumMemory(), AcquireQuantumMemory(), CopyWizardString(), ThrowFatalException, ResourceFatalError, and ConstantString().
Referenced by ParseCharacterContent(), ParseInternalDoctype(), and NewXMLTree().
| static WizardBooleanType ParseInternalDoctype | ( | XMLTreeRoot * | root, |
| char * | xml, | ||
| size_t | length, | ||
| ExceptionInfo * | exception | ||
| ) | [static] |
Definition at line 1511 of file xml-tree.c.
References AcquireWizardMemory(), sentinel, ThrowWizardException(), GetWizardModule, ResourceError, WizardFalse, CopyWizardMemory(), XMLWhitespace, _XMLTreeRoot::entities, ResizeQuantumMemory(), ThrowFatalException, ResourceFatalError, ParseEntities(), ValidateEntities(), DestroyString(), OptionWarning, RelinquishWizardMemory(), _XMLTreeRoot::attributes, AcquireQuantumMemory(), ConstantString(), ParseProcessingInstructions(), _XMLTreeRoot::standalone, and WizardTrue.
Referenced by NewXMLTree().
| static void ParseOpenTag | ( | XMLTreeRoot * | root, |
| char * | tag, | ||
| char ** | attributes | ||
| ) | [static] |
Definition at line 1735 of file xml-tree.c.
References _XMLTreeRoot::node, _XMLTreeInfo::tag, ConstantString(), AddChildToXMLTree(), _XMLTreeInfo::content, and _XMLTreeInfo::attributes.
Referenced by NewXMLTree().
| static void ParseProcessingInstructions | ( | XMLTreeRoot * | root, |
| char * | xml, | ||
| size_t | length | ||
| ) | [static] |
Definition at line 1434 of file xml-tree.c.
References XMLWhitespace, _XMLTreeRoot::standalone, WizardTrue, _XMLTreeRoot::processing_instructions, AcquireWizardMemory(), ThrowFatalException, ResourceFatalError, ResizeQuantumMemory(), AcquireQuantumMemory(), ConstantString(), CopyWizardString(), _XMLTreeRoot::root, and _XMLTreeInfo::tag.
Referenced by ParseInternalDoctype(), and NewXMLTree().
| WizardExport XMLTreeInfo* PruneTagFromXMLTree | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 2180 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, _XMLTreeInfo::ordered, _XMLTreeInfo::tag, _XMLTreeInfo::sibling, and _XMLTreeInfo::next.
| WizardExport XMLTreeInfo* SetXMLTreeAttribute | ( | XMLTreeInfo * | xml_info, |
| const char * | tag, | ||
| const char * | value | ||
| ) |
Definition at line 2253 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, _XMLTreeRoot::attributes, sentinel, ResizeQuantumMemory(), AcquireQuantumMemory(), ConstantString(), ThrowFatalException, ResourceFatalError, DestroyString(), and CopyWizardMemory().
| WizardExport XMLTreeInfo* SetXMLTreeContent | ( | XMLTreeInfo * | xml_info, |
| const char * | content | ||
| ) |
Definition at line 2346 of file xml-tree.c.
References WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, DestroyString(), and ConstantString().
| static WizardBooleanType ValidateEntities | ( | char * | tag, |
| char * | xml, | ||
| char ** | entities | ||
| ) | [static] |
Definition at line 1407 of file xml-tree.c.
References WizardTrue, and WizardFalse.
Referenced by ParseInternalDoctype().
| WizardExport char* XMLTreeInfoToXML | ( | XMLTreeInfo * | xml_info | ) |
Definition at line 2522 of file xml-tree.c.
References _XMLTreeInfo::ordered, _XMLTreeInfo::parent, WizardAssert, ResourceDomain, _XMLTreeInfo::signature, WizardSignature, LogWizardEvent(), TraceEvent, GetWizardModule, AcquireString(), MaxTextExtent, _XMLTreeRoot::root, _XMLTreeRoot::processing_instructions, ResizeQuantumMemory(), FormatLocaleString(), XMLTreeTagToXML(), and _XMLTreeRoot::attributes.
| static char* XMLTreeTagToXML | ( | XMLTreeInfo * | xml_info, |
| char ** | source, | ||
| size_t * | length, | ||
| size_t * | extent, | ||
| size_t | start, | ||
| char *** | attributes | ||
| ) | [static] |
Definition at line 2416 of file xml-tree.c.
References _XMLTreeInfo::content, _XMLTreeInfo::offset, _XMLTreeInfo::parent, EncodePredefinedEntities(), WizardFalse, _XMLTreeInfo::tag, MaxTextExtent, ResizeQuantumMemory(), FormatLocaleString(), _XMLTreeInfo::attributes, GetXMLTreeAttribute(), WizardTrue, _XMLTreeInfo::child, and _XMLTreeInfo::ordered.
Referenced by XMLTreeInfoToXML().
char* sentinel[] = { (char *) NULL } [static] |
Definition at line 132 of file xml-tree.c.
Referenced by AddChildToXMLTree(), DestroyXMLTreeAttributes(), GetXMLTreeProcessingInstructions(), ParseInternalDoctype(), NewXMLTree(), NewXMLTreeTag(), and SetXMLTreeAttribute().