OpenCore
1.0.4
OpenCore Bootloader
|
#include <Library/OcXmlLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcStringLib.h>
Go to the source code of this file.
Data Structures | |
struct | XML_NODE_ |
struct | XML_NODE_LIST_ |
struct | XML_REFLIST |
struct | XML_DOCUMENT_ |
struct | XML_PARSER_ |
Macros | |
#define | XML_EXPORT_MIN_ALLOCATION_SIZE 4096 |
#define | XML_PLIST_HEADER "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" |
#define | XML_PARSER_INFO(Parser, Message) |
#define | XML_PARSER_TAG(Parser, Tag) |
#define | XML_PARSER_ERROR(Parser, Offset, Message) |
#define | XML_USAGE_ERROR(X) |
Typedefs | |
typedef struct XML_NODE_LIST_ | XML_NODE_LIST |
typedef struct XML_PARSER_ | XML_PARSER |
typedef enum XML_PARSER_OFFSET_ | XML_PARSER_OFFSET |
Enumerations | |
enum | XML_PARSER_OFFSET_ { NO_CHARACTER = -1 , CURRENT_CHARACTER = 0 , NEXT_CHARACTER = 1 } |
Functions | |
STATIC BOOLEAN | XmlParseAttributeNumber (IN CONST CHAR8 *Attributes, IN CONST CHAR8 *Argument, IN UINT32 ArgumentLength, OUT UINT32 *ArgumentValue) |
STATIC XML_NODE * | XmlNodeCreate (IN CONST CHAR8 *Name, IN CONST CHAR8 *Attributes OPTIONAL, IN CONST CHAR8 *Content OPTIONAL, IN XML_NODE *Real OPTIONAL, IN XML_NODE_LIST *Children OPTIONAL) |
STATIC BOOLEAN | XmlNodeChildPush (IN OUT XML_NODE *Node, IN XML_NODE *Child) |
STATIC BOOLEAN | XmlPushReference (IN OUT XML_REFLIST *References, IN XML_NODE *Node, IN UINT32 ReferenceNumber) |
STATIC XML_NODE * | XmlNodeReal (IN CONST XML_REFLIST *References OPTIONAL, IN CONST CHAR8 *Attributes OPTIONAL) |
STATIC VOID | XmlNodeFree (IN OUT XML_NODE *Node) |
STATIC VOID | XmlFreeRefs (IN OUT XML_REFLIST *References) |
VOID | XmlParserError (IN CONST XML_PARSER *Parser, IN XML_PARSER_OFFSET Offset, IN CONST CHAR8 *Message) |
STATIC CHAR8 | XmlParserPeek (IN CONST XML_PARSER *Parser, IN UINT32 N) |
STATIC VOID | XmlParserConsume (IN OUT XML_PARSER *Parser, IN UINT32 N) |
STATIC VOID | XmlSkipWhitespace (IN OUT XML_PARSER *Parser) |
STATIC CONST CHAR8 * | XmlParseTagEnd (IN OUT XML_PARSER *Parser, OUT BOOLEAN *SelfClosing OPTIONAL, OUT CONST CHAR8 **Attributes OPTIONAL) |
STATIC CONST CHAR8 * | XmlParseTagOpen (IN OUT XML_PARSER *Parser, OUT BOOLEAN *SelfClosing OPTIONAL, OUT CONST CHAR8 **Attributes) |
STATIC CONST CHAR8 * | XmlParseTagClose (IN OUT XML_PARSER *Parser, IN BOOLEAN Unprefixed) |
STATIC CONST CHAR8 * | XmlParseContent (IN OUT XML_PARSER *Parser) |
STATIC VOID | XmlBufferAppend (IN OUT CHAR8 **Buffer, IN OUT UINT32 *AllocSize, IN OUT UINT32 *CurrentSize, IN CONST CHAR8 *Data, IN UINT32 DataLength) |
STATIC VOID | XmlNodeExportRecursive (IN CONST XML_NODE *Node, IN OUT CHAR8 **Buffer, IN OUT UINT32 *AllocSize, IN OUT UINT32 *CurrentSize, IN UINT32 Skip) |
STATIC XML_NODE * | XmlParseNode (IN OUT XML_PARSER *Parser, IN OUT XML_REFLIST *References OPTIONAL) |
XML_DOCUMENT * | XmlDocumentParse (IN OUT CHAR8 *Buffer, IN UINT32 Length, IN BOOLEAN WithRefs) |
CHAR8 * | XmlDocumentExport (IN CONST XML_DOCUMENT *Document, OUT UINT32 *Length OPTIONAL, IN UINT32 Skip, IN BOOLEAN PrependPlistInfo) |
VOID | XmlDocumentFree (IN OUT XML_DOCUMENT *Document) |
XML_NODE * | XmlDocumentRoot (IN CONST XML_DOCUMENT *Document) |
CONST CHAR8 * | XmlNodeName (IN CONST XML_NODE *Node) |
CONST CHAR8 * | XmlNodeContent (IN CONST XML_NODE *Node) |
VOID | XmlNodeChangeContent (IN OUT XML_NODE *Node, IN CONST CHAR8 *Content) |
UINT32 | XmlNodeChildren (IN CONST XML_NODE *Node) |
XML_NODE * | XmlNodeChild (IN CONST XML_NODE *Node, IN UINT32 Child) |
XML_NODE *EFIAPI | XmlEasyChild (IN OUT XML_NODE *Node, IN CONST CHAR8 *ChildName,...) |
XML_NODE * | XmlNodeAppend (IN OUT XML_NODE *Node, IN CONST CHAR8 *Name, IN CONST CHAR8 *Attributes OPTIONAL, IN CONST CHAR8 *Content OPTIONAL) |
XML_NODE * | XmlNodePrepend (IN OUT XML_NODE *Node, IN CONST CHAR8 *Name, IN CONST CHAR8 *Attributes, IN CONST CHAR8 *Content) |
VOID | XmlNodeRemoveByIndex (IN OUT XML_NODE *Node, IN UINT32 Index) |
VOID | XmlNodeRemove (IN OUT XML_NODE *Node, IN XML_NODE *ChildNode) |
CONST CHAR8 * | XmlUnescapeString (IN CONST CHAR8 *String) |
XML_NODE * | PlistDocumentRoot (IN CONST XML_DOCUMENT *Document) |
XML_NODE * | PlistNodeCast (IN XML_NODE *Node OPTIONAL, IN PLIST_NODE_TYPE Type) |
UINT32 | PlistDictChildren (IN CONST XML_NODE *Node) |
XML_NODE * | PlistDictChild (IN CONST XML_NODE *Node, IN UINT32 Child, OUT XML_NODE **Value OPTIONAL) |
CONST CHAR8 * | PlistKeyValue (IN XML_NODE *Node OPTIONAL) |
BOOLEAN | PlistStringValue (IN XML_NODE *Node OPTIONAL, OUT CHAR8 *Value, IN OUT UINT32 *Size) |
BOOLEAN | PlistDataValue (IN XML_NODE *Node OPTIONAL, OUT UINT8 *Buffer, IN OUT UINT32 *Size) |
BOOLEAN | PlistBooleanValue (IN XML_NODE *Node OPTIONAL, OUT BOOLEAN *Value) |
BOOLEAN | PlistIntegerValue (IN XML_NODE *Node OPTIONAL, OUT VOID *Value, IN UINT32 Size, IN BOOLEAN Hex) |
BOOLEAN | PlistMultiDataValue (IN XML_NODE *Node OPTIONAL, OUT VOID *Buffer, IN OUT UINT32 *Size) |
BOOLEAN | PlistStringSize (IN XML_NODE *Node OPTIONAL, OUT UINT32 *Size) |
BOOLEAN | PlistDataSize (IN XML_NODE *Node OPTIONAL, OUT UINT32 *Size) |
BOOLEAN | PlistMultiDataSize (IN XML_NODE *Node OPTIONAL, OUT UINT32 *Size) |
Variables | |
CONST CHAR8 * | PlistNodeTypes [PLIST_NODE_TYPE_MAX] |
OcXmlLib
Copyright (c) 2018, vit9696
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file OcXmlLib.c.
#define XML_EXPORT_MIN_ALLOCATION_SIZE 4096 |
Minimal extra allocation size during export.
Definition at line 53 of file OcXmlLib.c.
#define XML_PARSER_ERROR | ( | Parser, | |
Offset, | |||
Message ) |
Conditionally enable error printing.
Definition at line 529 of file OcXmlLib.c.
#define XML_PARSER_INFO | ( | Parser, | |
Message ) |
Echo the parsers call stack for debugging purposes.
Definition at line 454 of file OcXmlLib.c.
#define XML_PARSER_TAG | ( | Parser, | |
Tag ) |
Definition at line 455 of file OcXmlLib.c.
#define XML_PLIST_HEADER "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" |
Definition at line 55 of file OcXmlLib.c.
#define XML_USAGE_ERROR | ( | X | ) |
Definition at line 530 of file OcXmlLib.c.
typedef struct XML_NODE_LIST_ XML_NODE_LIST |
Definition at line 60 of file OcXmlLib.c.
typedef struct XML_PARSER_ XML_PARSER |
Definition at line 61 of file OcXmlLib.c.
typedef enum XML_PARSER_OFFSET_ XML_PARSER_OFFSET |
Character offsets.
enum XML_PARSER_OFFSET_ |
Character offsets.
Enumerator | |
---|---|
NO_CHARACTER | |
CURRENT_CHARACTER | |
NEXT_CHARACTER |
Definition at line 113 of file OcXmlLib.c.
BOOLEAN PlistBooleanValue | ( | IN XML_NODE *Node | OPTIONAL, |
OUT BOOLEAN * | Value ) |
Get the value of a plist boolean.
[in] | Node | A pointer to the XML node. Optional. |
[out] | Value | Value of plist boolean. |
Definition at line 1922 of file OcXmlLib.c.
BOOLEAN PlistDataSize | ( | IN XML_NODE *Node | OPTIONAL, |
OUT UINT32 * | Size ) |
Get size of a plist data.
[in] | Node | A pointer to the XML node. Optional. |
[out] | Size | Size of data. |
Definition at line 2102 of file OcXmlLib.c.
BOOLEAN PlistDataValue | ( | IN XML_NODE *Node | OPTIONAL, |
OUT UINT8 * | Buffer, | ||
IN OUT UINT32 * | Size ) |
Decode data content for valid type or set *Size to 0.
[in] | Node | A pointer to the XML node. Optional. |
[out] | Buffer | Buffer of plist data. |
[in,out] | Size | Size of Buffer. |
Definition at line 1886 of file OcXmlLib.c.
XML_NODE * PlistDictChild | ( | IN CONST XML_NODE * | Node, |
IN UINT32 | Child, | ||
OUT XML_NODE **Value | OPTIONAL ) |
Get the specific child node under a plist dictionary.
[in] | Node | A pointer to the XML node. |
[in] | Child | Index of children of Node. |
[out] | Value | Value of the returned Node. Optional. |
Definition at line 1823 of file OcXmlLib.c.
UINT32 PlistDictChildren | ( | IN CONST XML_NODE * | Node | ) |
Get the number of plist dictionary entries.
[in] | Node | A pointer to the XML node. |
Definition at line 1813 of file OcXmlLib.c.
XML_NODE * PlistDocumentRoot | ( | IN CONST XML_DOCUMENT * | Document | ) |
Get the root node of the plist document.
[in] | Document | A pointer to the plist document. |
Definition at line 1736 of file OcXmlLib.c.
BOOLEAN PlistIntegerValue | ( | IN XML_NODE *Node | OPTIONAL, |
OUT VOID * | Value, | ||
IN UINT32 | Size, | ||
IN BOOLEAN | Hex ) |
Get the value of a plist integer.
[in] | Node | A pointer to the XML node. Optional. |
[out] | Value | Value of plist integer. |
[in] | Size | Size of Value to be casted to (UINT8, UINT16, UINT32, or UINT64). |
[in] | Hex | TRUE to interpret the value as hexadecimal values, decimal otherwise. |
Definition at line 1943 of file OcXmlLib.c.
CONST CHAR8 * PlistKeyValue | ( | IN XML_NODE *Node | OPTIONAL | ) |
Get the value of a plist key.
[in] | Node | A pointer to the XML node. Optional. |
Definition at line 1841 of file OcXmlLib.c.
BOOLEAN PlistMultiDataSize | ( | IN XML_NODE *Node | OPTIONAL, |
OUT UINT32 * | Size ) |
Get size of multiple types of data that are valid.
Valid type for MultiData is DATA itself, STRING, INTEGER, or BOOLEAN (as 1 byte with 1 or 0 value).
[in] | Node | A pointer to the XML node. Optional. |
[out] | Size | Size of MultiData. |
Definition at line 2126 of file OcXmlLib.c.
BOOLEAN PlistMultiDataValue | ( | IN XML_NODE *Node | OPTIONAL, |
OUT VOID * | Buffer, | ||
IN OUT UINT32 * | Size ) |
Get the values of multiple types of data that are valid.
Valid type for MultiData is DATA itself, STRING, INTEGER, or BOOLEAN (as 1 byte with 1 or 0 value).
[in] | Node | A pointer to the XML node. Optional. |
[out] | Buffer | Buffer of plist MultiData. |
[in,out] | Size | Size of Buffer. |
Definition at line 2008 of file OcXmlLib.c.
XML_NODE * PlistNodeCast | ( | IN XML_NODE *Node | OPTIONAL, |
IN PLIST_NODE_TYPE | Type ) |
Basic type casting (up to PLIST_NODE_TYPE_MAX).
Guarantees that node represents passed type. Guarantees that arrays and dicts have valid amount of children, while others have 0. Guarantees that keys have names and integers have values.
[in] | Node | A pointer to the XML node. Optional. |
[in] | Type | Plist node type to be casted to. |
Definition at line 1760 of file OcXmlLib.c.
BOOLEAN PlistStringSize | ( | IN XML_NODE *Node | OPTIONAL, |
OUT UINT32 * | Size ) |
Get size of a plist string, including the '\0' terminator.
[in] | Node | A pointer to the XML node. Optional. |
[out] | Size | Size of string. |
Definition at line 2078 of file OcXmlLib.c.
BOOLEAN PlistStringValue | ( | IN XML_NODE *Node | OPTIONAL, |
OUT CHAR8 * | Value, | ||
IN OUT UINT32 * | Size ) |
Get the value of a plist string.
[in] | Node | A pointer to the XML node. Optional. |
[out] | Value | Value of plist string. |
[in,out] | Size | Size of Value, including the '\0' terminator. |
Definition at line 1853 of file OcXmlLib.c.
STATIC VOID XmlBufferAppend | ( | IN OUT CHAR8 ** | Buffer, |
IN OUT UINT32 * | AllocSize, | ||
IN OUT UINT32 * | CurrentSize, | ||
IN CONST CHAR8 * | Data, | ||
IN UINT32 | DataLength ) |
Print to growing buffer always preserving one byte extra.
[in,out] | Buffer | A pointer to the buffer holding contents. |
[in,out] | AllocSize | Size of Buffer to be allocated. |
[in,out] | CurrentSize | Current size of Buffer before appending. |
[in] | Data | Data to be appended. |
[in] | DataLength | Length of Data. |
Definition at line 1018 of file OcXmlLib.c.
CHAR8 * XmlDocumentExport | ( | IN CONST XML_DOCUMENT * | Document, |
OUT UINT32 *Length | OPTIONAL, | ||
IN UINT32 | Skip, | ||
IN BOOLEAN | PrependPlistInfo ) |
Export parsed document into the buffer.
[in] | Document | XML_DOCUMENT to export. |
[out] | Length | Resulting length of the buffer without trailing '\0'. Optional. |
[in] | Skip | Number of root levels to be skipped before exporting, normally 0. |
[in] | PrependPlistInfo | TRUE to prepend XML plist doc info to exported document. |
Definition at line 1367 of file OcXmlLib.c.
VOID XmlDocumentFree | ( | IN OUT XML_DOCUMENT * | Document | ) |
Free all resources associated with the document. All XML_NODE references obtained through the document will be invalidated.
[in,out] | Document | XML document to be freed. |
Definition at line 1435 of file OcXmlLib.c.
XML_DOCUMENT * XmlDocumentParse | ( | IN OUT CHAR8 * | Buffer, |
IN UINT32 | Length, | ||
IN BOOLEAN | WithRefs ) |
Parse the XML fragment in buffer. References in the document to allow deduplicated node reading: <integer ID="0" size="64">0x0</integer> <integer IDREF="0" size="64">
[in,out] | Buffer | Chunk to be parsed. |
[in] | Length | Size of the buffer. |
[in] | WithRef | TRUE to enable reference lookup support. |
Buffer
will be referenced by the document, it may not be freed until XML_DOCUMENT is freed. Buffer
contents are permanently modified during parsingDefinition at line 1308 of file OcXmlLib.c.
XML_NODE * XmlDocumentRoot | ( | IN CONST XML_DOCUMENT * | Document | ) |
Get the root of the XML document.
[in] | Document | A pointer to the XML document. |
Definition at line 1447 of file OcXmlLib.c.
Get the child node specified by the list of names.
[in,out] | Node | A pointer to the XML node. |
[in] | ChildName | List of child names. |
Definition at line 1515 of file OcXmlLib.c.
STATIC VOID XmlFreeRefs | ( | IN OUT XML_REFLIST * | References | ) |
Free the XML references.
[in,out] | References | A pointer to the XML references to be freed. |
Definition at line 433 of file OcXmlLib.c.
XML_NODE * XmlNodeAppend | ( | IN OUT XML_NODE * | Node, |
IN CONST CHAR8 * | Name, | ||
IN CONST CHAR8 *Attributes | OPTIONAL, | ||
IN CONST CHAR8 *Content | OPTIONAL ) |
Append new node to current node.
[in,out] | Node | Current node. |
[in] | Name | Name of the new node. |
[in] | Attributes | Attributes of the new node. Optional. |
[in] | Content | New node content. Optional. |
Definition at line 1581 of file OcXmlLib.c.
VOID XmlNodeChangeContent | ( | IN OUT XML_NODE * | Node, |
IN CONST CHAR8 * | Content ) |
Change the string content of an XML node.
[in,out] | Node | A pointer to the XML node. |
[in] | Content | New node content. |
Definition at line 1477 of file OcXmlLib.c.
Get the specific child node.
[in] | Node | A pointer to the XML node. |
[in] | Child | Index of children of Node. |
Definition at line 1503 of file OcXmlLib.c.
Add a child node to the node given.
[in,out] | Node | Pointer to the XML node to which the child will be added. |
[in] | Child | Pointer to the child XML node. |
TRUE | on successful adding. |
Definition at line 237 of file OcXmlLib.c.
UINT32 XmlNodeChildren | ( | IN CONST XML_NODE * | Node | ) |
Get the number of child nodes under an XML node.
[in] | Node | A pointer to the XML node. |
Definition at line 1493 of file OcXmlLib.c.
CONST CHAR8 * XmlNodeContent | ( | IN CONST XML_NODE * | Node | ) |
Get the content of an XML node.
[in] | Node | A pointer to the XML node. |
Definition at line 1467 of file OcXmlLib.c.
STATIC XML_NODE * XmlNodeCreate | ( | IN CONST CHAR8 * | Name, |
IN CONST CHAR8 *Attributes | OPTIONAL, | ||
IN CONST CHAR8 *Content | OPTIONAL, | ||
IN XML_NODE *Real | OPTIONAL, | ||
IN XML_NODE_LIST *Children | OPTIONAL ) |
Create a new XML node.
[in] | Name | Name of the new node. |
[in] | Attributes | Attributes of the new node. Optional. |
[in] | Content | Content of the new node. Optional. |
[in] | Real | Pointer to the acual content when a reference exists. Optional. |
[in] | Children | Pointer to the children of the node. Optional. |
Definition at line 202 of file OcXmlLib.c.
STATIC VOID XmlNodeExportRecursive | ( | IN CONST XML_NODE * | Node, |
IN OUT CHAR8 ** | Buffer, | ||
IN OUT UINT32 * | AllocSize, | ||
IN OUT UINT32 * | CurrentSize, | ||
IN UINT32 | Skip ) |
Print node to growing buffer always preserving one byte extra.
[in] | Node | A pointer to the XML node. |
[in,out] | Buffer | A pointer to the buffer holding contents exported. |
[in,out] | AllocSize | Size of Buffer to be allocated. |
[in,out] | CurrentSize | Current size of Buffer. |
[in] | Skip | Levels of XML contents to be skipped. |
Definition at line 1070 of file OcXmlLib.c.
STATIC VOID XmlNodeFree | ( | IN OUT XML_NODE * | Node | ) |
Free the resources allocated by the node.
[in,out] | Node | A pointer to the XML node to be freed. |
Definition at line 407 of file OcXmlLib.c.
CONST CHAR8 * XmlNodeName | ( | IN CONST XML_NODE * | Node | ) |
Get the name of an XML node.
[in] | Node | A pointer to the XML node. |
Definition at line 1457 of file OcXmlLib.c.
XML_NODE * XmlNodePrepend | ( | IN OUT XML_NODE * | Node, |
IN CONST CHAR8 * | Name, | ||
IN CONST CHAR8 * | Attributes, | ||
IN CONST CHAR8 * | Content ) |
Prepend new node to current node.
[in,out] | Node | Current node. |
[in] | Name | Name of the new node. |
[in] | Attributes | Attributes of the new node. Optional. |
[in] | Content | New node content. Optional. |
Definition at line 1607 of file OcXmlLib.c.
STATIC XML_NODE * XmlNodeReal | ( | IN CONST XML_REFLIST *References | OPTIONAL, |
IN CONST CHAR8 *Attributes | OPTIONAL ) |
Get real value from a node referencing another.
[in] | References | A pointer to the XML references. Optional. |
[in] | Attributes | XML attributes. Optional. |
Definition at line 374 of file OcXmlLib.c.
Remove the child node from the current node.
[in,out] | Node | Current node. |
[in] | ChildNode | Child node to be removed. |
Definition at line 1664 of file OcXmlLib.c.
VOID XmlNodeRemoveByIndex | ( | IN OUT XML_NODE * | Node, |
IN UINT32 | Index ) |
Remove the Index-th child node inside an XML node.
[in,out] | Node | Current node. |
[in] | Index | Index-th child node to be removed. |
Definition at line 1633 of file OcXmlLib.c.
STATIC BOOLEAN XmlParseAttributeNumber | ( | IN CONST CHAR8 * | Attributes, |
IN CONST CHAR8 * | Argument, | ||
IN UINT32 | ArgumentLength, | ||
OUT UINT32 * | ArgumentValue ) |
Parse the attribute number.
[in] | Attributes | XML attributes. |
[in] | Argument | Name of the XML argument. |
[in] | ArgumentLength | Length of the XML argument. |
[out] | ArgumentValue | The parsed XML argument value. |
TRUE | on successful parsing. |
Definition at line 149 of file OcXmlLib.c.
STATIC CONST CHAR8 * XmlParseContent | ( | IN OUT XML_PARSER * | Parser | ) |
Parse a tag's content.
—( Example )— this is a
[in,out] | Parser | A pointer to the XML parser. |
Definition at line 950 of file OcXmlLib.c.
STATIC XML_NODE * XmlParseNode | ( | IN OUT XML_PARSER * | Parser, |
IN OUT XML_REFLIST *References | OPTIONAL ) |
Parse an XML fragment node.
—( Example without children )—
—( Example with children )— <Parent> <Child>Text</Child> <Child>Text</Child> <Test>Content</Test>
[in,out] | Parser | A pointer to the XML parser. |
[in,out] | References | A pointer to the XML references. Optional. |
Definition at line 1147 of file OcXmlLib.c.
STATIC VOID XmlParserConsume | ( | IN OUT XML_PARSER * | Parser, |
IN UINT32 | N ) |
Move the parser's position n bytes. If the new position would be out of bounds, it will be converted to the bounds itself.
[in,out] | Parser | A pointer to the XML parser. |
[in] | N | The N-th index. |
Definition at line 570 of file OcXmlLib.c.
VOID XmlParserError | ( | IN CONST XML_PARSER * | Parser, |
IN XML_PARSER_OFFSET | Offset, | ||
IN CONST CHAR8 * | Message ) |
Echo an error regarding the parser's source to the console.
[in] | Parser | A pointer to the XML parser. |
[in] | Offset | Offset of the XML parser. |
[in] | Message | Message to be displayed |
Definition at line 466 of file OcXmlLib.c.
STATIC CHAR8 XmlParserPeek | ( | IN CONST XML_PARSER * | Parser, |
IN UINT32 | N ) |
Return the N-th not-whitespace byte in parser or 0 if such a byte does not exist.
[in] | Parser | A pointer to the XML parser. |
[in] | N | The N-th index. |
Definition at line 543 of file OcXmlLib.c.
STATIC CONST CHAR8 * XmlParseTagClose | ( | IN OUT XML_PARSER * | Parser, |
IN BOOLEAN | Unprefixed ) |
Parse an closing XML tag without attributes.
—( Example )—
[in,out] | Parser | A pointer to the XML parser. |
[in] | Unprefixed | TRUE to parse without the starting ‘<’. |
Definition at line 890 of file OcXmlLib.c.
STATIC CONST CHAR8 * XmlParseTagEnd | ( | IN OUT XML_PARSER * | Parser, |
OUT BOOLEAN *SelfClosing | OPTIONAL, | ||
OUT CONST CHAR8 **Attributes | OPTIONAL ) |
Parse the name out of the an XML tag's ending.
—( Example )—
[in,out] | Parser | A pointer to the XML parser. |
[out] | SelfClosing | TRUE to indicate self-closing. Optional. |
[out] | Attributes | Exported XML attributes. Optional. |
Definition at line 658 of file OcXmlLib.c.
STATIC CONST CHAR8 * XmlParseTagOpen | ( | IN OUT XML_PARSER * | Parser, |
OUT BOOLEAN *SelfClosing | OPTIONAL, | ||
OUT CONST CHAR8 ** | Attributes ) |
Parse an opening XML tag without attributes.
—( Example )—
[in,out] | Parser | A pointer to the XML parser. |
[out] | SelfClosing | TRUE to indicate self-closing. Optional. |
[out] | Attributes | Exported XML attributes. Optional. |
Definition at line 765 of file OcXmlLib.c.
STATIC BOOLEAN XmlPushReference | ( | IN OUT XML_REFLIST * | References, |
IN XML_NODE * | Node, | ||
IN UINT32 | ReferenceNumber ) |
Store XML reference.
[in,out] | References | A pointer to the list of XML references. |
[in] | Node | A pointer to the XML node. |
[in] | ReferenceNumber | Number of reference. |
TRUE | if the XML reference was successfully pushed. |
Definition at line 317 of file OcXmlLib.c.
STATIC VOID XmlSkipWhitespace | ( | IN OUT XML_PARSER * | Parser | ) |
Skip to the next non-whitespace character.
[in,out] | Parser | A pointer to the XML parser. |
Definition at line 628 of file OcXmlLib.c.
CONST CHAR8 * XmlUnescapeString | ( | IN CONST CHAR8 * | String | ) |
Unescape XML string.
[in] | String | Escaped string to be converted to unescaped. |
Definition at line 1687 of file OcXmlLib.c.
CONST CHAR8* PlistNodeTypes[PLIST_NODE_TYPE_MAX] |
Plist node types.
Definition at line 123 of file OcXmlLib.c.