OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcXmlLib.h
Go to the documentation of this file.
1
19//
20// Copyright (c) 2012 ooxi/xml.c
21// https://github.com/ooxi/xml.c
22//
23// This software is provided 'as-is', without any express or implied warranty.
24// In no event will the authors be held liable for any damages arising from the
25// use of this software.
26//
27// Permission is granted to anyone to use this software for any purpose,
28// including commercial applications, and to alter it and redistribute it
29// freely, subject to the following restrictions:
30//
31// 1. The origin of this software must not be misrepresented; you must not
32// claim that you wrote the original software. If you use this software in a
33// product, an acknowledgment in the product documentation would be
34// appreciated but is not required.
35//
36// 2. Altered source versions must be plainly marked as such, and must not be
37// misrepresented as being the original software.
38//
39// 3. This notice may not be removed or altered from any source distribution.
40//
41
42#ifndef OC_XML_LIB_H
43#define OC_XML_LIB_H
44
45#include <Library/BaseOverflowLib.h>
46
51#ifndef XML_PARSER_NEST_LEVEL
52#define XML_PARSER_NEST_LEVEL 32ULL
53#endif
54
59#ifndef XML_PARSER_NODE_COUNT
60#define XML_PARSER_NODE_COUNT 32768ULL
61#endif
62
67#ifndef XML_PARSER_MAX_REFERENCE_COUNT
68#define XML_PARSER_MAX_REFERENCE_COUNT (32ULL*1024)
69#endif
70
75#ifndef XML_PARSER_MAX_SIZE
76#define XML_PARSER_MAX_SIZE (32ULL*1024*1024)
77#endif
78
82// #define XML_PARSER_VERBOSE
83// #define XML_PRINT_ERRORS
84
102
106struct XML_DOCUMENT_;
107struct XML_NODE_;
109typedef struct XML_NODE_ XML_NODE;
110
130 IN OUT CHAR8 *Buffer,
131 IN UINT32 Length,
132 IN BOOLEAN WithRefs
133 );
134
145CHAR8 *
147 IN CONST XML_DOCUMENT *Document,
148 OUT UINT32 *Length OPTIONAL,
149 IN UINT32 Skip,
150 IN BOOLEAN PrependPlistInfo
151 );
152
159VOID
161 IN OUT XML_DOCUMENT *Document
162 );
163
171XML_NODE *
173 IN CONST XML_DOCUMENT *Document
174 );
175
183CONST CHAR8 *
185 IN CONST XML_NODE *Node
186 );
187
195CONST CHAR8 *
197 IN CONST XML_NODE *Node
198 );
199
208VOID
210 IN OUT XML_NODE *Node,
211 IN CONST CHAR8 *Content
212 );
213
221UINT32
223 IN CONST XML_NODE *Node
224 );
225
234XML_NODE *
236 IN CONST XML_NODE *Node,
237 IN UINT32 Child
238 );
239
251XML_NODE *
252EFIAPI
254 IN OUT XML_NODE *Node,
255 IN CONST CHAR8 *ChildName,
256 ...
257 );
258
271XML_NODE *
273 IN OUT XML_NODE *Node,
274 IN CONST CHAR8 *Name,
275 IN CONST CHAR8 *Attributes OPTIONAL,
276 IN CONST CHAR8 *Content OPTIONAL
277 );
278
291XML_NODE *
293 IN OUT XML_NODE *Node,
294 IN CONST CHAR8 *Name,
295 IN CONST CHAR8 *Attributes,
296 IN CONST CHAR8 *Content
297 );
298
305VOID
307 IN OUT XML_NODE *Node,
308 IN UINT32 Index
309 );
310
317VOID
319 IN OUT XML_NODE *Node,
320 IN XML_NODE *ChildNode
321 );
322
331CONST CHAR8 *
333 IN CONST CHAR8 *String
334 );
335
346XML_NODE *
348 IN CONST XML_DOCUMENT *Document
349 );
350
365XML_NODE *
367 IN XML_NODE *Node OPTIONAL,
368 IN PLIST_NODE_TYPE Type
369 );
370
378UINT32
380 IN CONST XML_NODE *Node
381 );
382
392XML_NODE *
394 IN CONST XML_NODE *Node,
395 IN UINT32 Child,
396 OUT XML_NODE **Value OPTIONAL
397 );
398
406CONST CHAR8 *
408 IN XML_NODE *Node OPTIONAL
409 );
410
420BOOLEAN
422 IN XML_NODE *Node OPTIONAL,
423 OUT CHAR8 *Value,
424 IN OUT UINT32 *Size
425 );
426
436BOOLEAN
438 IN XML_NODE *Node OPTIONAL,
439 OUT UINT8 *Buffer,
440 IN OUT UINT32 *Size
441 );
442
451BOOLEAN
453 IN XML_NODE *Node OPTIONAL,
454 OUT BOOLEAN *Value
455 );
456
467BOOLEAN
469 IN XML_NODE *Node OPTIONAL,
470 OUT VOID *Value,
471 IN UINT32 Size,
472 IN BOOLEAN Hex
473 );
474
490BOOLEAN
492 IN XML_NODE *Node OPTIONAL,
493 OUT VOID *Buffer,
494 IN OUT UINT32 *Size
495 );
496
505BOOLEAN
507 IN XML_NODE *Node OPTIONAL,
508 OUT UINT32 *Size
509 );
510
519BOOLEAN
521 IN XML_NODE *Node OPTIONAL,
522 OUT UINT32 *Size
523 );
524
536BOOLEAN
538 IN XML_NODE *Node OPTIONAL,
539 OUT UINT32 *Size
540 );
541
542#endif // OC_XML_LIB_H
UINT64 Length
DMG_SIZE_DEVICE_PATH Size
OC_TYPING_BUFFER_ENTRY Buffer[OC_TYPING_BUFFER_SIZE]
Definition OcTypingLib.h:42
XML_NODE * XmlDocumentRoot(IN CONST XML_DOCUMENT *Document)
Definition OcXmlLib.c:1447
PLIST_NODE_TYPE_
Definition OcXmlLib.h:88
@ PLIST_NODE_TYPE_MAX
Definition OcXmlLib.h:100
@ PLIST_NODE_TYPE_DICT
Definition OcXmlLib.h:91
@ PLIST_NODE_TYPE_REAL
Definition OcXmlLib.h:98
@ PLIST_NODE_TYPE_DATE
Definition OcXmlLib.h:95
@ PLIST_NODE_TYPE_DATA
Definition OcXmlLib.h:94
@ PLIST_NODE_TYPE_STRING
Definition OcXmlLib.h:93
@ PLIST_NODE_TYPE_KEY
Definition OcXmlLib.h:92
@ PLIST_NODE_TYPE_FALSE
Definition OcXmlLib.h:97
@ PLIST_NODE_TYPE_ARRAY
Definition OcXmlLib.h:90
@ PLIST_NODE_TYPE_INTEGER
Definition OcXmlLib.h:99
@ PLIST_NODE_TYPE_TRUE
Definition OcXmlLib.h:96
@ PLIST_NODE_TYPE_ANY
Definition OcXmlLib.h:89
BOOLEAN PlistDataSize(IN XML_NODE *Node OPTIONAL, OUT UINT32 *Size)
Definition OcXmlLib.c:2102
XML_DOCUMENT * XmlDocumentParse(IN OUT CHAR8 *Buffer, IN UINT32 Length, IN BOOLEAN WithRefs)
Definition OcXmlLib.c:1308
CONST CHAR8 * PlistKeyValue(IN XML_NODE *Node OPTIONAL)
Definition OcXmlLib.c:1841
BOOLEAN PlistMultiDataSize(IN XML_NODE *Node OPTIONAL, OUT UINT32 *Size)
Definition OcXmlLib.c:2126
UINT32 XmlNodeChildren(IN CONST XML_NODE *Node)
Definition OcXmlLib.c:1493
VOID XmlNodeRemoveByIndex(IN OUT XML_NODE *Node, IN UINT32 Index)
Definition OcXmlLib.c:1633
XML_NODE *EFIAPI XmlEasyChild(IN OUT XML_NODE *Node, IN CONST CHAR8 *ChildName,...)
Definition OcXmlLib.c:1515
CHAR8 * XmlDocumentExport(IN CONST XML_DOCUMENT *Document, OUT UINT32 *Length OPTIONAL, IN UINT32 Skip, IN BOOLEAN PrependPlistInfo)
Definition OcXmlLib.c:1367
CONST CHAR8 * XmlNodeContent(IN CONST XML_NODE *Node)
Definition OcXmlLib.c:1467
UINT32 PlistDictChildren(IN CONST XML_NODE *Node)
Definition OcXmlLib.c:1813
BOOLEAN PlistStringSize(IN XML_NODE *Node OPTIONAL, OUT UINT32 *Size)
Definition OcXmlLib.c:2078
BOOLEAN PlistStringValue(IN XML_NODE *Node OPTIONAL, OUT CHAR8 *Value, IN OUT UINT32 *Size)
Definition OcXmlLib.c:1853
BOOLEAN PlistIntegerValue(IN XML_NODE *Node OPTIONAL, OUT VOID *Value, IN UINT32 Size, IN BOOLEAN Hex)
Definition OcXmlLib.c:1943
XML_NODE * PlistNodeCast(IN XML_NODE *Node OPTIONAL, IN PLIST_NODE_TYPE Type)
Definition OcXmlLib.c:1760
XML_NODE * XmlNodeAppend(IN OUT XML_NODE *Node, IN CONST CHAR8 *Name, IN CONST CHAR8 *Attributes OPTIONAL, IN CONST CHAR8 *Content OPTIONAL)
Definition OcXmlLib.c:1581
CONST CHAR8 * XmlNodeName(IN CONST XML_NODE *Node)
Definition OcXmlLib.c:1457
VOID XmlNodeRemove(IN OUT XML_NODE *Node, IN XML_NODE *ChildNode)
Definition OcXmlLib.c:1664
XML_NODE * XmlNodePrepend(IN OUT XML_NODE *Node, IN CONST CHAR8 *Name, IN CONST CHAR8 *Attributes, IN CONST CHAR8 *Content)
Definition OcXmlLib.c:1607
XML_NODE * PlistDocumentRoot(IN CONST XML_DOCUMENT *Document)
Definition OcXmlLib.c:1736
BOOLEAN PlistDataValue(IN XML_NODE *Node OPTIONAL, OUT UINT8 *Buffer, IN OUT UINT32 *Size)
Definition OcXmlLib.c:1886
CONST CHAR8 * XmlUnescapeString(IN CONST CHAR8 *String)
Definition OcXmlLib.c:1687
XML_NODE * XmlNodeChild(IN CONST XML_NODE *Node, IN UINT32 Child)
Definition OcXmlLib.c:1503
BOOLEAN PlistBooleanValue(IN XML_NODE *Node OPTIONAL, OUT BOOLEAN *Value)
Definition OcXmlLib.c:1922
enum PLIST_NODE_TYPE_ PLIST_NODE_TYPE
VOID XmlDocumentFree(IN OUT XML_DOCUMENT *Document)
Definition OcXmlLib.c:1435
VOID XmlNodeChangeContent(IN OUT XML_NODE *Node, IN CONST CHAR8 *Content)
Definition OcXmlLib.c:1477
BOOLEAN PlistMultiDataValue(IN XML_NODE *Node OPTIONAL, OUT VOID *Buffer, IN OUT UINT32 *Size)
Definition OcXmlLib.c:2008
XML_NODE * PlistDictChild(IN CONST XML_NODE *Node, IN UINT32 Child, OUT XML_NODE **Value OPTIONAL)
Definition OcXmlLib.c:1823
CONST CHAR8 * Content
Definition OcXmlLib.c:70
CONST CHAR8 * Name
Definition OcXmlLib.c:68
CONST CHAR8 * Attributes
Definition OcXmlLib.c:69