20#ifdef LIBXML_WRITER_ENABLED
39 #define VA_COPY(dest, src) va_copy(dest, src)
42 #define VA_COPY(dest,src) __va_copy(dest, src)
44 #ifndef VA_LIST_IS_ARRAY
45 #define VA_COPY(dest,src) (dest) = (src)
48 #define VA_COPY(dest,src) memcpy((char *)(dest),(char *)(src),sizeof(va_list))
58 XML_TEXTWRITER_NONE = 0,
60 XML_TEXTWRITER_ATTRIBUTE,
63 XML_TEXTWRITER_PI_TEXT,
66 XML_TEXTWRITER_DTD_TEXT,
67 XML_TEXTWRITER_DTD_ELEM,
68 XML_TEXTWRITER_DTD_ELEM_TEXT,
69 XML_TEXTWRITER_DTD_ATTL,
70 XML_TEXTWRITER_DTD_ATTL_TEXT,
71 XML_TEXTWRITER_DTD_ENTY,
72 XML_TEXTWRITER_DTD_ENTY_TEXT,
73 XML_TEXTWRITER_DTD_PENT,
74 XML_TEXTWRITER_COMMENT
77typedef struct _xmlTextWriterStackEntry xmlTextWriterStackEntry;
79struct _xmlTextWriterStackEntry {
81 xmlTextWriterState
state;
84typedef struct _xmlTextWriterNsStackEntry xmlTextWriterNsStackEntry;
85struct _xmlTextWriterNsStackEntry {
91struct _xmlTextWriter {
105static void xmlFreeTextWriterStackEntry(
xmlLinkPtr lk);
106static int xmlCmpTextWriterStackEntry(
const void *data0,
108static int xmlTextWriterOutputNSDecl(xmlTextWriterPtr writer);
109static void xmlFreeTextWriterNsStackEntry(
xmlLinkPtr lk);
110static int xmlCmpTextWriterNsStackEntry(
const void *data0,
112static int xmlTextWriterWriteDocCallback(
void *
context,
113 const char *
str,
int len);
114static int xmlTextWriterCloseDocCallback(
void *
context);
118 const unsigned char *
data);
119static void xmlTextWriterStartDocumentCallback(
void *
ctx);
120static int xmlTextWriterWriteIndent(xmlTextWriterPtr writer);
122 xmlTextWriterHandleStateDependencies(xmlTextWriterPtr writer,
123 xmlTextWriterStackEntry *
p);
183 xmlTextWriterPtr
ret;
185 ret = (xmlTextWriterPtr)
xmlMalloc(
sizeof(xmlTextWriter));
188 "xmlNewTextWriter : out of memory!\n");
191 memset(
ret, 0, (
size_t)
sizeof(xmlTextWriter));
194 xmlCmpTextWriterStackEntry);
197 "xmlNewTextWriter : out of memory!\n");
203 xmlCmpTextWriterNsStackEntry);
206 "xmlNewTextWriter : out of memory!\n");
221 "xmlNewTextWriter : out of memory!\n");
227 ret->no_doc_free = 0;
244 xmlTextWriterPtr
ret;
250 "xmlNewTextWriterFilename : cannot open uri\n");
254 ret = xmlNewTextWriter(
out);
257 "xmlNewTextWriterFilename : out of memory!\n");
258 xmlOutputBufferClose(
out);
280 xmlTextWriterPtr
ret;
288 "xmlNewTextWriterMemory : out of memory!\n");
292 ret = xmlNewTextWriter(
out);
295 "xmlNewTextWriterMemory : out of memory!\n");
296 xmlOutputBufferClose(
out);
319 xmlTextWriterPtr
ret;
324 "xmlNewTextWriterPushParser : invalid context!\n");
328 out = xmlOutputBufferCreateIO(xmlTextWriterWriteDocCallback,
329 xmlTextWriterCloseDocCallback,
330 (
void *) ctxt,
NULL);
333 "xmlNewTextWriterPushParser : error at xmlOutputBufferCreateIO!\n");
337 ret = xmlNewTextWriter(
out);
340 "xmlNewTextWriterPushParser : error at xmlNewTextWriter!\n");
341 xmlOutputBufferClose(
out);
362 xmlTextWriterPtr
ret;
366 memset(&saxHandler,
'\0',
sizeof(saxHandler));
368 saxHandler.
startDocument = xmlTextWriterStartDocumentCallback;
372 ctxt = xmlCreatePushParserCtxt(&saxHandler,
NULL,
NULL, 0,
NULL);
375 "xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
388 "xmlNewTextWriterDoc : error at xmlNewDoc!\n");
397 "xmlNewTextWriterDoc : error at xmlNewTextWriterPushParser!\n");
405 ret->no_doc_free = 1;
425 xmlTextWriterPtr
ret;
431 "xmlNewTextWriterTree : invalid document tree!\n");
435 memset(&saxHandler,
'\0',
sizeof(saxHandler));
437 saxHandler.
startDocument = xmlTextWriterStartDocumentCallback;
441 ctxt = xmlCreatePushParserCtxt(&saxHandler,
NULL,
NULL, 0,
NULL);
444 "xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
457 "xmlNewTextWriterDoc : error at xmlNewTextWriterPushParser!\n");
463 ret->no_doc_free = 1;
477xmlFreeTextWriter(xmlTextWriterPtr writer)
482 if (writer->out !=
NULL)
483 xmlOutputBufferClose(writer->out);
485 if (writer->nodes !=
NULL)
488 if (writer->nsstack !=
NULL)
491 if (writer->ctxt !=
NULL) {
492 if ((writer->ctxt->myDoc !=
NULL) && (writer->no_doc_free == 0)) {
494 writer->ctxt->myDoc =
NULL;
499 if (writer->doc !=
NULL)
502 if (writer->ichar !=
NULL)
519xmlTextWriterStartDocument(xmlTextWriterPtr writer,
const char *
version,
520 const char *
encoding,
const char *standalone)
527 if ((writer ==
NULL) || (writer->out ==
NULL)) {
529 "xmlTextWriterStartDocument : invalid writer!\n");
536 "xmlTextWriterStartDocument : not allowed in this context!\n");
543 if (encoder ==
NULL) {
545 "xmlTextWriterStartDocument : unsupported encoding\n");
550 writer->out->encoder = encoder;
551 if (encoder !=
NULL) {
552 if (writer->out->conv ==
NULL) {
556 if ((writer->doc !=
NULL) && (writer->doc->encoding ==
NULL))
559 writer->out->conv =
NULL;
562 count = xmlOutputBufferWriteString(writer->out,
"<?xml version=");
566 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
571 count = xmlOutputBufferWriteString(writer->out,
version);
573 count = xmlOutputBufferWriteString(writer->out,
"1.0");
577 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
581 if (writer->out->encoder != 0) {
582 count = xmlOutputBufferWriteString(writer->out,
" encoding=");
586 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
591 xmlOutputBufferWriteString(writer->out,
592 writer->out->encoder->name);
596 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
602 if (standalone != 0) {
603 count = xmlOutputBufferWriteString(writer->out,
" standalone=");
607 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
611 count = xmlOutputBufferWriteString(writer->out, standalone);
615 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
621 count = xmlOutputBufferWriteString(writer->out,
"?>\n");
639xmlTextWriterEndDocument(xmlTextWriterPtr writer)
644 xmlTextWriterStackEntry *
p;
646 if (writer ==
NULL) {
648 "xmlTextWriterEndDocument : invalid writer!\n");
658 case XML_TEXTWRITER_NAME:
659 case XML_TEXTWRITER_ATTRIBUTE:
660 case XML_TEXTWRITER_TEXT:
661 count = xmlTextWriterEndElement(writer);
666 case XML_TEXTWRITER_PI:
667 case XML_TEXTWRITER_PI_TEXT:
668 count = xmlTextWriterEndPI(writer);
673 case XML_TEXTWRITER_CDATA:
674 count = xmlTextWriterEndCDATA(writer);
679 case XML_TEXTWRITER_DTD:
680 case XML_TEXTWRITER_DTD_TEXT:
681 case XML_TEXTWRITER_DTD_ELEM:
682 case XML_TEXTWRITER_DTD_ELEM_TEXT:
683 case XML_TEXTWRITER_DTD_ATTL:
684 case XML_TEXTWRITER_DTD_ATTL_TEXT:
685 case XML_TEXTWRITER_DTD_ENTY:
686 case XML_TEXTWRITER_DTD_ENTY_TEXT:
687 case XML_TEXTWRITER_DTD_PENT:
688 count = xmlTextWriterEndDTD(writer);
693 case XML_TEXTWRITER_COMMENT:
694 count = xmlTextWriterEndComment(writer);
704 if (!writer->indent) {
705 count = xmlOutputBufferWriteString(writer->out,
"\n");
711 sum += xmlTextWriterFlush(writer);
725xmlTextWriterStartComment(xmlTextWriterPtr writer)
730 xmlTextWriterStackEntry *
p;
732 if (writer ==
NULL) {
734 "xmlTextWriterStartComment : invalid writer!\n");
744 case XML_TEXTWRITER_TEXT:
745 case XML_TEXTWRITER_NONE:
747 case XML_TEXTWRITER_NAME:
749 count = xmlTextWriterOutputNSDecl(writer);
753 count = xmlOutputBufferWriteString(writer->out,
">");
757 if (writer->indent) {
759 xmlOutputBufferWriteString(writer->out,
"\n");
764 p->state = XML_TEXTWRITER_TEXT;
772 p = (xmlTextWriterStackEntry *)
773 xmlMalloc(
sizeof(xmlTextWriterStackEntry));
776 "xmlTextWriterStartElement : out of memory!\n");
781 p->state = XML_TEXTWRITER_COMMENT;
785 if (writer->indent) {
786 count = xmlTextWriterWriteIndent(writer);
792 count = xmlOutputBufferWriteString(writer->out,
"<!--");
809xmlTextWriterEndComment(xmlTextWriterPtr writer)
814 xmlTextWriterStackEntry *
p;
816 if (writer ==
NULL) {
818 "xmlTextWriterEndComment : invalid writer!\n");
825 "xmlTextWriterEndComment : not allowed in this context!\n");
835 case XML_TEXTWRITER_COMMENT:
836 count = xmlOutputBufferWriteString(writer->out,
"-->");
845 if (writer->indent) {
846 count = xmlOutputBufferWriteString(writer->out,
"\n");
867xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
875 rc = xmlTextWriterWriteVFormatComment(writer,
format,
ap);
892xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
898 if (writer ==
NULL) {
900 "xmlTextWriterWriteVFormatComment : invalid writer!\n");
904 buf = xmlTextWriterVSprintf(
format, argptr);
908 rc = xmlTextWriterWriteComment(writer,
buf);
924xmlTextWriterWriteComment(xmlTextWriterPtr writer,
const xmlChar *
content)
930 count = xmlTextWriterStartComment(writer);
938 count = xmlTextWriterEndComment(writer);
956xmlTextWriterStartElement(xmlTextWriterPtr writer,
const xmlChar *
name)
961 xmlTextWriterStackEntry *
p;
972 case XML_TEXTWRITER_PI:
973 case XML_TEXTWRITER_PI_TEXT:
975 case XML_TEXTWRITER_NONE:
977 case XML_TEXTWRITER_ATTRIBUTE:
978 count = xmlTextWriterEndAttribute(writer);
983 case XML_TEXTWRITER_NAME:
985 count = xmlTextWriterOutputNSDecl(writer);
989 count = xmlOutputBufferWriteString(writer->out,
">");
995 xmlOutputBufferWriteString(writer->out,
"\n");
996 p->state = XML_TEXTWRITER_TEXT;
1004 p = (xmlTextWriterStackEntry *)
1005 xmlMalloc(
sizeof(xmlTextWriterStackEntry));
1008 "xmlTextWriterStartElement : out of memory!\n");
1015 "xmlTextWriterStartElement : out of memory!\n");
1019 p->state = XML_TEXTWRITER_NAME;
1023 if (writer->indent) {
1024 count = xmlTextWriterWriteIndent(writer);
1028 count = xmlOutputBufferWriteString(writer->out,
"<");
1033 xmlOutputBufferWriteString(writer->out, (
const char *)
p->name);
1053xmlTextWriterStartElementNS(xmlTextWriterPtr writer,
1072 count = xmlTextWriterStartElement(writer,
buf);
1078 if (namespaceURI != 0) {
1079 xmlTextWriterNsStackEntry *
p = (xmlTextWriterNsStackEntry *)
1080 xmlMalloc(
sizeof(xmlTextWriterNsStackEntry));
1083 "xmlTextWriterStartElementNS : out of memory!\n");
1097 "xmlTextWriterStartElementNS : out of memory!\n");
1118xmlTextWriterEndElement(xmlTextWriterPtr writer)
1123 xmlTextWriterStackEntry *
p;
1131 writer->nsstack =
NULL;
1138 writer->nsstack =
NULL;
1144 case XML_TEXTWRITER_ATTRIBUTE:
1145 count = xmlTextWriterEndAttribute(writer);
1148 writer->nsstack =
NULL;
1153 case XML_TEXTWRITER_NAME:
1155 count = xmlTextWriterOutputNSDecl(writer);
1161 writer->doindent = 1;
1162 count = xmlOutputBufferWriteString(writer->out,
"/>");
1167 case XML_TEXTWRITER_TEXT:
1168 if ((writer->indent) && (writer->doindent)) {
1169 count = xmlTextWriterWriteIndent(writer);
1171 writer->doindent = 1;
1173 writer->doindent = 1;
1174 count = xmlOutputBufferWriteString(writer->out,
"</");
1178 count = xmlOutputBufferWriteString(writer->out,
1179 (
const char *)
p->name);
1183 count = xmlOutputBufferWriteString(writer->out,
">");
1192 if (writer->indent) {
1193 count = xmlOutputBufferWriteString(writer->out,
"\n");
1210xmlTextWriterFullEndElement(xmlTextWriterPtr writer)
1215 xmlTextWriterStackEntry *
p;
1230 case XML_TEXTWRITER_ATTRIBUTE:
1231 count = xmlTextWriterEndAttribute(writer);
1236 case XML_TEXTWRITER_NAME:
1238 count = xmlTextWriterOutputNSDecl(writer);
1243 count = xmlOutputBufferWriteString(writer->out,
">");
1248 writer->doindent = 0;
1250 case XML_TEXTWRITER_TEXT:
1251 if ((writer->indent) && (writer->doindent)) {
1252 count = xmlTextWriterWriteIndent(writer);
1254 writer->doindent = 1;
1256 writer->doindent = 1;
1257 count = xmlOutputBufferWriteString(writer->out,
"</");
1261 count = xmlOutputBufferWriteString(writer->out,
1262 (
const char *)
p->name);
1266 count = xmlOutputBufferWriteString(writer->out,
">");
1275 if (writer->indent) {
1276 count = xmlOutputBufferWriteString(writer->out,
"\n");
1295xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
const char *
format,
1303 rc = xmlTextWriterWriteVFormatRaw(writer,
format,
ap);
1320xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
const char *
format,
1329 buf = xmlTextWriterVSprintf(
format, argptr);
1333 rc = xmlTextWriterWriteRaw(writer,
buf);
1351xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
const xmlChar *
content,
1357 xmlTextWriterStackEntry *
p;
1359 if (writer ==
NULL) {
1361 "xmlTextWriterWriteRawLen : invalid writer!\n");
1367 "xmlTextWriterWriteRawLen : invalid content!\n");
1375 count = xmlTextWriterHandleStateDependencies(writer,
p);
1382 writer->doindent = 0;
1386 xmlOutputBufferWrite(writer->out,
len, (
const char *)
content);
1405xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
const xmlChar *
content)
1421xmlTextWriterWriteFormatString(xmlTextWriterPtr writer,
const char *
format,
1432 rc = xmlTextWriterWriteVFormatString(writer,
format,
ap);
1449xmlTextWriterWriteVFormatString(xmlTextWriterPtr writer,
1458 buf = xmlTextWriterVSprintf(
format, argptr);
1462 rc = xmlTextWriterWriteString(writer,
buf);
1478xmlTextWriterWriteString(xmlTextWriterPtr writer,
const xmlChar *
content)
1483 xmlTextWriterStackEntry *
p;
1496 case XML_TEXTWRITER_NAME:
1497 case XML_TEXTWRITER_TEXT:
1500 xmlOutputBufferWriteEscape(writer->out,
content,
NULL);
1504 case XML_TEXTWRITER_ATTRIBUTE:
1506 xmlBufAttrSerializeTxtContent(writer->out->buffer,
1516 count = xmlTextWriterWriteRaw(writer,
buf);
1542 const unsigned char *
data)
1544 static const unsigned char dtable[64] =
1545 {
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
1546 'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
1547 'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
1548 'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
1549 '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'+',
'/'};
1564 unsigned char igroup[3];
1565 unsigned char ogroup[4];
1569 igroup[0] = igroup[1] = igroup[2] = 0;
1570 for (
n = 0;
n < 3 &&
i <
len;
n++,
i++) {
1572 igroup[
n] = (
unsigned char)
c;
1576 ogroup[0] = dtable[igroup[0] >> 2];
1577 ogroup[1] = dtable[((igroup[0] & 3) << 4) | (igroup[1] >> 4)];
1579 dtable[((igroup[1] & 0xF) << 2) | (igroup[2] >> 6)];
1580 ogroup[3] = dtable[igroup[2] & 0x3F];
1589 if (linelen >= B64LINELEN) {
1590 count = xmlOutputBufferWrite(
out, 2, B64CRLF);
1596 count = xmlOutputBufferWrite(
out, 4, (
const char *) ogroup);
1623xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
const char *
data,
1629 xmlTextWriterStackEntry *
p;
1639 count = xmlTextWriterHandleStateDependencies(writer,
p);
1647 writer->doindent = 0;
1650 xmlOutputBufferWriteBase64(writer->out,
len,
1673 int len,
const unsigned char *
data)
1677 static const char hex[16] =
1678 {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F'};
1686 for (
i = 0;
i <
len;
i++) {
1688 xmlOutputBufferWrite(
out, 1,
1689 (
const char *) &hex[
data[
i] >> 4]);
1694 xmlOutputBufferWrite(
out, 1,
1695 (
const char *) &hex[
data[
i] & 0xF]);
1716xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
const char *
data,
1722 xmlTextWriterStackEntry *
p;
1732 count = xmlTextWriterHandleStateDependencies(writer,
p);
1740 writer->doindent = 0;
1743 xmlOutputBufferWriteBinHex(writer->out,
len,
1762xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
const xmlChar *
name)
1767 xmlTextWriterStackEntry *
p;
1782 case XML_TEXTWRITER_ATTRIBUTE:
1783 count = xmlTextWriterEndAttribute(writer);
1788 case XML_TEXTWRITER_NAME:
1789 count = xmlOutputBufferWriteString(writer->out,
" ");
1794 xmlOutputBufferWriteString(writer->out,
1795 (
const char *)
name);
1799 count = xmlOutputBufferWriteString(writer->out,
"=");
1803 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
1807 p->state = XML_TEXTWRITER_ATTRIBUTE;
1828xmlTextWriterStartAttributeNS(xmlTextWriterPtr writer,
1835 xmlTextWriterNsStackEntry *
p;
1841 if (namespaceURI != 0) {
1842 xmlTextWriterNsStackEntry nsentry, *curns;
1850 nsentry.prefix =
buf;
1851 nsentry.uri = (
xmlChar *)namespaceURI;
1854 curns = (xmlTextWriterNsStackEntry *)
xmlListSearch(writer->nsstack,
1856 if ((curns !=
NULL)) {
1858 if (
xmlStrcmp(curns->uri, namespaceURI) == 0) {
1869 p = (xmlTextWriterNsStackEntry *)
1870 xmlMalloc(
sizeof(xmlTextWriterNsStackEntry));
1873 "xmlTextWriterStartAttributeNS : out of memory!\n");
1881 "xmlTextWriterStartAttributeNS : out of memory!\n");
1899 count = xmlTextWriterStartAttribute(writer,
buf);
1917xmlTextWriterEndAttribute(xmlTextWriterPtr writer)
1922 xmlTextWriterStackEntry *
p;
1939 case XML_TEXTWRITER_ATTRIBUTE:
1940 p->state = XML_TEXTWRITER_NAME;
1942 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
1967xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
1976 rc = xmlTextWriterWriteVFormatAttribute(writer,
name,
format,
ap);
1994xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
2004 buf = xmlTextWriterVSprintf(
format, argptr);
2008 rc = xmlTextWriterWriteAttribute(writer,
name,
buf);
2025xmlTextWriterWriteAttribute(xmlTextWriterPtr writer,
const xmlChar *
name,
2032 count = xmlTextWriterStartAttribute(writer,
name);
2040 count = xmlTextWriterEndAttribute(writer);
2062xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
2073 rc = xmlTextWriterWriteVFormatAttributeNS(writer, prefix,
name,
2094xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
2106 buf = xmlTextWriterVSprintf(
format, argptr);
2110 rc = xmlTextWriterWriteAttributeNS(writer, prefix,
name, namespaceURI,
2130xmlTextWriterWriteAttributeNS(xmlTextWriterPtr writer,
2142 count = xmlTextWriterStartAttributeNS(writer, prefix,
name, namespaceURI);
2150 count = xmlTextWriterEndAttribute(writer);
2170xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
2179 rc = xmlTextWriterWriteVFormatElement(writer,
name,
format,
ap);
2197xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
2207 buf = xmlTextWriterVSprintf(
format, argptr);
2211 rc = xmlTextWriterWriteElement(writer,
name,
buf);
2228xmlTextWriterWriteElement(xmlTextWriterPtr writer,
const xmlChar *
name,
2235 count = xmlTextWriterStartElement(writer,
name);
2245 count = xmlTextWriterEndElement(writer);
2267xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
2278 rc = xmlTextWriterWriteVFormatElementNS(writer, prefix,
name,
2299xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
2311 buf = xmlTextWriterVSprintf(
format, argptr);
2315 rc = xmlTextWriterWriteElementNS(writer, prefix,
name, namespaceURI,
2335xmlTextWriterWriteElementNS(xmlTextWriterPtr writer,
2348 xmlTextWriterStartElementNS(writer, prefix,
name, namespaceURI);
2356 count = xmlTextWriterEndElement(writer);
2374xmlTextWriterStartPI(xmlTextWriterPtr writer,
const xmlChar *
target)
2379 xmlTextWriterStackEntry *
p;
2386 "xmlTextWriterStartPI : target name [Xx][Mm][Ll] is reserved for xml standardization!\n");
2396 case XML_TEXTWRITER_ATTRIBUTE:
2397 count = xmlTextWriterEndAttribute(writer);
2402 case XML_TEXTWRITER_NAME:
2404 count = xmlTextWriterOutputNSDecl(writer);
2408 count = xmlOutputBufferWriteString(writer->out,
">");
2412 p->state = XML_TEXTWRITER_TEXT;
2414 case XML_TEXTWRITER_NONE:
2415 case XML_TEXTWRITER_TEXT:
2416 case XML_TEXTWRITER_DTD:
2418 case XML_TEXTWRITER_PI:
2419 case XML_TEXTWRITER_PI_TEXT:
2421 "xmlTextWriterStartPI : nested PI!\n");
2429 p = (xmlTextWriterStackEntry *)
2430 xmlMalloc(
sizeof(xmlTextWriterStackEntry));
2433 "xmlTextWriterStartPI : out of memory!\n");
2440 "xmlTextWriterStartPI : out of memory!\n");
2444 p->state = XML_TEXTWRITER_PI;
2448 count = xmlOutputBufferWriteString(writer->out,
"<?");
2453 xmlOutputBufferWriteString(writer->out, (
const char *)
p->name);
2470xmlTextWriterEndPI(xmlTextWriterPtr writer)
2475 xmlTextWriterStackEntry *
p;
2490 case XML_TEXTWRITER_PI:
2491 case XML_TEXTWRITER_PI_TEXT:
2492 count = xmlOutputBufferWriteString(writer->out,
"?>");
2501 if (writer->indent) {
2502 count = xmlOutputBufferWriteString(writer->out,
"\n");
2524xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
const xmlChar *
target,
2550xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
2560 buf = xmlTextWriterVSprintf(
format, argptr);
2564 rc = xmlTextWriterWritePI(writer,
target,
buf);
2581xmlTextWriterWritePI(xmlTextWriterPtr writer,
const xmlChar *
target,
2598 count = xmlTextWriterEndPI(writer);
2615xmlTextWriterStartCDATA(xmlTextWriterPtr writer)
2620 xmlTextWriterStackEntry *
p;
2631 case XML_TEXTWRITER_NONE:
2632 case XML_TEXTWRITER_TEXT:
2633 case XML_TEXTWRITER_PI:
2634 case XML_TEXTWRITER_PI_TEXT:
2636 case XML_TEXTWRITER_ATTRIBUTE:
2637 count = xmlTextWriterEndAttribute(writer);
2642 case XML_TEXTWRITER_NAME:
2644 count = xmlTextWriterOutputNSDecl(writer);
2648 count = xmlOutputBufferWriteString(writer->out,
">");
2652 p->state = XML_TEXTWRITER_TEXT;
2654 case XML_TEXTWRITER_CDATA:
2656 "xmlTextWriterStartCDATA : CDATA not allowed in this context!\n");
2664 p = (xmlTextWriterStackEntry *)
2665 xmlMalloc(
sizeof(xmlTextWriterStackEntry));
2668 "xmlTextWriterStartCDATA : out of memory!\n");
2673 p->state = XML_TEXTWRITER_CDATA;
2677 count = xmlOutputBufferWriteString(writer->out,
"<![CDATA[");
2694xmlTextWriterEndCDATA(xmlTextWriterPtr writer)
2699 xmlTextWriterStackEntry *
p;
2714 case XML_TEXTWRITER_CDATA:
2715 count = xmlOutputBufferWriteString(writer->out,
"]]>");
2739xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
const char *
format,
2747 rc = xmlTextWriterWriteVFormatCDATA(writer,
format,
ap);
2764xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
const char *
format,
2773 buf = xmlTextWriterVSprintf(
format, argptr);
2777 rc = xmlTextWriterWriteCDATA(writer,
buf);
2793xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
const xmlChar *
content)
2799 count = xmlTextWriterStartCDATA(writer);
2809 count = xmlTextWriterEndCDATA(writer);
2829xmlTextWriterStartDTD(xmlTextWriterPtr writer,
2836 xmlTextWriterStackEntry *
p;
2845 "xmlTextWriterStartDTD : DTD allowed only in prolog!\n");
2849 p = (xmlTextWriterStackEntry *)
2850 xmlMalloc(
sizeof(xmlTextWriterStackEntry));
2853 "xmlTextWriterStartDTD : out of memory!\n");
2860 "xmlTextWriterStartDTD : out of memory!\n");
2864 p->state = XML_TEXTWRITER_DTD;
2868 count = xmlOutputBufferWriteString(writer->out,
"<!DOCTYPE ");
2872 count = xmlOutputBufferWriteString(writer->out, (
const char *)
name);
2880 "xmlTextWriterStartDTD : system identifier needed!\n");
2885 count = xmlOutputBufferWrite(writer->out, 1,
"\n");
2887 count = xmlOutputBufferWrite(writer->out, 1,
" ");
2892 count = xmlOutputBufferWriteString(writer->out,
"PUBLIC ");
2897 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
2903 xmlOutputBufferWriteString(writer->out, (
const char *) pubid);
2908 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
2917 count = xmlOutputBufferWrite(writer->out, 1,
"\n");
2919 count = xmlOutputBufferWrite(writer->out, 1,
" ");
2923 count = xmlOutputBufferWriteString(writer->out,
"SYSTEM ");
2929 count = xmlOutputBufferWriteString(writer->out,
"\n ");
2931 count = xmlOutputBufferWrite(writer->out, 1,
" ");
2937 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
2943 xmlOutputBufferWriteString(writer->out, (
const char *) sysid);
2948 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
2966xmlTextWriterEndDTD(xmlTextWriterPtr writer)
2972 xmlTextWriterStackEntry *
p;
2987 case XML_TEXTWRITER_DTD_TEXT:
2988 count = xmlOutputBufferWriteString(writer->out,
"]");
2993 case XML_TEXTWRITER_DTD:
2994 count = xmlOutputBufferWriteString(writer->out,
">");
2996 if (writer->indent) {
3000 count = xmlOutputBufferWriteString(writer->out,
"\n");
3005 case XML_TEXTWRITER_DTD_ELEM:
3006 case XML_TEXTWRITER_DTD_ELEM_TEXT:
3007 count = xmlTextWriterEndDTDElement(writer);
3009 case XML_TEXTWRITER_DTD_ATTL:
3010 case XML_TEXTWRITER_DTD_ATTL_TEXT:
3011 count = xmlTextWriterEndDTDAttlist(writer);
3013 case XML_TEXTWRITER_DTD_ENTY:
3014 case XML_TEXTWRITER_DTD_PENT:
3015 case XML_TEXTWRITER_DTD_ENTY_TEXT:
3016 count = xmlTextWriterEndDTDEntity(writer);
3018 case XML_TEXTWRITER_COMMENT:
3019 count = xmlTextWriterEndComment(writer);
3048xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
3058 rc = xmlTextWriterWriteVFormatDTD(writer,
name, pubid, sysid,
format,
3079xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
3091 buf = xmlTextWriterVSprintf(
format, argptr);
3095 rc = xmlTextWriterWriteDTD(writer,
name, pubid, sysid,
buf);
3114xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
3123 count = xmlTextWriterStartDTD(writer,
name, pubid, sysid);
3128 count = xmlTextWriterWriteString(writer, subset);
3133 count = xmlTextWriterEndDTD(writer);
3151xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
const xmlChar *
name)
3156 xmlTextWriterStackEntry *
p;
3170 case XML_TEXTWRITER_DTD:
3171 count = xmlOutputBufferWriteString(writer->out,
" [");
3175 if (writer->indent) {
3176 count = xmlOutputBufferWriteString(writer->out,
"\n");
3181 p->state = XML_TEXTWRITER_DTD_TEXT;
3183 case XML_TEXTWRITER_DTD_TEXT:
3184 case XML_TEXTWRITER_NONE:
3191 p = (xmlTextWriterStackEntry *)
3192 xmlMalloc(
sizeof(xmlTextWriterStackEntry));
3195 "xmlTextWriterStartDTDElement : out of memory!\n");
3202 "xmlTextWriterStartDTDElement : out of memory!\n");
3206 p->state = XML_TEXTWRITER_DTD_ELEM;
3210 if (writer->indent) {
3211 count = xmlTextWriterWriteIndent(writer);
3217 count = xmlOutputBufferWriteString(writer->out,
"<!ELEMENT ");
3221 count = xmlOutputBufferWriteString(writer->out, (
const char *)
name);
3238xmlTextWriterEndDTDElement(xmlTextWriterPtr writer)
3243 xmlTextWriterStackEntry *
p;
3258 case XML_TEXTWRITER_DTD_ELEM:
3259 case XML_TEXTWRITER_DTD_ELEM_TEXT:
3260 count = xmlOutputBufferWriteString(writer->out,
">");
3269 if (writer->indent) {
3270 count = xmlOutputBufferWriteString(writer->out,
"\n");
3292xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
3301 rc = xmlTextWriterWriteVFormatDTDElement(writer,
name,
format,
ap);
3319xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
3329 buf = xmlTextWriterVSprintf(
format, argptr);
3333 rc = xmlTextWriterWriteDTDElement(writer,
name,
buf);
3350xmlTextWriterWriteDTDElement(xmlTextWriterPtr writer,
3360 count = xmlTextWriterStartDTDElement(writer,
name);
3370 count = xmlTextWriterEndDTDElement(writer);
3388xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
const xmlChar *
name)
3393 xmlTextWriterStackEntry *
p;
3407 case XML_TEXTWRITER_DTD:
3408 count = xmlOutputBufferWriteString(writer->out,
" [");
3412 if (writer->indent) {
3413 count = xmlOutputBufferWriteString(writer->out,
"\n");
3418 p->state = XML_TEXTWRITER_DTD_TEXT;
3420 case XML_TEXTWRITER_DTD_TEXT:
3421 case XML_TEXTWRITER_NONE:
3428 p = (xmlTextWriterStackEntry *)
3429 xmlMalloc(
sizeof(xmlTextWriterStackEntry));
3432 "xmlTextWriterStartDTDAttlist : out of memory!\n");
3439 "xmlTextWriterStartDTDAttlist : out of memory!\n");
3443 p->state = XML_TEXTWRITER_DTD_ATTL;
3447 if (writer->indent) {
3448 count = xmlTextWriterWriteIndent(writer);
3454 count = xmlOutputBufferWriteString(writer->out,
"<!ATTLIST ");
3458 count = xmlOutputBufferWriteString(writer->out, (
const char *)
name);
3475xmlTextWriterEndDTDAttlist(xmlTextWriterPtr writer)
3480 xmlTextWriterStackEntry *
p;
3495 case XML_TEXTWRITER_DTD_ATTL:
3496 case XML_TEXTWRITER_DTD_ATTL_TEXT:
3497 count = xmlOutputBufferWriteString(writer->out,
">");
3506 if (writer->indent) {
3507 count = xmlOutputBufferWriteString(writer->out,
"\n");
3529xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
3538 rc = xmlTextWriterWriteVFormatDTDAttlist(writer,
name,
format,
ap);
3556xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
3566 buf = xmlTextWriterVSprintf(
format, argptr);
3570 rc = xmlTextWriterWriteDTDAttlist(writer,
name,
buf);
3587xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr writer,
3597 count = xmlTextWriterStartDTDAttlist(writer,
name);
3607 count = xmlTextWriterEndDTDAttlist(writer);
3626xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
3632 xmlTextWriterStackEntry *
p;
3644 case XML_TEXTWRITER_DTD:
3645 count = xmlOutputBufferWriteString(writer->out,
" [");
3649 if (writer->indent) {
3651 xmlOutputBufferWriteString(writer->out,
"\n");
3656 p->state = XML_TEXTWRITER_DTD_TEXT;
3658 case XML_TEXTWRITER_DTD_TEXT:
3659 case XML_TEXTWRITER_NONE:
3667 p = (xmlTextWriterStackEntry *)
3668 xmlMalloc(
sizeof(xmlTextWriterStackEntry));
3671 "xmlTextWriterStartDTDElement : out of memory!\n");
3678 "xmlTextWriterStartDTDElement : out of memory!\n");
3684 p->state = XML_TEXTWRITER_DTD_PENT;
3686 p->state = XML_TEXTWRITER_DTD_ENTY;
3690 if (writer->indent) {
3691 count = xmlTextWriterWriteIndent(writer);
3697 count = xmlOutputBufferWriteString(writer->out,
"<!ENTITY ");
3703 count = xmlOutputBufferWriteString(writer->out,
"% ");
3709 count = xmlOutputBufferWriteString(writer->out, (
const char *)
name);
3726xmlTextWriterEndDTDEntity(xmlTextWriterPtr writer)
3731 xmlTextWriterStackEntry *
p;
3746 case XML_TEXTWRITER_DTD_ENTY_TEXT:
3747 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
3752 case XML_TEXTWRITER_DTD_ENTY:
3753 case XML_TEXTWRITER_DTD_PENT:
3754 count = xmlOutputBufferWriteString(writer->out,
">");
3763 if (writer->indent) {
3764 count = xmlOutputBufferWriteString(writer->out,
"\n");
3787xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
3797 rc = xmlTextWriterWriteVFormatDTDInternalEntity(writer, pe,
name,
3817xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
3829 buf = xmlTextWriterVSprintf(
format, argptr);
3833 rc = xmlTextWriterWriteDTDInternalEntity(writer, pe,
name,
buf);
3854xmlTextWriterWriteDTDEntity(xmlTextWriterPtr writer,
3864 if ((pe != 0) && (ndataid !=
NULL))
3867 if ((pubid ==
NULL) && (sysid ==
NULL))
3868 return xmlTextWriterWriteDTDInternalEntity(writer, pe,
name,
3871 return xmlTextWriterWriteDTDExternalEntity(writer, pe,
name, pubid,
3887xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
3899 count = xmlTextWriterStartDTDEntity(writer, pe,
name);
3909 count = xmlTextWriterEndDTDEntity(writer);
3931xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
3941 if (((pubid ==
NULL) && (sysid ==
NULL)))
3943 if ((pe != 0) && (ndataid !=
NULL))
3947 count = xmlTextWriterStartDTDEntity(writer, pe,
name);
3953 xmlTextWriterWriteDTDExternalEntityContents(writer, pubid, sysid,
3959 count = xmlTextWriterEndDTDEntity(writer);
3979xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr writer,
3987 xmlTextWriterStackEntry *
p;
3989 if (writer ==
NULL) {
3991 "xmlTextWriterWriteDTDExternalEntityContents: xmlTextWriterPtr invalid!\n");
3999 "xmlTextWriterWriteDTDExternalEntityContents: you must call xmlTextWriterStartDTDEntity before the call to this function!\n");
4008 case XML_TEXTWRITER_DTD_ENTY:
4010 case XML_TEXTWRITER_DTD_PENT:
4011 if (ndataid !=
NULL) {
4013 "xmlTextWriterWriteDTDExternalEntityContents: notation not allowed with parameter entities!\n");
4019 "xmlTextWriterWriteDTDExternalEntityContents: you must call xmlTextWriterStartDTDEntity before the call to this function!\n");
4026 "xmlTextWriterWriteDTDExternalEntityContents: system identifier needed!\n");
4030 count = xmlOutputBufferWriteString(writer->out,
" PUBLIC ");
4035 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
4041 xmlOutputBufferWriteString(writer->out, (
const char *) pubid);
4046 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
4054 count = xmlOutputBufferWriteString(writer->out,
" SYSTEM");
4060 count = xmlOutputBufferWriteString(writer->out,
" ");
4065 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
4071 xmlOutputBufferWriteString(writer->out, (
const char *) sysid);
4076 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
4082 if (ndataid !=
NULL) {
4083 count = xmlOutputBufferWriteString(writer->out,
" NDATA ");
4089 xmlOutputBufferWriteString(writer->out,
4090 (
const char *) ndataid);
4111xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
4118 xmlTextWriterStackEntry *
p;
4132 case XML_TEXTWRITER_DTD:
4133 count = xmlOutputBufferWriteString(writer->out,
" [");
4137 if (writer->indent) {
4138 count = xmlOutputBufferWriteString(writer->out,
"\n");
4143 p->state = XML_TEXTWRITER_DTD_TEXT;
4145 case XML_TEXTWRITER_DTD_TEXT:
4152 if (writer->indent) {
4153 count = xmlTextWriterWriteIndent(writer);
4159 count = xmlOutputBufferWriteString(writer->out,
"<!NOTATION ");
4163 count = xmlOutputBufferWriteString(writer->out, (
const char *)
name);
4169 count = xmlOutputBufferWriteString(writer->out,
" PUBLIC ");
4173 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
4178 xmlOutputBufferWriteString(writer->out, (
const char *) pubid);
4182 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
4190 count = xmlOutputBufferWriteString(writer->out,
" SYSTEM");
4195 count = xmlOutputBufferWriteString(writer->out,
" ");
4199 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
4204 xmlOutputBufferWriteString(writer->out, (
const char *) sysid);
4208 count = xmlOutputBufferWrite(writer->out, 1, &writer->qchar);
4214 count = xmlOutputBufferWriteString(writer->out,
">");
4231xmlTextWriterFlush(xmlTextWriterPtr writer)
4238 if (writer->out ==
NULL)
4241 count = xmlOutputBufferFlush(writer->out);
4259 xmlTextWriterStackEntry *
p;
4280xmlCmpTextWriterStackEntry(
const void *data0,
const void *
data1)
4282 xmlTextWriterStackEntry *p0;
4283 xmlTextWriterStackEntry *p1;
4294 p0 = (xmlTextWriterStackEntry *) data0;
4295 p1 = (xmlTextWriterStackEntry *)
data1;
4311xmlTextWriterOutputNSDecl(xmlTextWriterPtr writer)
4314 xmlTextWriterNsStackEntry *np;
4334 count = xmlTextWriterWriteAttribute(writer, prefix, namespaceURI);
4340 writer->nsstack =
NULL;
4358 xmlTextWriterNsStackEntry *
p;
4382xmlCmpTextWriterNsStackEntry(
const void *data0,
const void *
data1)
4384 xmlTextWriterNsStackEntry *p0;
4385 xmlTextWriterNsStackEntry *p1;
4397 p0 = (xmlTextWriterNsStackEntry *) data0;
4398 p1 = (xmlTextWriterNsStackEntry *)
data1;
4402 if ((rc != 0) || (p0->elem != p1->elem))
4419xmlTextWriterWriteDocCallback(
void *
context,
const char *
str,
int len)
4424 if ((rc = xmlParseChunk(ctxt,
str,
len, 0)) != 0) {
4426 "xmlTextWriterWriteDocCallback : XML error %d !\n",
4443xmlTextWriterCloseDocCallback(
void *
context)
4448 if ((rc = xmlParseChunk(ctxt,
NULL, 0, 1)) != 0) {
4450 "xmlTextWriterCloseDocCallback : XML error %d !\n",
4479 "xmlTextWriterVSprintf : out of memory!\n");
4492 "xmlTextWriterVSprintf : out of memory!\n");
4509xmlTextWriterStartDocumentCallback(
void *
ctx)
4515#ifdef LIBXML_HTML_ENABLED
4521 "SAX.startDocument(): out of memory\n");
4529 "libxml2 built without HTML support\n");
4550 "SAX.startDocument(): out of memory\n");
4577xmlTextWriterSetIndent(xmlTextWriterPtr writer,
int indent)
4583 writer->doindent = 1;
4598xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
const xmlChar *
str)
4600 if ((writer ==
NULL) || (!
str))
4603 if (writer->ichar !=
NULL)
4623xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer,
xmlChar quotechar)
4625 if ((writer ==
NULL) || ((quotechar !=
'\'') && (quotechar !=
'"')))
4628 writer->qchar = quotechar;
4642xmlTextWriterWriteIndent(xmlTextWriterPtr writer)
4651 for (
i = 0;
i < (lksize - 1);
i++) {
4652 ret = xmlOutputBufferWriteString(writer->out,
4653 (
const char *) writer->ichar);
4658 return (lksize - 1);
4671xmlTextWriterHandleStateDependencies(xmlTextWriterPtr writer,
4672 xmlTextWriterStackEntry *
p)
4689 case XML_TEXTWRITER_NAME:
4691 count = xmlTextWriterOutputNSDecl(writer);
4696 p->state = XML_TEXTWRITER_TEXT;
4698 case XML_TEXTWRITER_PI:
4700 p->state = XML_TEXTWRITER_PI_TEXT;
4702 case XML_TEXTWRITER_DTD:
4705 p->state = XML_TEXTWRITER_DTD_TEXT;
4707 case XML_TEXTWRITER_DTD_ELEM:
4709 p->state = XML_TEXTWRITER_DTD_ELEM_TEXT;
4711 case XML_TEXTWRITER_DTD_ATTL:
4713 p->state = XML_TEXTWRITER_DTD_ATTL_TEXT;
4715 case XML_TEXTWRITER_DTD_ENTY:
4716 case XML_TEXTWRITER_DTD_PENT:
4718 extra[1] = writer->qchar;
4719 p->state = XML_TEXTWRITER_DTD_ENTY_TEXT;
4726 if (*
extra !=
'\0') {
4727 count = xmlOutputBufferWriteString(writer->out,
extra);
#define VA_COPY(Dest, Start)
XMLPUBFUN void XMLCALL xmlSAX2InitDefaultSAXHandler(xmlSAXHandler *hdlr, int warning)
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
xmlBufPtr xmlBufCreateSize(size_t size)
static const WCHAR indent[]
static const WCHAR version[]
int xmlCharEncOutput(xmlOutputBufferPtr output, int init)
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL xmlFindCharEncodingHandler(const char *name)
XMLPUBFUN xmlChar *XMLCALL xmlEncodeSpecialChars(const xmlDoc *doc, const xmlChar *input)
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static int sum(int x_, int y_)
XMLPUBVAR xmlMallocFunc xmlMalloc
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBFUN int XMLCALL xmlListEmpty(xmlListPtr l)
XMLPUBFUN xmlLinkPtr XMLCALL xmlListFront(xmlListPtr l)
XMLPUBFUN int XMLCALL xmlListSize(xmlListPtr l)
XMLPUBFUN void *XMLCALL xmlLinkGetData(xmlLinkPtr lk)
XMLPUBFUN void *XMLCALL xmlListSearch(xmlListPtr l, void *data)
XMLPUBFUN void XMLCALL xmlListDelete(xmlListPtr l)
XMLPUBFUN xmlListPtr XMLCALL xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare)
XMLPUBFUN int XMLCALL xmlListPushFront(xmlListPtr l, void *data)
XMLPUBFUN void XMLCALL xmlListPopFront(xmlListPtr l)
#define XML_DEFAULT_VERSION
XMLPUBFUN void XMLCALL xmlFreeParserCtxt(xmlParserCtxtPtr ctxt)
XMLPUBFUN void XMLCALL xmlFreeDoc(xmlDocPtr cur)
xmlOutputBuffer * xmlOutputBufferPtr
XMLPUBFUN xmlDocPtr XMLCALL xmlNewDoc(const xmlChar *version)
xmlParserCtxt * xmlParserCtxtPtr
XMLPUBFUN void XMLCALL xmlSetDocCompressMode(xmlDocPtr doc, int mode)
struct _xmlNode * children
struct _xmlSAXHandler * sax
xmlParserInputState instate
endElementSAXFunc endElement
startElementSAXFunc startElement
startDocumentSAXFunc startDocument
XMLPUBFUN xmlChar *XMLCALL xmlCanonicPath(const xmlChar *path)
void int int ULONGLONG int va_list * ap
@ XML_ERR_UNSUPPORTED_ENCODING
XMLPUBFUN int XMLCALL xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN xmlChar *XMLCALL xmlStrcat(xmlChar *cur, const xmlChar *add)
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBFUN int XMLCALL xmlStrcmp(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN int XMLCALL xmlStrlen(const xmlChar *str)
#define LIBXML_ATTR_FORMAT(fmt, args)