forked from eugeneotto/parsley
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_jnaerator.rawParsed.cpp
5042 lines (4893 loc) · 209 KB
/
_jnaerator.rawParsed.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** Define outside of namespace so the C++ is happy. */
struct _IO_FILE;
/** The opaque type of streams. This is the definition used elsewhere. */
typedef struct _IO_FILE FILE;
/**
* Integral type unchanged by default argument promotions that can<br>
* hold any value corresponding to members of the extended character<br>
* set, as well as at least one value that does not correspond to any<br>
* member of the extended character set.
*/
typedef unsigned int wint_t;
/** Conversion state information. */
typedef struct {
int __count;
union {
wint_t __wch;
char __wchb[4];
} __value;
} __mbstate_t;
typedef struct {
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
typedef struct {
__off64_t __pos;
__mbstate_t __state;
} _G_fpos64_t;
typedef int _G_int16_t;
typedef int _G_int32_t;
typedef unsigned int _G_uint16_t;
typedef unsigned int _G_uint32_t;
namespace std {
}
/** These are "formatting flags" matching the iostream fmtflags enum values. */
struct _IO_jump_t;
struct _IO_FILE;
/** Handle lock. */
typedef void _IO_lock_t;
/** A streammarker remembers a position in a buffer. */
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
};
/** This is the structure from the libstdc++ codecvt class. */
enum __codecvt_result {
__codecvt_ok,
__codecvt_partial,
__codecvt_error,
__codecvt_noconv
};
struct _IO_FILE {
int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
char *_IO_read_ptr; /* Current read pointer */
char *_IO_read_end; /* End of get area. */
char *_IO_read_base; /* Start of putback+get area. */
char *_IO_write_base; /* Start of put area. */
char *_IO_write_ptr; /* Current put pointer. */
char *_IO_write_end; /* End of put area. */
char *_IO_buf_base; /* Start of reserve area. */
char *_IO_buf_end; /* End of reserve area. */
char *_IO_save_base; /* Pointer to start of non-current get area. */
char *_IO_backup_base; /* Pointer to first valid character of backup area */
char *_IO_save_end; /* Pointer to end of non-current get area. */
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _flags2;
__off_t _old_offset; /* This used to be _offset but it's too small. */
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
__off64_t _offset;
void *__pad1;
void *__pad2;
void *__pad3;
void *__pad4;
size_t __pad5;
int _mode;
char _unused2[15 * sizeof(int) - 4 * sizeof(void*) - sizeof(size_t)];
};
struct _IO_FILE_plus;
struct extern _IO_FILE_plus _IO_2_1_stdin_;
struct extern _IO_FILE_plus _IO_2_1_stdout_;
struct extern _IO_FILE_plus _IO_2_1_stderr_;
/**
* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF.<br>
* Return number of bytes read.
*/
typedef __ssize_t __io_read_fn(void* __cookie, char* __buf, size_t __nbytes);
/**
* Write N bytes pointed to by BUF to COOKIE. Write all N bytes<br>
* unless there is an error. Return number of bytes written, or -1 if<br>
* there is an error without writing anything. If the file has been<br>
* opened for append (__mode.__append set), then set the file pointer<br>
* to the end of the file and then do the write; if not, just write at<br>
* the current file pointer.
*/
typedef __ssize_t __io_write_fn(void* __cookie, __const char* __buf, size_t __n);
/**
* Move COOKIE's file position to *POS bytes from the<br>
* beginning of the file (if W is SEEK_SET),<br>
* the current position (if W is SEEK_CUR),<br>
* or the end of the file (if W is SEEK_END).<br>
* Set *POS to the new file position.<br>
* Returns zero if successful, nonzero if not.
*/
typedef int __io_seek_fn(void* __cookie, __off64_t* __pos, int __w);
/** Close COOKIE. */
typedef int __io_close_fn(void* __cookie);
extern int __underflow(_IO_FILE*);
extern int __uflow(_IO_FILE*);
extern int __overflow(_IO_FILE*, int);
extern int _IO_getc(_IO_FILE* __fp);
extern int _IO_putc(int __c, _IO_FILE* __fp);
typedef __gnuc_va_list va_list;
typedef __off_t off_t;
typedef __ssize_t ssize_t;
/** The type of the second argument to `fgetpos' and `fsetpos'. */
typedef _G_fpos_t fpos_t;
/** Standard streams. */
struct extern _IO_FILE *stdin; /* Standard input stream. */
struct extern _IO_FILE *stdout; /* Standard output stream. */
struct extern _IO_FILE *stderr; /* Standard error output stream. */
extern ""C"" {
/**
* use those to be sure nothing nasty will happen if<br>
* your library and includes mismatch
*/
void xmlCheckVersion(int version);
}
extern ""C"" {
/**
* xmlChar:<br>
* * This is a basic byte in an UTF-8 encoded string.<br>
* It's unsigned allowing to pinpoint case where char * are assigned<br>
* to xmlChar * (possibly making serialization back impossible).
*/
typedef unsigned char xmlChar;
/** xmlChar handling */
xmlChar* xmlStrdup(const xmlChar* cur);
xmlChar* xmlStrndup(const xmlChar* cur, int len);
xmlChar* xmlCharStrndup(const char* cur, int len);
xmlChar* xmlCharStrdup(const char* cur);
xmlChar* xmlStrsub(const xmlChar* str, int start, int len);
const xmlChar* xmlStrchr(const xmlChar* str, xmlChar val);
const xmlChar* xmlStrstr(const xmlChar* str, const xmlChar* val);
const xmlChar* xmlStrcasestr(const xmlChar* str, const xmlChar* val);
int xmlStrcmp(const xmlChar* str1, const xmlChar* str2);
int xmlStrncmp(const xmlChar* str1, const xmlChar* str2, int len);
int xmlStrcasecmp(const xmlChar* str1, const xmlChar* str2);
int xmlStrncasecmp(const xmlChar* str1, const xmlChar* str2, int len);
int xmlStrEqual(const xmlChar* str1, const xmlChar* str2);
int xmlStrQEqual(const xmlChar* pref, const xmlChar* name, const xmlChar* str);
int xmlStrlen(const xmlChar* str);
xmlChar* xmlStrcat(xmlChar* cur, const xmlChar* add);
xmlChar* xmlStrncat(xmlChar* cur, const xmlChar* add, int len);
xmlChar* xmlStrncatNew(const xmlChar* str1, const xmlChar* str2, int len);
int xmlStrPrintf(xmlChar* buf, int len, const xmlChar* msg, ...);
int xmlStrVPrintf(xmlChar* buf, int len, const xmlChar* msg, va_list ap);
int xmlGetUTF8Char(const unsigned char* utf, int* len);
int xmlCheckUTF8(const unsigned char* utf);
int xmlUTF8Strsize(const xmlChar* utf, int len);
xmlChar* xmlUTF8Strndup(const xmlChar* utf, int len);
const xmlChar* xmlUTF8Strpos(const xmlChar* utf, int pos);
int xmlUTF8Strloc(const xmlChar* utf, const xmlChar* utfchar);
xmlChar* xmlUTF8Strsub(const xmlChar* utf, int start, int len);
int xmlUTF8Strlen(const xmlChar* utf);
int xmlUTF8Size(const xmlChar* utf);
int xmlUTF8Charcmp(const xmlChar* utf1, const xmlChar* utf2);
}
extern ""C"" {
/** xmlIO.h */
typedef struct _xmlParserInputBuffer xmlParserInputBuffer;
typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
typedef struct _xmlOutputBuffer xmlOutputBuffer;
typedef xmlOutputBuffer *xmlOutputBufferPtr;
/** parser.h */
typedef struct _xmlParserInput xmlParserInput;
typedef xmlParserInput *xmlParserInputPtr;
typedef struct _xmlParserCtxt xmlParserCtxt;
typedef xmlParserCtxt *xmlParserCtxtPtr;
typedef struct _xmlSAXLocator xmlSAXLocator;
typedef xmlSAXLocator *xmlSAXLocatorPtr;
typedef struct _xmlSAXHandler xmlSAXHandler;
typedef xmlSAXHandler *xmlSAXHandlerPtr;
/** entities.h */
typedef struct _xmlEntity xmlEntity;
typedef xmlEntity *xmlEntityPtr;
/**
* xmlBufferAllocationScheme:<br>
* * A buffer allocation scheme can be defined to either match exactly the<br>
* need or double it's allocated size each time it is found too small.
*/
typedef enum {
XML_BUFFER_ALLOC_DOUBLEIT /* double each time one need to grow */,
XML_BUFFER_ALLOC_EXACT /* grow only to the minimal size */,
XML_BUFFER_ALLOC_IMMUTABLE /* immutable buffer */,
XML_BUFFER_ALLOC_IO /* special allocation scheme used for I/O */
} xmlBufferAllocationScheme;
/**
* xmlBuffer:<br>
* * A buffer structure.
*/
typedef struct _xmlBuffer xmlBuffer;
typedef xmlBuffer *xmlBufferPtr;
struct _xmlBuffer {
xmlChar *content; /* The buffer content UTF8 */
unsigned int use; /* The buffer size used */
unsigned int size; /* The buffer size */
xmlBufferAllocationScheme alloc; /* The realloc method */
xmlChar *contentIO; /* in IO mode we may have a different base */
};
/**
* The different element types carried by an XML tree.<br>
* * NOTE: This is synchronized with DOM Level1 values<br>
* See http://www.w3.org/TR/REC-DOM-Level-1/<br>
* * Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should<br>
* be deprecated to use an XML_DTD_NODE.
*/
typedef enum {
XML_ELEMENT_NODE = 1,
XML_ATTRIBUTE_NODE = 2,
XML_TEXT_NODE = 3,
XML_CDATA_SECTION_NODE = 4,
XML_ENTITY_REF_NODE = 5,
XML_ENTITY_NODE = 6,
XML_PI_NODE = 7,
XML_COMMENT_NODE = 8,
XML_DOCUMENT_NODE = 9,
XML_DOCUMENT_TYPE_NODE = 10,
XML_DOCUMENT_FRAG_NODE = 11,
XML_NOTATION_NODE = 12,
XML_HTML_DOCUMENT_NODE = 13,
XML_DTD_NODE = 14,
XML_ELEMENT_DECL = 15,
XML_ATTRIBUTE_DECL = 16,
XML_ENTITY_DECL = 17,
XML_NAMESPACE_DECL = 18,
XML_XINCLUDE_START = 19,
XML_XINCLUDE_END = 20,
XML_DOCB_DOCUMENT_NODE = 21
} xmlElementType;
/**
* xmlNotation:<br>
* * A DTD Notation definition.
*/
typedef struct _xmlNotation xmlNotation;
typedef xmlNotation *xmlNotationPtr;
struct _xmlNotation {
const xmlChar *name; /* Notation name */
const xmlChar *PublicID; /* Public identifier, if any */
const xmlChar *SystemID; /* System identifier, if any */
};
/**
* xmlAttributeType:<br>
* * A DTD Attribute type definition.
*/
typedef enum {
XML_ATTRIBUTE_CDATA = 1,
XML_ATTRIBUTE_ID,
XML_ATTRIBUTE_IDREF,
XML_ATTRIBUTE_IDREFS,
XML_ATTRIBUTE_ENTITY,
XML_ATTRIBUTE_ENTITIES,
XML_ATTRIBUTE_NMTOKEN,
XML_ATTRIBUTE_NMTOKENS,
XML_ATTRIBUTE_ENUMERATION,
XML_ATTRIBUTE_NOTATION
} xmlAttributeType;
/**
* xmlAttributeDefault:<br>
* * A DTD Attribute default definition.
*/
typedef enum {
XML_ATTRIBUTE_NONE = 1,
XML_ATTRIBUTE_REQUIRED,
XML_ATTRIBUTE_IMPLIED,
XML_ATTRIBUTE_FIXED
} xmlAttributeDefault;
/**
* xmlEnumeration:<br>
* * List structure used when there is an enumeration in DTDs.
*/
typedef struct _xmlEnumeration xmlEnumeration;
typedef xmlEnumeration *xmlEnumerationPtr;
struct _xmlEnumeration {
struct _xmlEnumeration *next; /* next one */
const xmlChar *name; /* Enumeration name */
};
/**
* xmlAttribute:<br>
* * An Attribute declaration in a DTD.
*/
typedef struct _xmlAttribute xmlAttribute;
typedef xmlAttribute *xmlAttributePtr;
struct _xmlAttribute {
void *_private; /* application data */
xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */
const xmlChar *name; /* Attribute name */
struct _xmlNode *children; /* NULL */
struct _xmlNode *last; /* NULL */
struct _xmlDtd *parent; /* -> DTD */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
struct _xmlAttribute *nexth; /* next in hash table */
xmlAttributeType atype; /* The attribute type */
xmlAttributeDefault def; /* the default */
const xmlChar *defaultValue; /* or the default value */
xmlEnumerationPtr tree; /* or the enumeration tree if any */
const xmlChar *prefix; /* the namespace prefix if any */
const xmlChar *elem; /* Element holding the attribute */
};
/**
* xmlElementContentType:<br>
* * Possible definitions of element content types.
*/
typedef enum {
XML_ELEMENT_CONTENT_PCDATA = 1,
XML_ELEMENT_CONTENT_ELEMENT,
XML_ELEMENT_CONTENT_SEQ,
XML_ELEMENT_CONTENT_OR
} xmlElementContentType;
/**
* xmlElementContentOccur:<br>
* * Possible definitions of element content occurrences.
*/
typedef enum {
XML_ELEMENT_CONTENT_ONCE = 1,
XML_ELEMENT_CONTENT_OPT,
XML_ELEMENT_CONTENT_MULT,
XML_ELEMENT_CONTENT_PLUS
} xmlElementContentOccur;
/**
* xmlElementContent:<br>
* * An XML Element content as stored after parsing an element definition<br>
* in a DTD.
*/
typedef struct _xmlElementContent xmlElementContent;
typedef xmlElementContent *xmlElementContentPtr;
struct _xmlElementContent {
xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */
xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */
const xmlChar *name; /* Element name */
struct _xmlElementContent *c1; /* first child */
struct _xmlElementContent *c2; /* second child */
struct _xmlElementContent *parent; /* parent */
const xmlChar *prefix; /* Namespace prefix */
};
/**
* xmlElementTypeVal:<br>
* * The different possibilities for an element content type.
*/
typedef enum {
XML_ELEMENT_TYPE_UNDEFINED = 0,
XML_ELEMENT_TYPE_EMPTY = 1,
XML_ELEMENT_TYPE_ANY,
XML_ELEMENT_TYPE_MIXED,
XML_ELEMENT_TYPE_ELEMENT
} xmlElementTypeVal;
}
extern ""C"" {
/**
* xmlRegexpPtr:<br>
* * A libxml regular expression, they can actually be far more complex<br>
* thank the POSIX regex expressions.
*/
typedef struct _xmlRegexp xmlRegexp;
typedef xmlRegexp *xmlRegexpPtr;
/**
* xmlRegExecCtxtPtr:<br>
* * A libxml progressive regular expression evaluation context
*/
typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
}
extern ""C"" {
/** The dictionnary. */
typedef struct _xmlDict xmlDict;
typedef xmlDict *xmlDictPtr;
/** Constructor and destructor. */
xmlDictPtr xmlDictCreate();
xmlDictPtr xmlDictCreateSub(xmlDictPtr sub);
int xmlDictReference(xmlDictPtr dict);
void xmlDictFree(xmlDictPtr dict);
/** Lookup of entry in the dictionnary. */
const xmlChar* xmlDictLookup(xmlDictPtr dict, const xmlChar* name, int len);
const xmlChar* xmlDictExists(xmlDictPtr dict, const xmlChar* name, int len);
const xmlChar* xmlDictQLookup(xmlDictPtr dict, const xmlChar* prefix, const xmlChar* name);
int xmlDictOwns(xmlDictPtr dict, const xmlChar* str);
int xmlDictSize(xmlDictPtr dict);
/** Cleanup function */
void xmlDictCleanup();
}
extern ""C"" {
/** The POSIX like API */
xmlRegexpPtr xmlRegexpCompile(const xmlChar* regexp);
void xmlRegFreeRegexp(xmlRegexpPtr regexp);
int xmlRegexpExec(xmlRegexpPtr comp, const xmlChar* value);
void xmlRegexpPrint(FILE* output, xmlRegexpPtr regexp);
int xmlRegexpIsDeterminist(xmlRegexpPtr comp);
/**
* xmlRegExecCallbacks:<br>
* @exec: the regular expression context<br>
* @token: the current token string<br>
* @transdata: transition data<br>
* @inputdata: input data<br>
* * Callback function when doing a transition in the automata
*/
typedef void (*xmlRegExecCallbacks)(xmlRegExecCtxtPtr exec, const xmlChar* token, void* transdata, void* inputdata);
/** The progressive API */
xmlRegExecCtxtPtr xmlRegNewExecCtxt(xmlRegexpPtr comp, xmlRegExecCallbacks callback, void* data);
void xmlRegFreeExecCtxt(xmlRegExecCtxtPtr exec);
int xmlRegExecPushString(xmlRegExecCtxtPtr exec, const xmlChar* value, void* data);
int xmlRegExecPushString2(xmlRegExecCtxtPtr exec, const xmlChar* value, const xmlChar* value2, void* data);
int xmlRegExecNextValues(xmlRegExecCtxtPtr exec, int* nbval, int* nbneg, xmlChar** values, int* terminal);
int xmlRegExecErrInfo(xmlRegExecCtxtPtr exec, const xmlChar** string, int* nbval, int* nbneg, xmlChar** values, int* terminal);
/** expressions are used within a context */
typedef struct _xmlExpCtxt xmlExpCtxt;
typedef xmlExpCtxt *xmlExpCtxtPtr;
void xmlExpFreeCtxt(xmlExpCtxtPtr ctxt);
xmlExpCtxtPtr xmlExpNewCtxt(int maxNodes, xmlDictPtr dict);
int xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
int xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
/** Expressions are trees but the tree is opaque */
typedef struct _xmlExpNode xmlExpNode;
typedef xmlExpNode *xmlExpNodePtr;
typedef enum {
XML_EXP_EMPTY = 0,
XML_EXP_FORBID = 1,
XML_EXP_ATOM = 2,
XML_EXP_SEQ = 3,
XML_EXP_OR = 4,
XML_EXP_COUNT = 5
} xmlExpNodeType;
/**
* 2 core expressions shared by all for the empty language set<br>
* and for the set with just the empty token
*/
extern xmlExpNodePtr forbiddenExp;
extern xmlExpNodePtr emptyExp;
/** Expressions are reference counted internally */
void xmlExpFree(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr);
void xmlExpRef(xmlExpNodePtr expr);
/** constructors can be either manual or from a string */
xmlExpNodePtr xmlExpParse(xmlExpCtxtPtr ctxt, const char* expr);
xmlExpNodePtr xmlExpNewAtom(xmlExpCtxtPtr ctxt, const xmlChar* name, int len);
xmlExpNodePtr xmlExpNewOr(xmlExpCtxtPtr ctxt, xmlExpNodePtr left, xmlExpNodePtr right);
xmlExpNodePtr xmlExpNewSeq(xmlExpCtxtPtr ctxt, xmlExpNodePtr left, xmlExpNodePtr right);
xmlExpNodePtr xmlExpNewRange(xmlExpCtxtPtr ctxt, xmlExpNodePtr subset, int min, int max);
/** The really interesting APIs */
int xmlExpIsNillable(xmlExpNodePtr expr);
int xmlExpMaxToken(xmlExpNodePtr expr);
int xmlExpGetLanguage(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const xmlChar** langList, int len);
int xmlExpGetStart(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const xmlChar** tokList, int len);
xmlExpNodePtr xmlExpStringDerive(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const xmlChar* str, int len);
xmlExpNodePtr xmlExpExpDerive(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, xmlExpNodePtr sub);
int xmlExpSubsume(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, xmlExpNodePtr sub);
void xmlExpDump(xmlBufferPtr buf, xmlExpNodePtr expr);
}
extern ""C"" {
/**
* xmlElement:<br>
* * An XML Element declaration from a DTD.
*/
typedef struct _xmlElement xmlElement;
typedef xmlElement *xmlElementPtr;
struct _xmlElement {
void *_private; /* application data */
xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */
const xmlChar *name; /* Element name */
struct _xmlNode *children; /* NULL */
struct _xmlNode *last; /* NULL */
struct _xmlDtd *parent; /* -> DTD */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
xmlElementTypeVal etype; /* The type */
xmlElementContentPtr content; /* the allowed element content */
xmlAttributePtr attributes; /* List of the declared attributes */
const xmlChar *prefix; /* the namespace prefix if any */
xmlRegexpPtr contModel; /* the validating regexp */
};
/**
* XML_LOCAL_NAMESPACE:<br>
* * A namespace declaration node.
*/
typedef xmlElementType xmlNsType;
/**
* xmlNs:<br>
* * An XML namespace.<br>
* Note that prefix == NULL is valid, it defines the default namespace<br>
* within the subtree (until overridden).<br>
* * xmlNsType is unified with xmlElementType.
*/
typedef struct _xmlNs xmlNs;
typedef xmlNs *xmlNsPtr;
struct _xmlNs {
struct _xmlNs *next; /* next Ns link for this node */
xmlNsType type; /* global or local */
const xmlChar *href; /* URL for the namespace */
const xmlChar *prefix; /* prefix for the namespace */
void *_private; /* application data */
struct _xmlDoc *context; /* normally an xmlDoc */
};
/**
* xmlDtd:<br>
* * An XML DTD, as defined by <!DOCTYPE ... There is actually one for<br>
* the internal subset and for the external subset.
*/
typedef struct _xmlDtd xmlDtd;
typedef xmlDtd *xmlDtdPtr;
struct _xmlDtd {
void *_private; /* application data */
xmlElementType type; /* XML_DTD_NODE, must be second ! */
const xmlChar *name; /* Name of the DTD */
struct _xmlNode *children; /* the value of the property link */
struct _xmlNode *last; /* last child link */
struct _xmlDoc *parent; /* child->parent link */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
void *notations; /* Hash table for notations if any */
void *elements; /* Hash table for elements if any */
void *attributes; /* Hash table for attributes if any */
void *entities; /* Hash table for entities if any */
const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
void *pentities; /* Hash table for param entities if any */
};
/**
* xmlAttr:<br>
* * An attribute on an XML node.
*/
typedef struct _xmlAttr xmlAttr;
typedef xmlAttr *xmlAttrPtr;
struct _xmlAttr {
void *_private; /* application data */
xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */
const xmlChar *name; /* the name of the property */
struct _xmlNode *children; /* the value of the property */
struct _xmlNode *last; /* NULL */
struct _xmlNode *parent; /* child->parent link */
struct _xmlAttr *next; /* next sibling link */
struct _xmlAttr *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
xmlNs *ns; /* pointer to the associated namespace */
xmlAttributeType atype; /* the attribute type if validating */
void *psvi; /* for type/PSVI informations */
};
/**
* xmlID:<br>
* * An XML ID instance.
*/
typedef struct _xmlID xmlID;
typedef xmlID *xmlIDPtr;
struct _xmlID {
struct _xmlID *next; /* next ID */
const xmlChar *value; /* The ID name */
xmlAttrPtr attr; /* The attribute holding it */
const xmlChar *name; /* The attribute if attr is not available */
int lineno; /* The line number if attr is not available */
struct _xmlDoc *doc; /* The document holding the ID */
};
/**
* xmlRef:<br>
* * An XML IDREF instance.
*/
typedef struct _xmlRef xmlRef;
typedef xmlRef *xmlRefPtr;
struct _xmlRef {
struct _xmlRef *next; /* next Ref */
const xmlChar *value; /* The Ref name */
xmlAttrPtr attr; /* The attribute holding it */
const xmlChar *name; /* The attribute if attr is not available */
int lineno; /* The line number if attr is not available */
};
/**
* xmlNode:<br>
* * A node in an XML tree.
*/
typedef struct _xmlNode xmlNode;
typedef xmlNode *xmlNodePtr;
struct _xmlNode {
void *_private; /* application data */
xmlElementType type; /* type number, must be second ! */
const xmlChar *name; /* the name of the node, or the entity */
struct _xmlNode *children; /* parent->childs link */
struct _xmlNode *last; /* last child link */
struct _xmlNode *parent; /* child->parent link */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* the containing document */
xmlNs *ns; /* pointer to the associated namespace */
xmlChar *content; /* the content */
struct _xmlAttr *properties; /* properties list */
xmlNs *nsDef; /* namespace definitions on this node */
void *psvi; /* for type/PSVI informations */
unsigned short line; /* line number */
unsigned short extra; /* extra data for XPath/XSLT */
};
/**
* xmlDocProperty<br>
* * Set of properties of the document as found by the parser<br>
* Some of them are linked to similary named xmlParserOption
*/
typedef enum {
XML_DOC_WELLFORMED = 1 << 0 /* document is XML well formed */,
XML_DOC_NSVALID = 1 << 1 /* document is Namespace valid */,
XML_DOC_OLD10 = 1 << 2 /* parsed with old XML-1.0 parser */,
XML_DOC_DTDVALID = 1 << 3 /* DTD validation was successful */,
XML_DOC_XINCLUDE = 1 << 4 /* XInclude substitution was done */,
XML_DOC_USERBUILT = 1 << 5 /* Document was built using the API
and not by parsing an instance */,
XML_DOC_INTERNAL = 1 << 6 /* built for internal processing */,
XML_DOC_HTML = 1 << 7 /* parsed or built HTML document */
} xmlDocProperties;
/**
* xmlDoc:<br>
* * An XML document.
*/
typedef struct _xmlDoc xmlDoc;
typedef xmlDoc *xmlDocPtr;
struct _xmlDoc {
void *_private; /* application data */
xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */
char *name; /* name/filename/URI of the document */
struct _xmlNode *children; /* the document tree */
struct _xmlNode *last; /* last child link */
struct _xmlNode *parent; /* child->parent link */
struct _xmlNode *next; /* next sibling link */
struct _xmlNode *prev; /* previous sibling link */
struct _xmlDoc *doc; /* autoreference to itself */
int compression; /* level of zlib compression */
int standalone; /* standalone document (no external refs)
1 if standalone="yes"
0 if standalone="no"
-1 if there is no XML declaration
-2 if there is an XML declaration, but no
standalone attribute was specified */
struct _xmlDtd *intSubset; /* the document internal subset */
struct _xmlDtd *extSubset; /* the document external subset */
struct _xmlNs *oldNs; /* Global namespace, the old way */
const xmlChar *version; /* the XML version string */
const xmlChar *encoding; /* external initial encoding, if any */
void *ids; /* Hash table for ID attributes if any */
void *refs; /* Hash table for IDREFs attributes if any */
const xmlChar *URL; /* The URI for that document */
int charset; /* encoding of the in-memory content
actually an xmlCharEncoding */
struct _xmlDict *dict; /* dict used to allocate names or NULL */
void *psvi; /* for type/PSVI informations */
int parseFlags; /* set of xmlParserOption used to parse the
document */
int properties; /* set of xmlDocProperties for this document
set at the end of parsing */
};
typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt;
typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
/**
* xmlDOMWrapAcquireNsFunction:<br>
* @ctxt: a DOM wrapper context<br>
* @node: the context node (element or attribute) <br>
* @nsName: the requested namespace name<br>
* @nsPrefix: the requested namespace prefix <br>
* * A function called to acquire namespaces (xmlNs) from the wrapper.<br>
* * Returns an xmlNsPtr or NULL in case of an error.
*/
typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction)(xmlDOMWrapCtxtPtr ctxt, xmlNodePtr node, const xmlChar* nsName, const xmlChar* nsPrefix);
/**
* xmlDOMWrapCtxt:<br>
* * Context for DOM wrapper-operations.
*/
struct _xmlDOMWrapCtxt {
void *_private;
int type;
void *namespaceMap;
xmlDOMWrapAcquireNsFunction getNsForNodeFunc;
};
/** Some helper functions */
int xmlValidateNCName(const xmlChar* value, int space);
int xmlValidateQName(const xmlChar* value, int space);
int xmlValidateName(const xmlChar* value, int space);
int xmlValidateNMToken(const xmlChar* value, int space);
xmlChar* xmlBuildQName(const xmlChar* ncname, const xmlChar* prefix, xmlChar* memory, int len);
xmlChar* xmlSplitQName2(const xmlChar* name, xmlChar** prefix);
const xmlChar* xmlSplitQName3(const xmlChar* name, int* len);
/** Handling Buffers. */
void xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
xmlBufferAllocationScheme xmlGetBufferAllocationScheme();
xmlBufferPtr xmlBufferCreate();
xmlBufferPtr xmlBufferCreateSize(size_t size);
xmlBufferPtr xmlBufferCreateStatic(void* mem, size_t size);
int xmlBufferResize(xmlBufferPtr buf, unsigned int size);
void xmlBufferFree(xmlBufferPtr buf);
int xmlBufferDump(FILE* file, xmlBufferPtr buf);
int xmlBufferAdd(xmlBufferPtr buf, const xmlChar* str, int len);
int xmlBufferAddHead(xmlBufferPtr buf, const xmlChar* str, int len);
int xmlBufferCat(xmlBufferPtr buf, const xmlChar* str);
int xmlBufferCCat(xmlBufferPtr buf, const char* str);
int xmlBufferShrink(xmlBufferPtr buf, unsigned int len);
int xmlBufferGrow(xmlBufferPtr buf, unsigned int len);
void xmlBufferEmpty(xmlBufferPtr buf);
const xmlChar* xmlBufferContent(const xmlBufferPtr buf);
void xmlBufferSetAllocationScheme(xmlBufferPtr buf, xmlBufferAllocationScheme scheme);
int xmlBufferLength(const xmlBufferPtr buf);
/** Creating/freeing new structures. */
xmlDtdPtr xmlCreateIntSubset(xmlDocPtr doc, const xmlChar* name, const xmlChar* ExternalID, const xmlChar* SystemID);
xmlDtdPtr xmlNewDtd(xmlDocPtr doc, const xmlChar* name, const xmlChar* ExternalID, const xmlChar* SystemID);
xmlDtdPtr xmlGetIntSubset(xmlDocPtr doc);
void xmlFreeDtd(xmlDtdPtr cur);
xmlNsPtr xmlNewGlobalNs(xmlDocPtr doc, const xmlChar* href, const xmlChar* prefix);
xmlNsPtr xmlNewNs(xmlNodePtr node, const xmlChar* href, const xmlChar* prefix);
void xmlFreeNs(xmlNsPtr cur);
void xmlFreeNsList(xmlNsPtr cur);
xmlDocPtr xmlNewDoc(const xmlChar* version);
void xmlFreeDoc(xmlDocPtr cur);
xmlAttrPtr xmlNewDocProp(xmlDocPtr doc, const xmlChar* name, const xmlChar* value);
xmlAttrPtr xmlNewProp(xmlNodePtr node, const xmlChar* name, const xmlChar* value);
xmlAttrPtr xmlNewNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar* name, const xmlChar* value);
xmlAttrPtr xmlNewNsPropEatName(xmlNodePtr node, xmlNsPtr ns, xmlChar* name, const xmlChar* value);
void xmlFreePropList(xmlAttrPtr cur);
void xmlFreeProp(xmlAttrPtr cur);
xmlAttrPtr xmlCopyProp(xmlNodePtr target, xmlAttrPtr cur);
xmlAttrPtr xmlCopyPropList(xmlNodePtr target, xmlAttrPtr cur);
xmlDtdPtr xmlCopyDtd(xmlDtdPtr dtd);
xmlDocPtr xmlCopyDoc(xmlDocPtr doc, int recursive);
/** Creating new nodes. */
xmlNodePtr xmlNewDocNode(xmlDocPtr doc, xmlNsPtr ns, const xmlChar* name, const xmlChar* content);
xmlNodePtr xmlNewDocNodeEatName(xmlDocPtr doc, xmlNsPtr ns, xmlChar* name, const xmlChar* content);
xmlNodePtr xmlNewNode(xmlNsPtr ns, const xmlChar* name);
xmlNodePtr xmlNewNodeEatName(xmlNsPtr ns, xmlChar* name);
xmlNodePtr xmlNewChild(xmlNodePtr parent, xmlNsPtr ns, const xmlChar* name, const xmlChar* content);
xmlNodePtr xmlNewDocText(xmlDocPtr doc, const xmlChar* content);
xmlNodePtr xmlNewText(const xmlChar* content);
xmlNodePtr xmlNewDocPI(xmlDocPtr doc, const xmlChar* name, const xmlChar* content);
xmlNodePtr xmlNewPI(const xmlChar* name, const xmlChar* content);
xmlNodePtr xmlNewDocTextLen(xmlDocPtr doc, const xmlChar* content, int len);
xmlNodePtr xmlNewTextLen(const xmlChar* content, int len);
xmlNodePtr xmlNewDocComment(xmlDocPtr doc, const xmlChar* content);
xmlNodePtr xmlNewComment(const xmlChar* content);
xmlNodePtr xmlNewCDataBlock(xmlDocPtr doc, const xmlChar* content, int len);
xmlNodePtr xmlNewCharRef(xmlDocPtr doc, const xmlChar* name);
xmlNodePtr xmlNewReference(xmlDocPtr doc, const xmlChar* name);
xmlNodePtr xmlCopyNode(const xmlNodePtr node, int recursive);
xmlNodePtr xmlDocCopyNode(const xmlNodePtr node, xmlDocPtr doc, int recursive);
xmlNodePtr xmlDocCopyNodeList(xmlDocPtr doc, const xmlNodePtr node);
xmlNodePtr xmlCopyNodeList(const xmlNodePtr node);
xmlNodePtr xmlNewTextChild(xmlNodePtr parent, xmlNsPtr ns, const xmlChar* name, const xmlChar* content);
xmlNodePtr xmlNewDocRawNode(xmlDocPtr doc, xmlNsPtr ns, const xmlChar* name, const xmlChar* content);
xmlNodePtr xmlNewDocFragment(xmlDocPtr doc);
/** Navigating. */
long xmlGetLineNo(xmlNodePtr node);
xmlChar* xmlGetNodePath(xmlNodePtr node);
xmlNodePtr xmlDocGetRootElement(xmlDocPtr doc);
xmlNodePtr xmlGetLastChild(xmlNodePtr parent);
int xmlNodeIsText(xmlNodePtr node);
int xmlIsBlankNode(xmlNodePtr node);
/** Changing the structure. */
xmlNodePtr xmlDocSetRootElement(xmlDocPtr doc, xmlNodePtr root);
void xmlNodeSetName(xmlNodePtr cur, const xmlChar* name);
xmlNodePtr xmlAddChild(xmlNodePtr parent, xmlNodePtr cur);
xmlNodePtr xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur);
xmlNodePtr xmlReplaceNode(xmlNodePtr old, xmlNodePtr cur);
xmlNodePtr xmlAddPrevSibling(xmlNodePtr cur, xmlNodePtr elem);
xmlNodePtr xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem);
xmlNodePtr xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem);
void xmlUnlinkNode(xmlNodePtr cur);
xmlNodePtr xmlTextMerge(xmlNodePtr first, xmlNodePtr second);
int xmlTextConcat(xmlNodePtr node, const xmlChar* content, int len);
void xmlFreeNodeList(xmlNodePtr cur);
void xmlFreeNode(xmlNodePtr cur);
void xmlSetTreeDoc(xmlNodePtr tree, xmlDocPtr doc);
void xmlSetListDoc(xmlNodePtr list, xmlDocPtr doc);
/** Namespaces. */
xmlNsPtr xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar* nameSpace);
xmlNsPtr xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar* href);
xmlNsPtr* xmlGetNsList(xmlDocPtr doc, xmlNodePtr node);
void xmlSetNs(xmlNodePtr node, xmlNsPtr ns);
xmlNsPtr xmlCopyNamespace(xmlNsPtr cur);
xmlNsPtr xmlCopyNamespaceList(xmlNsPtr cur);
/** Changing the content. */
xmlAttrPtr xmlSetProp(xmlNodePtr node, const xmlChar* name, const xmlChar* value);
xmlAttrPtr xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar* name, const xmlChar* value);
xmlChar* xmlGetNoNsProp(xmlNodePtr node, const xmlChar* name);
xmlChar* xmlGetProp(xmlNodePtr node, const xmlChar* name);
xmlAttrPtr xmlHasProp(xmlNodePtr node, const xmlChar* name);
xmlAttrPtr xmlHasNsProp(xmlNodePtr node, const xmlChar* name, const xmlChar* nameSpace);
xmlChar* xmlGetNsProp(xmlNodePtr node, const xmlChar* name, const xmlChar* nameSpace);
xmlNodePtr xmlStringGetNodeList(xmlDocPtr doc, const xmlChar* value);
xmlNodePtr xmlStringLenGetNodeList(xmlDocPtr doc, const xmlChar* value, int len);
xmlChar* xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine);
xmlChar* xmlNodeListGetRawString(xmlDocPtr doc, xmlNodePtr list, int inLine);
void xmlNodeSetContent(xmlNodePtr cur, const xmlChar* content);
void xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar* content, int len);
void xmlNodeAddContent(xmlNodePtr cur, const xmlChar* content);
void xmlNodeAddContentLen(xmlNodePtr cur, const xmlChar* content, int len);
xmlChar* xmlNodeGetContent(xmlNodePtr cur);
int xmlNodeBufGetContent(xmlBufferPtr buffer, xmlNodePtr cur);
xmlChar* xmlNodeGetLang(xmlNodePtr cur);
int xmlNodeGetSpacePreserve(xmlNodePtr cur);
void xmlNodeSetLang(xmlNodePtr cur, const xmlChar* lang);
void xmlNodeSetSpacePreserve(xmlNodePtr cur, int val);
xmlChar* xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur);
void xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri);
/** Removing content. */
int xmlRemoveProp(xmlAttrPtr cur);
int xmlUnsetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar* name);
int xmlUnsetProp(xmlNodePtr node, const xmlChar* name);
/** Internal, don't use. */
void xmlBufferWriteCHAR(xmlBufferPtr buf, const xmlChar* string);
void xmlBufferWriteChar(xmlBufferPtr buf, const char* string);
void xmlBufferWriteQuotedString(xmlBufferPtr buf, const xmlChar* string);
void xmlAttrSerializeTxtContent(xmlBufferPtr buf, xmlDocPtr doc, xmlAttrPtr attr, const xmlChar* string);
/** Namespace handling. */
int xmlReconciliateNs(xmlDocPtr doc, xmlNodePtr tree);
/** Saving. */
void xmlDocDumpFormatMemory(xmlDocPtr cur, xmlChar** mem, int* size, int format);
void xmlDocDumpMemory(xmlDocPtr cur, xmlChar** mem, int* size);
void xmlDocDumpMemoryEnc(xmlDocPtr out_doc, xmlChar** doc_txt_ptr, int* doc_txt_len, const char* txt_encoding);
void xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, xmlChar** doc_txt_ptr, int* doc_txt_len, const char* txt_encoding, int format);
int xmlDocFormatDump(FILE* f, xmlDocPtr cur, int format);
int xmlDocDump(FILE* f, xmlDocPtr cur);
void xmlElemDump(FILE* f, xmlDocPtr doc, xmlNodePtr cur);
int xmlSaveFile(const char* filename, xmlDocPtr cur);
int xmlSaveFormatFile(const char* filename, xmlDocPtr cur, int format);
int xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, int format);
int xmlSaveFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char* encoding);
int xmlSaveFormatFileTo(xmlOutputBufferPtr buf, xmlDocPtr cur, const char* encoding, int format);
void xmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, int format, const char* encoding);
int xmlSaveFormatFileEnc(const char* filename, xmlDocPtr cur, const char* encoding, int format);
int xmlSaveFileEnc(const char* filename, xmlDocPtr cur, const char* encoding);
/** XHTML */
int xmlIsXHTML(const xmlChar* systemID, const xmlChar* publicID);
/** Compression. */
int xmlGetDocCompressMode(xmlDocPtr doc);
void xmlSetDocCompressMode(xmlDocPtr doc, int mode);
int xmlGetCompressMode();
void xmlSetCompressMode(int mode);
/** DOM-wrapper helper functions. */
xmlDOMWrapCtxtPtr xmlDOMWrapNewCtxt();
void xmlDOMWrapFreeCtxt(xmlDOMWrapCtxtPtr ctxt);
int xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt, xmlNodePtr elem, int options);
int xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr sourceDoc, xmlNodePtr node, xmlDocPtr destDoc, xmlNodePtr destParent, int options);
int xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr node, int options);
int xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr sourceDoc, xmlNodePtr node, xmlNodePtr* clonedNode, xmlDocPtr destDoc, xmlNodePtr destParent, int deep, int options);
/**
* 5 interfaces from DOM ElementTraversal, but different in entities<br>
* traversal.
*/
unsigned long xmlChildElementCount(xmlNodePtr parent);
xmlNodePtr xmlNextElementSibling(xmlNodePtr node);
xmlNodePtr xmlFirstElementChild(xmlNodePtr parent);
xmlNodePtr xmlLastElementChild(xmlNodePtr parent);
xmlNodePtr xmlPreviousElementSibling(xmlNodePtr node);
}
extern ""C"" {
/**
* xmlFreeFunc:<br>
* @mem: an already allocated block of memory<br>
* * Signature for a free() implementation.
*/
typedef void (*xmlFreeFunc)(void* mem);
/**
* xmlMallocFunc:<br>
* @size: the size requested in bytes<br>
* * Signature for a malloc() implementation.<br>
* * Returns a pointer to the newly allocated block or NULL in case of error.
*/
typedef void *(*xmlMallocFunc)(size_t size);
/**
* xmlReallocFunc:<br>
* @mem: an already allocated block of memory<br>
* @size: the new size requested in bytes<br>
* * Signature for a realloc() implementation.<br>
* * Returns a pointer to the newly reallocated block or NULL in case of error.
*/
typedef void *(*xmlReallocFunc)(void* mem, size_t size);
/**
* xmlStrdupFunc:<br>
* @str: a zero terminated string<br>
* * Signature for an strdup() implementation.<br>
* * Returns the copy of the string or NULL in case of error.
*/
typedef char *(*xmlStrdupFunc)(const char* str);
/**
* The way to overload the existing functions.<br>
* The xmlGc function have an extra entry for atomic block<br>
* allocations useful for garbage collected memory allocators
*/
int xmlMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc);
int xmlMemGet(xmlFreeFunc* freeFunc, xmlMallocFunc* mallocFunc, xmlReallocFunc* reallocFunc, xmlStrdupFunc* strdupFunc);
int xmlGcMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc, xmlMallocFunc mallocAtomicFunc, xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc);
int xmlGcMemGet(xmlFreeFunc* freeFunc, xmlMallocFunc* mallocFunc, xmlMallocFunc* mallocAtomicFunc, xmlReallocFunc* reallocFunc, xmlStrdupFunc* strdupFunc);
/** Initialization of the memory layer. */
int xmlInitMemory();
/** Cleanup of the memory layer. */
void xmlCleanupMemory();
/** These are specific to the XML debug memory wrapper. */
int xmlMemUsed();
int xmlMemBlocks();
void xmlMemDisplay(FILE* fp);
void xmlMemDisplayLast(FILE* fp, long nbBytes);
void xmlMemShow(FILE* fp, int nr);
void xmlMemoryDump();
void* xmlMemMalloc(size_t size);
void* xmlMemRealloc(void* ptr, size_t size);
void xmlMemFree(void* ptr);
char* xmlMemoryStrdup(const char* str);
void* xmlMallocLoc(size_t size, const char* file, int line);
void* xmlReallocLoc(void* ptr, size_t size, const char* file, int line);
void* xmlMallocAtomicLoc(size_t size, const char* file, int line);
char* xmlMemStrdupLoc(const char* str, const char* file, int line);
}
extern ""C"" {
/** xmlMutex are a simple mutual exception locks. */
typedef struct _xmlMutex xmlMutex;
typedef xmlMutex *xmlMutexPtr;
/** xmlRMutex are reentrant mutual exception locks. */
typedef struct _xmlRMutex xmlRMutex;
typedef xmlRMutex *xmlRMutexPtr;
}
extern ""C"" {
/** The hash table. */
typedef struct _xmlHashTable xmlHashTable;
typedef xmlHashTable *xmlHashTablePtr;
}
extern ""C"" {
/**
* xmlHashDeallocator:<br>
* @payload: the data in the hash<br>
* @name: the name associated<br>
* * Callback to free data from a hash.
*/
typedef void (*xmlHashDeallocator)(void* payload, xmlChar* name);
/**
* xmlHashCopier:<br>
* @payload: the data in the hash<br>
* @name: the name associated<br>
* * Callback to copy data from a hash.<br>
* * Returns a copy of the data or NULL in case of error.
*/
typedef void *(*xmlHashCopier)(void* payload, xmlChar* name);
/**
* xmlHashScanner:<br>
* @payload: the data in the hash<br>