/*
* xmlwriter.c: XML text writer implementation
*
* For license and disclaimer see the license and disclaimer of
* libxml2.
*
* alfred@mickautsch.de
*/
#define IN_LIBXML
#include "libxml.h"
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/HTMLtree.h>
#ifdef LIBXML_WRITER_ENABLED
#include <libxml/xmlwriter.h>
/*
* The following VA_COPY was coded following an example in
* the Samba project. It may not be sufficient for some
* esoteric implementations of va_list (i.e. it may need
* something involving a memcpy) but (hopefully) will be
* sufficient for libxml2.
*/
#ifndef VA_COPY
#ifdef HAVE_VA_COPY
#else
#ifdef HAVE___VA_COPY
#else
#endif
#endif
#endif
/*
* Types are kept private
*/
typedef enum {
XML_TEXTWRITER_NONE = 0,
struct _xmlTextWriterStackEntry {
};
struct _xmlTextWriterNsStackEntry {
};
struct _xmlTextWriter {
int level;
int no_doc_free;
};
static int xmlCmpTextWriterStackEntry(const void *data0,
const void *data1);
static int xmlCmpTextWriterNsStackEntry(const void *data0,
const void *data1);
static int xmlTextWriterWriteDocCallback(void *context,
static int xmlTextWriterCloseDocCallback(void *context);
const unsigned char *data);
static void xmlTextWriterStartDocumentCallback(void *ctx);
static int
xmlTextWriterStackEntry * p);
/**
* xmlWriterErrMsg:
* @ctxt: a writer context
* @error: the error number
* @msg: the error message
*
* Handle a writer error
*/
static void
const char *msg)
{
} else {
}
}
/**
* xmlWriterErrMsgInt:
* @ctxt: a writer context
* @error: the error number
* @msg: the error message
* @val: an int
*
* Handle a writer error
*/
static void
{
} else {
}
}
/**
* xmlNewTextWriter:
* @out: an xmlOutputBufferPtr
*
* Create a new xmlNewTextWriter structure using an xmlOutputBufferPtr
* NOTE: the @out parameter will be deallocated when the writer is closed
* (if the call succeed.)
*
* Returns the new xmlTextWriterPtr or NULL in case of error
*/
{
"xmlNewTextWriter : out of memory!\n");
return NULL;
}
"xmlNewTextWriter : out of memory!\n");
return NULL;
}
"xmlNewTextWriter : out of memory!\n");
return NULL;
}
"xmlNewTextWriter : out of memory!\n");
return NULL;
}
ret->no_doc_free = 0;
return ret;
}
/**
* xmlNewTextWriterFilename:
* @uri: the URI of the resource for the output
* @compression: compress the output?
*
* Create a new xmlNewTextWriter structure with @uri as output
*
* Returns the new xmlTextWriterPtr or NULL in case of error
*/
{
"xmlNewTextWriterFilename : out of memory!\n");
return NULL;
}
"xmlNewTextWriterFilename : out of memory!\n");
return NULL;
}
return ret;
}
/**
* xmlNewTextWriterMemory:
* @buf: xmlBufferPtr
* @compression: compress the output?
*
* Create a new xmlNewTextWriter structure with @buf as output
* TODO: handle compression
*
* Returns the new xmlTextWriterPtr or NULL in case of error
*/
{
/*::todo handle compression */
"xmlNewTextWriterMemory : out of memory!\n");
return NULL;
}
"xmlNewTextWriterMemory : out of memory!\n");
return NULL;
}
return ret;
}
/**
* xmlNewTextWriterPushParser:
* @ctxt: xmlParserCtxtPtr to hold the new XML document tree
* @compression: compress the output?
*
* Create a new xmlNewTextWriter structure with @ctxt as output
* NOTE: the @ctxt context will be freed with the resulting writer
* (if the call succeeds).
* TODO: handle compression
*
* Returns the new xmlTextWriterPtr or NULL in case of error
*/
{
"xmlNewTextWriterPushParser : invalid context!\n");
return NULL;
}
"xmlNewTextWriterPushParser : error at xmlOutputBufferCreateIO!\n");
return NULL;
}
"xmlNewTextWriterPushParser : error at xmlNewTextWriter!\n");
return NULL;
}
return ret;
}
/**
* xmlNewTextWriterDoc:
* @doc: address of a xmlDocPtr to hold the new XML document tree
* @compression: compress the output?
*
* Create a new xmlNewTextWriter structure with @*doc as output
*
* Returns the new xmlTextWriterPtr or NULL in case of error
*/
{
"xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
return NULL;
}
/*
* For some reason this seems to completely break if node names
* are interned.
*/
"xmlNewTextWriterDoc : error at xmlNewDoc!\n");
return NULL;
}
"xmlNewTextWriterDoc : error at xmlNewTextWriterPushParser!\n");
return NULL;
}
}
return ret;
}
/**
* xmlNewTextWriterTree:
* @doc: xmlDocPtr
* @node: xmlNodePtr or NULL for doc->children
* @compression: compress the output?
*
* Create a new xmlNewTextWriter structure with @doc as output
* starting at @node
*
* Returns the new xmlTextWriterPtr or NULL in case of error
*/
{
"xmlNewTextWriterTree : invalid document tree!\n");
return NULL;
}
"xmlNewTextWriterDoc : error at xmlCreatePushParserCtxt!\n");
return NULL;
}
/*
* For some reason this seems to completely break if node names
* are interned.
*/
"xmlNewTextWriterDoc : error at xmlNewTextWriterPushParser!\n");
return NULL;
}
return ret;
}
/**
* xmlFreeTextWriter:
* @writer: the xmlTextWriterPtr
*
* Deallocate all the resources associated to the writer
*/
void
{
return;
}
}
}
/**
* xmlTextWriterStartDocument:
* @writer: the xmlTextWriterPtr
* @version: the xml version ("1.0") or NULL for default ("1.0")
* @encoding: the encoding or NULL for default
* @standalone: "yes" or "no" or NULL for default
*
* Start a new xml document
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
const char *encoding, const char *standalone)
{
int count;
int sum;
"xmlTextWriterStartDocument : invalid writer!\n");
return -1;
}
"xmlTextWriterStartDocument : not allowed in this context!\n");
return -1;
}
"xmlTextWriterStartDocument : out of memory!\n");
return -1;
}
}
}
} else
sum = 0;
if (count < 0)
return -1;
if (count < 0)
return -1;
if (version != 0)
else
if (count < 0)
return -1;
if (count < 0)
return -1;
if (count < 0)
return -1;
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
if (count < 0)
return -1;
}
if (standalone != 0) {
if (count < 0)
return -1;
if (count < 0)
return -1;
if (count < 0)
return -1;
if (count < 0)
return -1;
}
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterEndDocument:
* @writer: the xmlTextWriterPtr
*
* End an xml document. All open elements are closed
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
"xmlTextWriterEndDocument : invalid writer!\n");
return -1;
}
sum = 0;
if (p == 0)
break;
switch (p->state) {
case XML_TEXTWRITER_NAME:
case XML_TEXTWRITER_ATTRIBUTE:
case XML_TEXTWRITER_TEXT:
if (count < 0)
return -1;
break;
case XML_TEXTWRITER_PI:
case XML_TEXTWRITER_PI_TEXT:
if (count < 0)
return -1;
break;
case XML_TEXTWRITER_CDATA:
if (count < 0)
return -1;
break;
case XML_TEXTWRITER_DTD:
case XML_TEXTWRITER_DTD_TEXT:
case XML_TEXTWRITER_DTD_ELEM:
case XML_TEXTWRITER_DTD_ATTL:
case XML_TEXTWRITER_DTD_ENTY:
case XML_TEXTWRITER_DTD_PENT:
if (count < 0)
return -1;
break;
case XML_TEXTWRITER_COMMENT:
if (count < 0)
return -1;
break;
default:
break;
}
}
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterStartComment:
* @writer: the xmlTextWriterPtr
*
* Start an xml comment.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
"xmlTextWriterStartComment : invalid writer!\n");
return -1;
}
sum = 0;
if (lk != 0) {
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_TEXT:
case XML_TEXTWRITER_NONE:
break;
case XML_TEXTWRITER_NAME:
/* Output namespace declarations */
if (count < 0)
return -1;
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
}
p->state = XML_TEXTWRITER_TEXT;
break;
default:
return -1;
}
}
}
p = (xmlTextWriterStackEntry *)
xmlMalloc(sizeof(xmlTextWriterStackEntry));
if (p == 0) {
"xmlTextWriterStartElement : out of memory!\n");
return -1;
}
p->state = XML_TEXTWRITER_COMMENT;
if (count < 0)
return -1;
}
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterEndComment:
* @writer: the xmlTextWriterPtr
*
* End the current xml coment.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
"xmlTextWriterEndComment : invalid writer!\n");
return -1;
}
if (lk == 0) {
"xmlTextWriterEndComment : not allowed in this context!\n");
return -1;
}
if (p == 0)
return -1;
sum = 0;
switch (p->state) {
case XML_TEXTWRITER_COMMENT:
if (count < 0)
return -1;
break;
default:
return -1;
}
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteFormatComment:
* @writer: the xmlTextWriterPtr
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write an xml comment.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
const char *format, ...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatComment:
* @writer: the xmlTextWriterPtr
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write an xml comment.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
"xmlTextWriterWriteVFormatComment : invalid writer!\n");
return -1;
}
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteComment:
* @writer: the xmlTextWriterPtr
* @content: comment string
*
* Write an xml comment.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
sum = 0;
if (count < 0)
return -1;
if (count < 0)
return -1;
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterStartElement:
* @writer: the xmlTextWriterPtr
* @name: element name
*
* Start an xml element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk != 0) {
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_PI:
case XML_TEXTWRITER_PI_TEXT:
return -1;
case XML_TEXTWRITER_NONE:
break;
case XML_TEXTWRITER_ATTRIBUTE:
if (count < 0)
return -1;
/* fallthrough */
case XML_TEXTWRITER_NAME:
/* Output namespace declarations */
if (count < 0)
return -1;
if (count < 0)
return -1;
count =
p->state = XML_TEXTWRITER_TEXT;
break;
default:
break;
}
}
}
p = (xmlTextWriterStackEntry *)
xmlMalloc(sizeof(xmlTextWriterStackEntry));
if (p == 0) {
"xmlTextWriterStartElement : out of memory!\n");
return -1;
}
if (p->name == 0) {
"xmlTextWriterStartElement : out of memory!\n");
xmlFree(p);
return -1;
}
p->state = XML_TEXTWRITER_NAME;
}
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterStartElementNS:
* @writer: the xmlTextWriterPtr
* @prefix: namespace prefix or NULL
* @name: element local name
* @namespaceURI: namespace URI or NULL
*
* Start an xml element with namespace support.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
const xmlChar * namespaceURI)
{
int count;
int sum;
return -1;
if (prefix != 0) {
}
sum = 0;
if (count < 0)
return -1;
if (namespaceURI != 0) {
xmlMalloc(sizeof(xmlTextWriterNsStackEntry));
if (p == 0) {
"xmlTextWriterStartElementNS : out of memory!\n");
return -1;
}
if (prefix != 0) {
}
if (p->uri == 0) {
"xmlTextWriterStartElementNS : out of memory!\n");
xmlFree(p);
return -1;
}
}
return sum;
}
/**
* xmlTextWriterEndElement:
* @writer: the xmlTextWriterPtr
*
* End the current xml element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
if (lk == 0) {
return -1;
}
if (p == 0) {
return -1;
}
sum = 0;
switch (p->state) {
case XML_TEXTWRITER_ATTRIBUTE:
if (count < 0) {
return -1;
}
/* fallthrough */
case XML_TEXTWRITER_NAME:
/* Output namespace declarations */
if (count < 0)
return -1;
if (count < 0)
return -1;
break;
case XML_TEXTWRITER_TEXT:
} else
if (count < 0)
return -1;
(const char *) p->name);
if (count < 0)
return -1;
if (count < 0)
return -1;
break;
default:
return -1;
}
}
return sum;
}
/**
* xmlTextWriterFullEndElement:
* @writer: the xmlTextWriterPtr
*
* End the current xml element. Writes an end tag even if the element is empty
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
if (lk == 0)
return -1;
if (p == 0)
return -1;
sum = 0;
switch (p->state) {
case XML_TEXTWRITER_ATTRIBUTE:
if (count < 0)
return -1;
/* fallthrough */
case XML_TEXTWRITER_NAME:
/* Output namespace declarations */
if (count < 0)
return -1;
if (count < 0)
return -1;
/* fallthrough */
case XML_TEXTWRITER_TEXT:
if (count < 0)
return -1;
(const char *) p->name);
if (count < 0)
return -1;
if (count < 0)
return -1;
break;
default:
return -1;
}
}
return sum;
}
/**
* xmlTextWriterWriteFormatRaw:
* @writer: the xmlTextWriterPtr
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted raw xml text.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatRaw:
* @writer: the xmlTextWriterPtr
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted raw xml text.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteRawLen:
* @writer: the xmlTextWriterPtr
* @content: text string
* @len: length of the text string
*
* Write an xml text.
* TODO: what about entities and special chars??
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
int len)
{
int count;
int sum;
"xmlTextWriterWriteRawLen : invalid writer!\n");
return -1;
}
"xmlTextWriterWriteRawLen : invalid content!\n");
return -1;
}
sum = 0;
if (lk != 0) {
if (count < 0)
return -1;
}
count =
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteRaw:
* @writer: the xmlTextWriterPtr
* @content: text string
*
* Write a raw xml text.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
}
/**
* xmlTextWriterWriteFormatString:
* @writer: the xmlTextWriterPtr
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted xml text.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
...)
{
int rc;
return -1;
return rc;
}
/**
* xmlTextWriterWriteVFormatString:
* @writer: the xmlTextWriterPtr
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted xml text.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteString:
* @writer: the xmlTextWriterPtr
* @content: text string
*
* Write an xml text.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk != 0) {
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_NAME:
case XML_TEXTWRITER_TEXT:
#if 0
#endif
break;
case XML_TEXTWRITER_ATTRIBUTE:
break;
default:
break;
}
}
}
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlOutputBufferWriteBase64:
* @out: the xmlOutputBufferPtr
* @data: binary data
* @len: the number of bytes to encode
*
* Write base64 encoded data to an xmlOutputBuffer.
* Adapted from John Walker's base64.c (http://www.fourmilab.ch/).
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
static int
const unsigned char *data)
{
{'A','B','C','D','E','F','G','H','I','J','K','L','M',
'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'a','b','c','d','e','f','g','h','i','j','k','l','m',
'n','o','p','q','r','s','t','u','v','w','x','y','z',
'0','1','2','3','4','5','6','7','8','9','+','/'};
int i;
int linelen;
int count;
int sum;
return(-1);
linelen = 0;
sum = 0;
i = 0;
while (1) {
int c;
int n;
for (n = 0; n < 3 && i < len; n++, i++) {
c = data[i];
igroup[n] = (unsigned char) c;
}
if (n > 0) {
ogroup[2] =
if (n < 3) {
if (n < 2) {
}
}
if (linelen >= B64LINELEN) {
if (count == -1)
return -1;
linelen = 0;
}
if (count == -1)
return -1;
linelen += 4;
}
if (i >= len)
break;
}
return sum;
}
/**
* xmlTextWriterWriteBase64:
* @writer: the xmlTextWriterPtr
* @data: binary data
* @start: the position within the data of the first byte to encode
* @len: the number of bytes to encode
*
* Write an base64 encoded xml text.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk != 0) {
if (p != 0) {
if (count < 0)
return -1;
}
}
count =
if (count < 0)
return -1;
return sum;
}
/**
* xmlOutputBufferWriteBinHex:
* @out: the xmlOutputBufferPtr
* @data: binary data
* @len: the number of bytes to encode
*
* Write hqx encoded data to an xmlOutputBuffer.
* ::todo
*
* Returns the bytes written (may be 0 because of buffering)
* or -1 in case of error
*/
static int
{
int count;
int sum;
{'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
int i;
return -1;
}
sum = 0;
for (i = 0; i < len; i++) {
count =
if (count == -1)
return -1;
count =
if (count == -1)
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteBinHex:
* @writer: the xmlTextWriterPtr
* @data: binary data
* @start: the position within the data of the first byte to encode
* @len: the number of bytes to encode
*
* Write a BinHex encoded xml text.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk != 0) {
if (p != 0) {
if (count < 0)
return -1;
}
}
count =
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterStartAttribute:
* @writer: the xmlTextWriterPtr
* @name: element name
*
* Start an xml attribute.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk == 0)
return -1;
if (p == 0)
return -1;
switch (p->state) {
case XML_TEXTWRITER_ATTRIBUTE:
if (count < 0)
return -1;
/* fallthrough */
case XML_TEXTWRITER_NAME:
if (count < 0)
return -1;
count =
(const char *) name);
if (count < 0)
return -1;
if (count < 0)
return -1;
if (count < 0)
return -1;
break;
default:
return -1;
}
return sum;
}
/**
* xmlTextWriterStartAttributeNS:
* @writer: the xmlTextWriterPtr
* @prefix: namespace prefix or NULL
* @name: element local name
* @namespaceURI: namespace URI or NULL
*
* Start an xml attribute with namespace support.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
const xmlChar * namespaceURI)
{
int count;
int sum;
return -1;
/* Handle namespace first in case of error */
if (namespaceURI != 0) {
if (prefix != 0) {
}
(void *)&nsentry);
/* Namespace already defined on element skip */
} else {
/* Prefix mismatch so error out */
return -1;
}
}
/* Do not add namespace decl to list - it is already there */
p = (xmlTextWriterNsStackEntry *)
xmlMalloc(sizeof(xmlTextWriterNsStackEntry));
if (p == 0) {
"xmlTextWriterStartAttributeNS : out of memory!\n");
return -1;
}
if (p->uri == 0) {
"xmlTextWriterStartAttributeNS : out of memory!\n");
xmlFree(p);
return -1;
}
}
}
if (prefix != 0) {
}
sum = 0;
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterEndAttribute:
* @writer: the xmlTextWriterPtr
*
* End the current xml element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
if (lk == 0) {
return -1;
}
if (p == 0) {
return -1;
}
sum = 0;
switch (p->state) {
case XML_TEXTWRITER_ATTRIBUTE:
p->state = XML_TEXTWRITER_NAME;
if (count < 0) {
return -1;
}
break;
default:
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteFormatAttribute:
* @writer: the xmlTextWriterPtr
* @name: attribute name
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted xml attribute.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatAttribute:
* @writer: the xmlTextWriterPtr
* @name: attribute name
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted xml attribute.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteAttribute:
* @writer: the xmlTextWriterPtr
* @name: attribute name
* @content: attribute content
*
* Write an xml attribute.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
sum = 0;
if (count < 0)
return -1;
if (count < 0)
return -1;
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterWriteFormatAttributeNS:
* @writer: the xmlTextWriterPtr
* @prefix: namespace prefix
* @name: attribute local name
* @namespaceURI: namespace URI
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted xml attribute.with namespace support
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
const xmlChar * namespaceURI,
const char *format, ...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatAttributeNS:
* @writer: the xmlTextWriterPtr
* @prefix: namespace prefix
* @name: attribute local name
* @namespaceURI: namespace URI
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted xml attribute.with namespace support
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
const xmlChar * namespaceURI,
{
int rc;
return -1;
if (buf == 0)
return 0;
buf);
return rc;
}
/**
* xmlTextWriterWriteAttributeNS:
* @writer: the xmlTextWriterPtr
* @prefix: namespace prefix
* @name: attribute local name
* @namespaceURI: namespace URI
* @content: attribute content
*
* Write an xml attribute.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
const xmlChar * namespaceURI,
{
int count;
int sum;
return -1;
sum = 0;
if (count < 0)
return -1;
if (count < 0)
return -1;
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterWriteFormatElement:
* @writer: the xmlTextWriterPtr
* @name: element name
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted xml element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatElement:
* @writer: the xmlTextWriterPtr
* @name: element name
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted xml element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteElement:
* @writer: the xmlTextWriterPtr
* @name: element name
* @content: element content
*
* Write an xml element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
sum = 0;
if (count == -1)
return -1;
if (count == -1)
return -1;
if (count == -1)
return -1;
return sum;
}
/**
* xmlTextWriterWriteFormatElementNS:
* @writer: the xmlTextWriterPtr
* @prefix: namespace prefix
* @name: element local name
* @namespaceURI: namespace URI
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted xml element with namespace support.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
const xmlChar * namespaceURI,
const char *format, ...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatElementNS:
* @writer: the xmlTextWriterPtr
* @prefix: namespace prefix
* @name: element local name
* @namespaceURI: namespace URI
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted xml element with namespace support.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
const xmlChar * namespaceURI,
{
int rc;
return -1;
if (buf == 0)
return 0;
buf);
return rc;
}
/**
* xmlTextWriterWriteElementNS:
* @writer: the xmlTextWriterPtr
* @prefix: namespace prefix
* @name: element local name
* @namespaceURI: namespace URI
* @content: element content
*
* Write an xml element with namespace support.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
const xmlChar * namespaceURI,
{
int count;
int sum;
return -1;
sum = 0;
count =
if (count < 0)
return -1;
if (count == -1)
return -1;
if (count == -1)
return -1;
return sum;
}
/**
* xmlTextWriterStartPI:
* @writer: the xmlTextWriterPtr
* @target: PI target
*
* Start an xml PI.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
"xmlTextWriterStartPI : target name [Xx][Mm][Ll] is reserved for xml standardization!\n");
return -1;
}
sum = 0;
if (lk != 0) {
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_ATTRIBUTE:
if (count < 0)
return -1;
/* fallthrough */
case XML_TEXTWRITER_NAME:
/* Output namespace declarations */
if (count < 0)
return -1;
if (count < 0)
return -1;
p->state = XML_TEXTWRITER_TEXT;
break;
case XML_TEXTWRITER_NONE:
case XML_TEXTWRITER_TEXT:
case XML_TEXTWRITER_DTD:
break;
case XML_TEXTWRITER_PI:
case XML_TEXTWRITER_PI_TEXT:
"xmlTextWriterStartPI : nested PI!\n");
return -1;
default:
return -1;
}
}
}
p = (xmlTextWriterStackEntry *)
xmlMalloc(sizeof(xmlTextWriterStackEntry));
if (p == 0) {
"xmlTextWriterStartPI : out of memory!\n");
return -1;
}
if (p->name == 0) {
"xmlTextWriterStartPI : out of memory!\n");
xmlFree(p);
return -1;
}
p->state = XML_TEXTWRITER_PI;
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterEndPI:
* @writer: the xmlTextWriterPtr
*
* End the current xml PI.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
if (lk == 0)
return 0;
if (p == 0)
return 0;
sum = 0;
switch (p->state) {
case XML_TEXTWRITER_PI:
case XML_TEXTWRITER_PI_TEXT:
if (count < 0)
return -1;
break;
default:
return -1;
}
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteFormatPI:
* @writer: the xmlTextWriterPtr
* @target: PI target
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted PI.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
const char *format, ...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatPI:
* @writer: the xmlTextWriterPtr
* @target: PI target
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted xml PI.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWritePI:
* @writer: the xmlTextWriterPtr
* @target: PI target
* @content: PI content
*
* Write an xml PI.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
sum = 0;
if (count == -1)
return -1;
if (content != 0) {
if (count == -1)
return -1;
}
if (count == -1)
return -1;
return sum;
}
/**
* xmlTextWriterStartCDATA:
* @writer: the xmlTextWriterPtr
*
* Start an xml CDATA section.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk != 0) {
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_NONE:
case XML_TEXTWRITER_PI:
case XML_TEXTWRITER_PI_TEXT:
break;
case XML_TEXTWRITER_ATTRIBUTE:
if (count < 0)
return -1;
/* fallthrough */
case XML_TEXTWRITER_NAME:
/* Output namespace declarations */
if (count < 0)
return -1;
if (count < 0)
return -1;
p->state = XML_TEXTWRITER_TEXT;
break;
case XML_TEXTWRITER_CDATA:
"xmlTextWriterStartCDATA : CDATA not allowed in this context!\n");
return -1;
default:
return -1;
}
}
}
p = (xmlTextWriterStackEntry *)
xmlMalloc(sizeof(xmlTextWriterStackEntry));
if (p == 0) {
"xmlTextWriterStartCDATA : out of memory!\n");
return -1;
}
p->state = XML_TEXTWRITER_CDATA;
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterEndCDATA:
* @writer: the xmlTextWriterPtr
*
* End an xml CDATA section.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
if (lk == 0)
return -1;
if (p == 0)
return -1;
sum = 0;
switch (p->state) {
case XML_TEXTWRITER_CDATA:
if (count < 0)
return -1;
break;
default:
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteFormatCDATA:
* @writer: the xmlTextWriterPtr
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted xml CDATA.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatCDATA:
* @writer: the xmlTextWriterPtr
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted xml CDATA.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteCDATA:
* @writer: the xmlTextWriterPtr
* @content: CDATA content
*
* Write an xml CDATA.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
sum = 0;
if (count == -1)
return -1;
if (content != 0) {
if (count == -1)
return -1;
}
if (count == -1)
return -1;
return sum;
}
/**
* xmlTextWriterStartDTD:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD
* @pubid: the public identifier, which is an alternative to the system identifier
* @sysid: the system identifier, which is the URI of the DTD
*
* Start an xml DTD.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
"xmlTextWriterStartDTD : DTD allowed only in prolog!\n");
return -1;
}
p = (xmlTextWriterStackEntry *)
xmlMalloc(sizeof(xmlTextWriterStackEntry));
if (p == 0) {
"xmlTextWriterStartDTD : out of memory!\n");
return -1;
}
if (p->name == 0) {
"xmlTextWriterStartDTD : out of memory!\n");
xmlFree(p);
return -1;
}
p->state = XML_TEXTWRITER_DTD;
if (count < 0)
return -1;
if (count < 0)
return -1;
if (pubid != 0) {
if (sysid == 0) {
"xmlTextWriterStartDTD : system identifier needed!\n");
return -1;
}
else
if (count < 0)
return -1;
if (count < 0)
return -1;
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
if (count < 0)
return -1;
}
if (sysid != 0) {
if (pubid == 0) {
else
if (count < 0)
return -1;
if (count < 0)
return -1;
} else {
else
if (count < 0)
return -1;
}
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterEndDTD:
* @writer: the xmlTextWriterPtr
*
* End an xml DTD.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int loop;
int count;
int sum;
return -1;
sum = 0;
loop = 1;
while (loop) {
break;
if (p == 0)
break;
switch (p->state) {
case XML_TEXTWRITER_DTD_TEXT:
if (count < 0)
return -1;
/* fallthrough */
case XML_TEXTWRITER_DTD:
if (count < 0)
return -1;
}
break;
case XML_TEXTWRITER_DTD_ELEM:
break;
case XML_TEXTWRITER_DTD_ATTL:
break;
case XML_TEXTWRITER_DTD_ENTY:
case XML_TEXTWRITER_DTD_PENT:
break;
case XML_TEXTWRITER_COMMENT:
break;
default:
loop = 0;
continue;
}
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteFormatDTD:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD
* @pubid: the public identifier, which is an alternative to the system identifier
* @sysid: the system identifier, which is the URI of the DTD
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a DTD with a formatted markup declarations part.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
{
int rc;
ap);
return rc;
}
/**
* xmlTextWriterWriteVFormatDTD:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD
* @pubid: the public identifier, which is an alternative to the system identifier
* @sysid: the system identifier, which is the URI of the DTD
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a DTD with a formatted markup declarations part.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteDTD:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD
* @pubid: the public identifier, which is an alternative to the system identifier
* @sysid: the system identifier, which is the URI of the DTD
* @subset: string content of the DTD
*
* Write a DTD.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
sum = 0;
if (count == -1)
return -1;
if (subset != 0) {
if (count == -1)
return -1;
}
if (count == -1)
return -1;
return sum;
}
/**
* xmlTextWriterStartDTDElement:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD element
*
* Start an xml DTD element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk == 0) {
return -1;
}
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_DTD:
if (count < 0)
return -1;
if (count < 0)
return -1;
}
p->state = XML_TEXTWRITER_DTD_TEXT;
/* fallthrough */
case XML_TEXTWRITER_DTD_TEXT:
case XML_TEXTWRITER_NONE:
break;
default:
return -1;
}
}
p = (xmlTextWriterStackEntry *)
xmlMalloc(sizeof(xmlTextWriterStackEntry));
if (p == 0) {
"xmlTextWriterStartDTDElement : out of memory!\n");
return -1;
}
if (p->name == 0) {
"xmlTextWriterStartDTDElement : out of memory!\n");
xmlFree(p);
return -1;
}
p->state = XML_TEXTWRITER_DTD_ELEM;
if (count < 0)
return -1;
}
if (count < 0)
return -1;
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterEndDTDElement:
* @writer: the xmlTextWriterPtr
*
* End an xml DTD element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk == 0)
return -1;
if (p == 0)
return -1;
switch (p->state) {
case XML_TEXTWRITER_DTD_ELEM:
if (count < 0)
return -1;
break;
default:
return -1;
}
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteFormatDTDElement:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD element
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted DTD element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
const char *format, ...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatDTDElement:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD element
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted DTD element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteDTDElement:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD element
* @content: content of the element
*
* Write a DTD element.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (count == -1)
return -1;
if (count == -1)
return -1;
if (count == -1)
return -1;
return sum;
}
/**
* xmlTextWriterStartDTDAttlist:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD ATTLIST
*
* Start an xml DTD ATTLIST.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk == 0) {
return -1;
}
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_DTD:
if (count < 0)
return -1;
if (count < 0)
return -1;
}
p->state = XML_TEXTWRITER_DTD_TEXT;
/* fallthrough */
case XML_TEXTWRITER_DTD_TEXT:
case XML_TEXTWRITER_NONE:
break;
default:
return -1;
}
}
p = (xmlTextWriterStackEntry *)
xmlMalloc(sizeof(xmlTextWriterStackEntry));
if (p == 0) {
"xmlTextWriterStartDTDAttlist : out of memory!\n");
return -1;
}
if (p->name == 0) {
"xmlTextWriterStartDTDAttlist : out of memory!\n");
xmlFree(p);
return -1;
}
p->state = XML_TEXTWRITER_DTD_ATTL;
if (count < 0)
return -1;
}
if (count < 0)
return -1;
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterEndDTDAttlist:
* @writer: the xmlTextWriterPtr
*
* End an xml DTD attribute list.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk == 0)
return -1;
if (p == 0)
return -1;
switch (p->state) {
case XML_TEXTWRITER_DTD_ATTL:
if (count < 0)
return -1;
break;
default:
return -1;
}
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteFormatDTDAttlist:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD ATTLIST
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted DTD ATTLIST.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
const char *format, ...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatDTDAttlist:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD ATTLIST
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted DTD ATTLIST.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteDTDAttlist:
* @writer: the xmlTextWriterPtr
* @name: the name of the DTD ATTLIST
* @content: content of the ATTLIST
*
* Write a DTD ATTLIST.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (count == -1)
return -1;
if (count == -1)
return -1;
if (count == -1)
return -1;
return sum;
}
/**
* xmlTextWriterStartDTDEntity:
* @writer: the xmlTextWriterPtr
* @pe: TRUE if this is a parameter entity, FALSE if not
* @name: the name of the DTD ATTLIST
*
* Start an xml DTD ATTLIST.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk != 0) {
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_DTD:
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
}
p->state = XML_TEXTWRITER_DTD_TEXT;
/* fallthrough */
case XML_TEXTWRITER_DTD_TEXT:
case XML_TEXTWRITER_NONE:
break;
default:
return -1;
}
}
}
p = (xmlTextWriterStackEntry *)
xmlMalloc(sizeof(xmlTextWriterStackEntry));
if (p == 0) {
"xmlTextWriterStartDTDElement : out of memory!\n");
return -1;
}
if (p->name == 0) {
"xmlTextWriterStartDTDElement : out of memory!\n");
xmlFree(p);
return -1;
}
if (pe != 0)
p->state = XML_TEXTWRITER_DTD_PENT;
else
p->state = XML_TEXTWRITER_DTD_ENTY;
if (count < 0)
return -1;
}
if (count < 0)
return -1;
if (pe != 0) {
if (count < 0)
return -1;
}
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterEndDTDEntity:
* @writer: the xmlTextWriterPtr
*
* End an xml DTD entity.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk == 0)
return -1;
if (p == 0)
return -1;
switch (p->state) {
if (count < 0)
return -1;
case XML_TEXTWRITER_DTD_ENTY:
case XML_TEXTWRITER_DTD_PENT:
if (count < 0)
return -1;
break;
default:
return -1;
}
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteFormatDTDInternalEntity:
* @writer: the xmlTextWriterPtr
* @pe: TRUE if this is a parameter entity, FALSE if not
* @name: the name of the DTD entity
* @format: format string (see printf)
* @...: extra parameters for the format
*
* Write a formatted DTD internal entity.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int XMLCDECL
int pe,
const char *format, ...)
{
int rc;
return rc;
}
/**
* xmlTextWriterWriteVFormatDTDInternalEntity:
* @writer: the xmlTextWriterPtr
* @pe: TRUE if this is a parameter entity, FALSE if not
* @name: the name of the DTD entity
* @format: format string (see printf)
* @argptr: pointer to the first member of the variable argument list.
*
* Write a formatted DTD internal entity.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
int pe,
const char *format,
{
int rc;
return -1;
if (buf == 0)
return 0;
return rc;
}
/**
* xmlTextWriterWriteDTDEntity:
* @writer: the xmlTextWriterPtr
* @pe: TRUE if this is a parameter entity, FALSE if not
* @name: the name of the DTD entity
* @pubid: the public identifier, which is an alternative to the system identifier
* @sysid: the system identifier, which is the URI of the DTD
* @ndataid: the xml notation name.
* @content: content of the entity
*
* Write a DTD entity.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
int pe,
{
return -1;
return -1;
content);
}
/**
* xmlTextWriterWriteDTDInternalEntity:
* @writer: the xmlTextWriterPtr
* @pe: TRUE if this is a parameter entity, FALSE if not
* @name: the name of the DTD entity
* @content: content of the entity
*
* Write a DTD internal entity.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
int pe,
{
int count;
int sum;
return -1;
sum = 0;
if (count == -1)
return -1;
if (count == -1)
return -1;
if (count == -1)
return -1;
return sum;
}
/**
* xmlTextWriterWriteDTDExternalEntity:
* @writer: the xmlTextWriterPtr
* @pe: TRUE if this is a parameter entity, FALSE if not
* @name: the name of the DTD entity
* @pubid: the public identifier, which is an alternative to the system identifier
* @sysid: the system identifier, which is the URI of the DTD
* @ndataid: the xml notation name.
*
* Write a DTD external entity. The entity must have been started with xmlTextWriterStartDTDEntity
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
int pe,
{
int count;
int sum;
return -1;
return -1;
sum = 0;
if (count == -1)
return -1;
count =
ndataid);
if (count < 0)
return -1;
if (count == -1)
return -1;
return sum;
}
/**
* xmlTextWriterWriteDTDExternalEntityContents:
* @writer: the xmlTextWriterPtr
* @pubid: the public identifier, which is an alternative to the system identifier
* @sysid: the system identifier, which is the URI of the DTD
* @ndataid: the xml notation name.
*
* Write the contents of a DTD external entity.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
"xmlTextWriterWriteDTDExternalEntityContents: xmlTextWriterPtr invalid!\n");
return -1;
}
sum = 0;
if (lk == 0) {
"xmlTextWriterWriteDTDExternalEntityContents: you must call xmlTextWriterStartDTDEntity before the call to this function!\n");
return -1;
}
if (p == 0)
return -1;
switch (p->state) {
case XML_TEXTWRITER_DTD_ENTY:
break;
case XML_TEXTWRITER_DTD_PENT:
"xmlTextWriterWriteDTDExternalEntityContents: notation not allowed with parameter entities!\n");
return -1;
}
break;
default:
"xmlTextWriterWriteDTDExternalEntityContents: you must call xmlTextWriterStartDTDEntity before the call to this function!\n");
return -1;
}
if (pubid != 0) {
if (sysid == 0) {
"xmlTextWriterWriteDTDExternalEntityContents: system identifier needed!\n");
return -1;
}
if (count < 0)
return -1;
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
if (count < 0)
return -1;
}
if (sysid != 0) {
if (pubid == 0) {
if (count < 0)
return -1;
}
if (count < 0)
return -1;
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
if (count < 0)
return -1;
}
if (count < 0)
return -1;
count =
(const char *) ndataid);
if (count < 0)
return -1;
}
return sum;
}
/**
* xmlTextWriterWriteDTDNotation:
* @writer: the xmlTextWriterPtr
* @name: the name of the xml notation
* @pubid: the public identifier, which is an alternative to the system identifier
* @sysid: the system identifier, which is the URI of the DTD
*
* Write a DTD entity.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
int sum;
return -1;
sum = 0;
if (lk == 0) {
return -1;
}
if (p != 0) {
switch (p->state) {
case XML_TEXTWRITER_DTD:
if (count < 0)
return -1;
if (count < 0)
return -1;
}
p->state = XML_TEXTWRITER_DTD_TEXT;
/* fallthrough */
case XML_TEXTWRITER_DTD_TEXT:
break;
default:
return -1;
}
}
if (count < 0)
return -1;
}
if (count < 0)
return -1;
if (count < 0)
return -1;
if (pubid != 0) {
if (count < 0)
return -1;
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
if (count < 0)
return -1;
}
if (sysid != 0) {
if (pubid == 0) {
if (count < 0)
return -1;
}
if (count < 0)
return -1;
if (count < 0)
return -1;
count =
if (count < 0)
return -1;
if (count < 0)
return -1;
}
if (count < 0)
return -1;
return sum;
}
/**
* xmlTextWriterFlush:
* @writer: the xmlTextWriterPtr
*
* Flush the output buffer.
*
* Returns the bytes written (may be 0 because of buffering) or -1 in case of error
*/
int
{
int count;
return -1;
count = 0;
else
return count;
}
/**
* misc
*/
/**
* xmlFreeTextWriterStackEntry:
* @lk: the xmlLinkPtr
*
* Free callback for the xmlList.
*/
static void
{
if (p == 0)
return;
if (p->name != 0)
xmlFree(p);
}
/**
* xmlCmpTextWriterStackEntry:
* @data0: the first data
* @data1: the second data
*
* Compare callback for the xmlList.
*
* Returns -1, 0, 1
*/
static int
{
return 0;
if (data0 == 0)
return -1;
if (data1 == 0)
return 1;
}
/**
* misc
*/
/**
* xmlTextWriterOutputNSDecl:
* @writer: the xmlTextWriterPtr
*
* Output the current namespace declarations.
*/
static int
{
int count;
int sum;
sum = 0;
if (np != 0) {
}
if (np != 0) {
if (count < 0) {
return -1;
}
}
}
return sum;
}
/**
* xmlFreeTextWriterNsStackEntry:
* @lk: the xmlLinkPtr
*
* Free callback for the xmlList.
*/
static void
{
if (p == 0)
return;
if (p->prefix != 0)
if (p->uri != 0)
xmlFree(p);
}
/**
* xmlCmpTextWriterNsStackEntry:
* @data0: the first data
* @data1: the second data
*
* Compare callback for the xmlList.
*
* Returns -1, 0, 1
*/
static int
{
int rc;
return 0;
if (data0 == 0)
return -1;
if (data1 == 0)
return 1;
rc = -1;
return rc;
}
/**
* xmlTextWriterWriteDocCallback:
* @context: the xmlBufferPtr
* @str: the data to write
* @len: the length of the data
*
* Write callback for the xmlOutputBuffer with target xmlBuffer
*
* Returns -1, 0, 1
*/
static int
{
int rc;
"xmlTextWriterWriteDocCallback : XML error %d !\n",
rc);
return -1;
}
return len;
}
/**
* xmlTextWriterCloseDocCallback:
* @context: the xmlBufferPtr
*
* Close callback for the xmlOutputBuffer with target xmlBuffer
*
* Returns -1, 0, 1
*/
static int
{
int rc;
"xmlTextWriterWriteDocCallback : XML error %d !\n",
rc);
return -1;
}
return 0;
}
/**
* xmlTextWriterVSprintf:
* @format: see printf
* @argptr: pointer to the first member of the variable argument list.
*
* Utility function for formatted output
*
* Returns a new xmlChar buffer with the data or NULL on error. This buffer must be freed.
*/
static xmlChar *
{
int size;
int count;
"xmlTextWriterVSprintf : out of memory!\n");
return NULL;
}
"xmlTextWriterVSprintf : out of memory!\n");
return NULL;
}
}
return buf;
}
/**
* xmlTextWriterStartDocumentCallback:
* @ctx: the user data (XML parser context)
*
* called at the start of document processing.
*/
static void
{
#ifdef LIBXML_HTML_ENABLED
"SAX.startDocument(): out of memory\n");
return;
}
#else
"libxml2 built without HTML support\n");
return;
#endif
} else {
else
}
} else {
"SAX.startDocument(): out of memory\n");
return;
}
}
}
}
/**
* xmlTextWriterSetIndent:
* @writer: the xmlTextWriterPtr
* @indent: do indentation?
*
* Set indentation output. indent = 0 do not indentation. indent > 0 do indentation.
*
* Returns -1 on error or 0 otherwise.
*/
int
{
return -1;
return 0;
}
/**
* xmlTextWriterSetIndentString:
* @writer: the xmlTextWriterPtr
* @str: the xmlChar string
*
* Set string indentation.
*
* Returns -1 on error or 0 otherwise.
*/
int
{
return -1;
return -1;
else
return 0;
}
/**
* xmlTextWriterWriteIndent:
* @writer: the xmlTextWriterPtr
*
* Write indent string.
*
* Returns -1 on error or the number of strings written.
*/
static int
{
int lksize;
int i;
int ret;
if (lksize < 1)
return (-1); /* list is empty */
for (i = 0; i < (lksize - 1); i++) {
if (ret == -1)
return (-1);
}
return (lksize - 1);
}
/**
* xmlTextWriterHandleStateDependencies:
* @writer: the xmlTextWriterPtr
* @p: the xmlTextWriterStackEntry
*
* Write state dependent strings.
*
* Returns -1 on error or the number of characters written.
*/
static int
{
int count;
int sum;
return -1;
if (p == NULL)
return 0;
sum = 0;
if (p != 0) {
sum = 0;
switch (p->state) {
case XML_TEXTWRITER_NAME:
/* Output namespace declarations */
if (count < 0)
return -1;
extra[0] = '>';
p->state = XML_TEXTWRITER_TEXT;
break;
case XML_TEXTWRITER_PI:
extra[0] = ' ';
p->state = XML_TEXTWRITER_PI_TEXT;
break;
case XML_TEXTWRITER_DTD:
extra[0] = ' ';
p->state = XML_TEXTWRITER_DTD_TEXT;
break;
case XML_TEXTWRITER_DTD_ELEM:
extra[0] = ' ';
break;
case XML_TEXTWRITER_DTD_ATTL:
extra[0] = ' ';
break;
case XML_TEXTWRITER_DTD_ENTY:
case XML_TEXTWRITER_DTD_PENT:
extra[0] = ' ';
break;
default:
break;
}
}
if (*extra != '\0') {
if (count < 0)
return -1;
}
return sum;
}
#define bottom_xmlwriter
#include "elfgcchack.h"
#endif