mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
- HTMLparser.c HTMLtree.c SAX.c debugXML.c error.c parserInternals.c
testHTML.c testSAX.c tree.c valid.c xmlIO.c xmlmemory.c xmlversion.h.in xpointer.c: of course the way I defined UNUSED breaks on old gcc version. Try to be smart and also define it directly in xmlversion.h - configure.in: removed -ansi flag from the pedantic set Daniel
This commit is contained in:
11
ChangeLog
11
ChangeLog
@ -1,4 +1,13 @@
|
|||||||
Sat Mar 24 17:45:36 CET 2001
|
Mon Mar 26 18:24:52 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
|
|
||||||
|
* HTMLparser.c HTMLtree.c SAX.c debugXML.c error.c parserInternals.c
|
||||||
|
testHTML.c testSAX.c tree.c valid.c xmlIO.c xmlmemory.c
|
||||||
|
xmlversion.h.in xpointer.c: of course the way I defined
|
||||||
|
UNUSED breaks on old gcc version. Try to be smart and
|
||||||
|
also define it directly in xmlversion.h
|
||||||
|
* configure.in: removed -ansi flag from the pedantic set
|
||||||
|
|
||||||
|
Sat Mar 24 17:45:36 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||||
Huge cleanup, I switched to compile with
|
Huge cleanup, I switched to compile with
|
||||||
-Wall -g -O -ansi -pedantic -W -Wunused -Wimplicit
|
-Wall -g -O -ansi -pedantic -W -Wunused -Wimplicit
|
||||||
-Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat
|
-Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat
|
||||||
|
18
HTMLparser.c
18
HTMLparser.c
@ -56,18 +56,6 @@
|
|||||||
|
|
||||||
int htmlOmittedDefaultValue = 1;
|
int htmlOmittedDefaultValue = 1;
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
xmlChar * htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len,
|
xmlChar * htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len,
|
||||||
xmlChar end, xmlChar end2, xmlChar end3);
|
xmlChar end, xmlChar end2, xmlChar end3);
|
||||||
|
|
||||||
@ -1546,8 +1534,8 @@ htmlEncodeEntities(unsigned char* out, int *outlen,
|
|||||||
* must deallocate it !
|
* must deallocate it !
|
||||||
*/
|
*/
|
||||||
xmlChar *
|
xmlChar *
|
||||||
htmlDecodeEntities(htmlParserCtxtPtr ctxt UNUSED, int len UNUSED,
|
htmlDecodeEntities(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED,
|
||||||
xmlChar end UNUSED, xmlChar end2 UNUSED, xmlChar end3 UNUSED) {
|
xmlChar end ATTRIBUTE_UNUSED, xmlChar end2 ATTRIBUTE_UNUSED, xmlChar end3 ATTRIBUTE_UNUSED) {
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -3718,7 +3706,7 @@ htmlFreeParserCtxt(htmlParserCtxtPtr ctxt)
|
|||||||
* Returns the new parser context or NULL
|
* Returns the new parser context or NULL
|
||||||
*/
|
*/
|
||||||
static htmlParserCtxtPtr
|
static htmlParserCtxtPtr
|
||||||
htmlCreateDocParserCtxt(xmlChar *cur, const char *encoding UNUSED) {
|
htmlCreateDocParserCtxt(xmlChar *cur, const char *encoding ATTRIBUTE_UNUSED) {
|
||||||
htmlParserCtxtPtr ctxt;
|
htmlParserCtxtPtr ctxt;
|
||||||
htmlParserInputPtr input;
|
htmlParserInputPtr input;
|
||||||
/* htmlCharEncoding enc; */
|
/* htmlCharEncoding enc; */
|
||||||
|
16
HTMLtree.c
16
HTMLtree.c
@ -34,18 +34,6 @@
|
|||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
#include <libxml/parserInternals.h>
|
#include <libxml/parserInternals.h>
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Getting/Setting encoding meta tags *
|
* Getting/Setting encoding meta tags *
|
||||||
@ -698,7 +686,7 @@ htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
|
|||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
|
htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
|
||||||
const char *encoding UNUSED) {
|
const char *encoding ATTRIBUTE_UNUSED) {
|
||||||
xmlDtdPtr cur = doc->intSubset;
|
xmlDtdPtr cur = doc->intSubset;
|
||||||
|
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
@ -733,7 +721,7 @@ htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
|
|||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
|
htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
|
||||||
const char *encoding UNUSED) {
|
const char *encoding ATTRIBUTE_UNUSED) {
|
||||||
xmlChar *value;
|
xmlChar *value;
|
||||||
|
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
|
16
SAX.c
16
SAX.c
@ -32,13 +32,9 @@
|
|||||||
/* #define DEBUG_SAX_TREE */
|
/* #define DEBUG_SAX_TREE */
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#ifndef DEBUG_SAX
|
#ifdef DEBUG_SAX
|
||||||
#define UNUSED __attribute__((__unused__))
|
#define ATTRIBUTE_UNUSED
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,7 +46,7 @@
|
|||||||
* Returns a xmlChar *
|
* Returns a xmlChar *
|
||||||
*/
|
*/
|
||||||
const xmlChar *
|
const xmlChar *
|
||||||
getPublicId(void *ctx UNUSED)
|
getPublicId(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -658,7 +654,7 @@ unparsedEntityDecl(void *ctx, const xmlChar *name,
|
|||||||
* Everything is available on the context, so this is useless in our case.
|
* Everything is available on the context, so this is useless in our case.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
setDocumentLocator(void *ctx UNUSED, xmlSAXLocatorPtr loc UNUSED)
|
setDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
||||||
#ifdef DEBUG_SAX
|
#ifdef DEBUG_SAX
|
||||||
@ -1092,7 +1088,7 @@ startElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
|
|||||||
* called when the end of an element has been detected.
|
* called when the end of an element has been detected.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
endElement(void *ctx, const xmlChar *name UNUSED)
|
endElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||||
xmlParserNodeInfo node_info;
|
xmlParserNodeInfo node_info;
|
||||||
@ -1271,7 +1267,7 @@ characters(void *ctx, const xmlChar *ch, int len)
|
|||||||
* Question: how much at a time ???
|
* Question: how much at a time ???
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ignorableWhitespace(void *ctx UNUSED, const xmlChar *ch UNUSED, int len UNUSED)
|
ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
||||||
#ifdef DEBUG_SAX
|
#ifdef DEBUG_SAX
|
||||||
|
@ -237,8 +237,8 @@ dnl fi
|
|||||||
if test "${with_xptr}" = "" ; then
|
if test "${with_xptr}" = "" ; then
|
||||||
with_xptr="yes"
|
with_xptr="yes"
|
||||||
fi
|
fi
|
||||||
CFLAGS="-Wall -g -O -ansi -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline "
|
CFLAGS="-Wall -g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline "
|
||||||
dnl -Wcast-qual
|
dnl -Wcast-qual -ansi
|
||||||
fi
|
fi
|
||||||
dnl
|
dnl
|
||||||
dnl Aloow to disable various pieces
|
dnl Aloow to disable various pieces
|
||||||
|
46
debugXML.c
46
debugXML.c
@ -33,18 +33,6 @@
|
|||||||
#include <libxml/HTMLparser.h>
|
#include <libxml/HTMLparser.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IS_BLANK(c) \
|
#define IS_BLANK(c) \
|
||||||
(((c) == '\n') || ((c) == '\r') || ((c) == '\t') || ((c) == ' '))
|
(((c) == '\n') || ((c) == '\r') || ((c) == '\t') || ((c) == ' '))
|
||||||
|
|
||||||
@ -1087,8 +1075,8 @@ void xmlLsOneNode(FILE *output, xmlNodePtr node) {
|
|||||||
* Returns 0
|
* Returns 0
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlShellList(xmlShellCtxtPtr ctxt UNUSED , char *arg UNUSED, xmlNodePtr node,
|
xmlShellList(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED , char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
|
||||||
xmlNodePtr node2 UNUSED) {
|
xmlNodePtr node2 ATTRIBUTE_UNUSED) {
|
||||||
xmlNodePtr cur;
|
xmlNodePtr cur;
|
||||||
|
|
||||||
if ((node->type == XML_DOCUMENT_NODE) ||
|
if ((node->type == XML_DOCUMENT_NODE) ||
|
||||||
@ -1120,8 +1108,8 @@ xmlShellList(xmlShellCtxtPtr ctxt UNUSED , char *arg UNUSED, xmlNodePtr node,
|
|||||||
* Returns 0
|
* Returns 0
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlShellDir(xmlShellCtxtPtr ctxt UNUSED, char *arg UNUSED, xmlNodePtr node,
|
xmlShellDir(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
|
||||||
xmlNodePtr node2 UNUSED) {
|
xmlNodePtr node2 ATTRIBUTE_UNUSED) {
|
||||||
if ((node->type == XML_DOCUMENT_NODE) ||
|
if ((node->type == XML_DOCUMENT_NODE) ||
|
||||||
(node->type == XML_HTML_DOCUMENT_NODE)) {
|
(node->type == XML_HTML_DOCUMENT_NODE)) {
|
||||||
xmlDebugDumpDocumentHead(stdout, (xmlDocPtr) node);
|
xmlDebugDumpDocumentHead(stdout, (xmlDocPtr) node);
|
||||||
@ -1146,8 +1134,8 @@ xmlShellDir(xmlShellCtxtPtr ctxt UNUSED, char *arg UNUSED, xmlNodePtr node,
|
|||||||
* Returns 0
|
* Returns 0
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlShellCat(xmlShellCtxtPtr ctxt, char *arg UNUSED, xmlNodePtr node,
|
xmlShellCat(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
|
||||||
xmlNodePtr node2 UNUSED) {
|
xmlNodePtr node2 ATTRIBUTE_UNUSED) {
|
||||||
if (ctxt->doc->type == XML_HTML_DOCUMENT_NODE) {
|
if (ctxt->doc->type == XML_HTML_DOCUMENT_NODE) {
|
||||||
#ifdef LIBXML_HTML_ENABLED
|
#ifdef LIBXML_HTML_ENABLED
|
||||||
if (node->type == XML_HTML_DOCUMENT_NODE)
|
if (node->type == XML_HTML_DOCUMENT_NODE)
|
||||||
@ -1183,8 +1171,8 @@ xmlShellCat(xmlShellCtxtPtr ctxt, char *arg UNUSED, xmlNodePtr node,
|
|||||||
* Returns 0 or -1 if loading failed
|
* Returns 0 or -1 if loading failed
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlShellLoad(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node UNUSED,
|
xmlShellLoad(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node ATTRIBUTE_UNUSED,
|
||||||
xmlNodePtr node2 UNUSED) {
|
xmlNodePtr node2 ATTRIBUTE_UNUSED) {
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
int html = 0;
|
int html = 0;
|
||||||
|
|
||||||
@ -1236,7 +1224,7 @@ xmlShellLoad(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node UNUSED,
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlShellWrite(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
|
xmlShellWrite(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
|
||||||
xmlNodePtr node2 UNUSED) {
|
xmlNodePtr node2 ATTRIBUTE_UNUSED) {
|
||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
return(-1);
|
return(-1);
|
||||||
if ((filename == NULL) || (filename[0] == 0)) {
|
if ((filename == NULL) || (filename[0] == 0)) {
|
||||||
@ -1303,8 +1291,8 @@ xmlShellWrite(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
|
|||||||
* Returns 0 or -1 in case of error
|
* Returns 0 or -1 in case of error
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlShellSave(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node UNUSED,
|
xmlShellSave(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node ATTRIBUTE_UNUSED,
|
||||||
xmlNodePtr node2 UNUSED) {
|
xmlNodePtr node2 ATTRIBUTE_UNUSED) {
|
||||||
if (ctxt->doc == NULL)
|
if (ctxt->doc == NULL)
|
||||||
return(-1);
|
return(-1);
|
||||||
if ((filename == NULL) || (filename[0] == 0))
|
if ((filename == NULL) || (filename[0] == 0))
|
||||||
@ -1359,8 +1347,8 @@ xmlShellSave(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node UNUSED,
|
|||||||
* Returns 0 or -1 in case of error
|
* Returns 0 or -1 in case of error
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlShellValidate(xmlShellCtxtPtr ctxt, char *dtd, xmlNodePtr node UNUSED,
|
xmlShellValidate(xmlShellCtxtPtr ctxt, char *dtd, xmlNodePtr node ATTRIBUTE_UNUSED,
|
||||||
xmlNodePtr node2 UNUSED) {
|
xmlNodePtr node2 ATTRIBUTE_UNUSED) {
|
||||||
xmlValidCtxt vctxt;
|
xmlValidCtxt vctxt;
|
||||||
int res = -1;
|
int res = -1;
|
||||||
|
|
||||||
@ -1397,8 +1385,8 @@ xmlShellValidate(xmlShellCtxtPtr ctxt, char *dtd, xmlNodePtr node UNUSED,
|
|||||||
* Returns 0 or -1 in case of error
|
* Returns 0 or -1 in case of error
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlShellDu(xmlShellCtxtPtr ctxt UNUSED, char *arg UNUSED, xmlNodePtr tree,
|
xmlShellDu(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED, xmlNodePtr tree,
|
||||||
xmlNodePtr node2 UNUSED) {
|
xmlNodePtr node2 ATTRIBUTE_UNUSED) {
|
||||||
xmlNodePtr node;
|
xmlNodePtr node;
|
||||||
int indent = 0,i;
|
int indent = 0,i;
|
||||||
|
|
||||||
@ -1473,8 +1461,8 @@ xmlShellDu(xmlShellCtxtPtr ctxt UNUSED, char *arg UNUSED, xmlNodePtr tree,
|
|||||||
* Returns 0 or -1 in case of error
|
* Returns 0 or -1 in case of error
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlShellPwd(xmlShellCtxtPtr ctxt UNUSED, char *buffer, xmlNodePtr node,
|
xmlShellPwd(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *buffer, xmlNodePtr node,
|
||||||
xmlNodePtr node2 UNUSED) {
|
xmlNodePtr node2 ATTRIBUTE_UNUSED) {
|
||||||
xmlNodePtr cur, tmp, next;
|
xmlNodePtr cur, tmp, next;
|
||||||
char buf[500];
|
char buf[500];
|
||||||
char sep;
|
char sep;
|
||||||
|
7
error.c
7
error.c
@ -18,11 +18,6 @@
|
|||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
#include <libxml/xmlmemory.h>
|
#include <libxml/xmlmemory.h>
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Handling of out of context errors *
|
* Handling of out of context errors *
|
||||||
@ -38,7 +33,7 @@
|
|||||||
* Default handler for out of context error messages.
|
* Default handler for out of context error messages.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
xmlGenericErrorDefaultFunc(void *ctx UNUSED, const char *msg, ...) {
|
xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
if (xmlGenericErrorContext == NULL)
|
if (xmlGenericErrorContext == NULL)
|
||||||
|
@ -121,6 +121,15 @@ extern void xmlCheckVersion(int version);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#include <ansidecl.h>
|
||||||
|
#ifndef ATTRIBUTE_UNUSED
|
||||||
|
#define ATTRIBUTE_UNUSED
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define ATTRIBUTE_UNUSED
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
@ -48,18 +48,6 @@
|
|||||||
#include <libxml/xmlIO.h>
|
#include <libxml/xmlIO.h>
|
||||||
#include <libxml/uri.h>
|
#include <libxml/uri.h>
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void xmlUpgradeOldNs(xmlDocPtr doc);
|
void xmlUpgradeOldNs(xmlDocPtr doc);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@ -1545,7 +1533,7 @@ xmlCopyCharMultiByte(xmlChar *out, int val) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
xmlCopyChar(int len UNUSED, xmlChar *out, int val) {
|
xmlCopyChar(int len ATTRIBUTE_UNUSED, xmlChar *out, int val) {
|
||||||
/* the len parameter is ignored */
|
/* the len parameter is ignored */
|
||||||
if (val >= 0x80) {
|
if (val >= 0x80) {
|
||||||
return(xmlCopyCharMultiByte (out, val));
|
return(xmlCopyCharMultiByte (out, val));
|
||||||
@ -2597,8 +2585,8 @@ xmlCheckLanguageID(const xmlChar *lang) {
|
|||||||
* must deallocate it !
|
* must deallocate it !
|
||||||
*/
|
*/
|
||||||
xmlChar *
|
xmlChar *
|
||||||
xmlDecodeEntities(xmlParserCtxtPtr ctxt UNUSED, int len UNUSED, int what UNUSED,
|
xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED,
|
||||||
xmlChar end UNUSED, xmlChar end2 UNUSED, xmlChar end3 UNUSED) {
|
xmlChar end ATTRIBUTE_UNUSED, xmlChar end2 ATTRIBUTE_UNUSED, xmlChar end3 ATTRIBUTE_UNUSED) {
|
||||||
#if 0
|
#if 0
|
||||||
xmlChar *buffer = NULL;
|
xmlChar *buffer = NULL;
|
||||||
unsigned int buffer_size = 0;
|
unsigned int buffer_size = 0;
|
||||||
@ -2731,7 +2719,7 @@ xmlDecodeEntities(xmlParserCtxtPtr ctxt UNUSED, int len UNUSED, int what UNUSED,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
xmlChar *
|
xmlChar *
|
||||||
xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt UNUSED) {
|
xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) {
|
||||||
#if 0
|
#if 0
|
||||||
xmlChar buf[XML_MAX_NAMELEN + 5];
|
xmlChar buf[XML_MAX_NAMELEN + 5];
|
||||||
int len = 0, l;
|
int len = 0, l;
|
||||||
@ -2800,7 +2788,7 @@ xmlGenericError(xmlGenericErrorContext,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
xmlChar *
|
xmlChar *
|
||||||
xmlNamespaceParseQName(xmlParserCtxtPtr ctxt UNUSED, xmlChar **prefix UNUSED) {
|
xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlChar **prefix ATTRIBUTE_UNUSED) {
|
||||||
|
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
@ -2842,7 +2830,7 @@ xmlNamespaceParseQName(xmlParserCtxtPtr ctxt UNUSED, xmlChar **prefix UNUSED) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
xmlChar *
|
xmlChar *
|
||||||
xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt UNUSED) {
|
xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) {
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -2877,7 +2865,7 @@ xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt UNUSED) {
|
|||||||
* Returns the string parser or NULL.
|
* Returns the string parser or NULL.
|
||||||
*/
|
*/
|
||||||
xmlChar *
|
xmlChar *
|
||||||
xmlParseQuotedString(xmlParserCtxtPtr ctxt UNUSED) {
|
xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) {
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -2975,7 +2963,7 @@ xmlGenericError(xmlGenericErrorContext,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
xmlParseNamespace(xmlParserCtxtPtr ctxt UNUSED) {
|
xmlParseNamespace(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) {
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -3102,7 +3090,7 @@ xmlGenericError(xmlGenericErrorContext,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
xmlChar *
|
xmlChar *
|
||||||
xmlScanName(xmlParserCtxtPtr ctxt UNUSED) {
|
xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) {
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -3175,7 +3163,7 @@ xmlScanName(xmlParserCtxtPtr ctxt UNUSED) {
|
|||||||
* http://www.w3.org/TR/REC-xml#entproc
|
* http://www.w3.org/TR/REC-xml#entproc
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
xmlParserHandleReference(xmlParserCtxtPtr ctxt UNUSED) {
|
xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) {
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -3421,7 +3409,7 @@ xmlGenericError(xmlGenericErrorContext,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
xmlHandleEntity(xmlParserCtxtPtr ctxt UNUSED, xmlEntityPtr entity UNUSED) {
|
xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlEntityPtr entity ATTRIBUTE_UNUSED) {
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -3474,8 +3462,8 @@ handle_as_char:
|
|||||||
* Returns NULL this functionnality had been removed
|
* Returns NULL this functionnality had been removed
|
||||||
*/
|
*/
|
||||||
xmlNsPtr
|
xmlNsPtr
|
||||||
xmlNewGlobalNs(xmlDocPtr doc UNUSED, const xmlChar *href UNUSED,
|
xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED,
|
||||||
const xmlChar *prefix UNUSED) {
|
const xmlChar *prefix ATTRIBUTE_UNUSED) {
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
@ -3536,7 +3524,7 @@ xmlNewGlobalNs(xmlDocPtr doc UNUSED, const xmlChar *href UNUSED,
|
|||||||
* DEPRECATED
|
* DEPRECATED
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
xmlUpgradeOldNs(xmlDocPtr doc UNUSED) {
|
xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED) {
|
||||||
static int deprecated = 0;
|
static int deprecated = 0;
|
||||||
if (!deprecated) {
|
if (!deprecated) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
|
68
testHTML.c
68
testHTML.c
@ -43,18 +43,6 @@
|
|||||||
#include <libxml/debugXML.h>
|
#include <libxml/debugXML.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LIBXML_DEBUG_ENABLED
|
#ifdef LIBXML_DEBUG_ENABLED
|
||||||
static int debug = 0;
|
static int debug = 0;
|
||||||
#endif
|
#endif
|
||||||
@ -113,7 +101,7 @@ extern xmlSAXHandlerPtr debugSAXHandler;
|
|||||||
* Returns 1 if true
|
* Returns 1 if true
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
isStandaloneDebug(void *ctx UNUSED)
|
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.isStandalone()\n");
|
fprintf(stdout, "SAX.isStandalone()\n");
|
||||||
return(0);
|
return(0);
|
||||||
@ -128,7 +116,7 @@ isStandaloneDebug(void *ctx UNUSED)
|
|||||||
* Returns 1 if true
|
* Returns 1 if true
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
hasInternalSubsetDebug(void *ctx UNUSED)
|
hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.hasInternalSubset()\n");
|
fprintf(stdout, "SAX.hasInternalSubset()\n");
|
||||||
return(0);
|
return(0);
|
||||||
@ -143,7 +131,7 @@ hasInternalSubsetDebug(void *ctx UNUSED)
|
|||||||
* Returns 1 if true
|
* Returns 1 if true
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
hasExternalSubsetDebug(void *ctx UNUSED)
|
hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.hasExternalSubset()\n");
|
fprintf(stdout, "SAX.hasExternalSubset()\n");
|
||||||
return(0);
|
return(0);
|
||||||
@ -156,7 +144,7 @@ hasExternalSubsetDebug(void *ctx UNUSED)
|
|||||||
* Does this document has an internal subset
|
* Does this document has an internal subset
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
internalSubsetDebug(void *ctx UNUSED, const xmlChar *name,
|
internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||||
const xmlChar *ExternalID, const xmlChar *SystemID)
|
const xmlChar *ExternalID, const xmlChar *SystemID)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.internalSubset(%s,", name);
|
fprintf(stdout, "SAX.internalSubset(%s,", name);
|
||||||
@ -185,7 +173,7 @@ internalSubsetDebug(void *ctx UNUSED, const xmlChar *name,
|
|||||||
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
||||||
*/
|
*/
|
||||||
static xmlParserInputPtr
|
static xmlParserInputPtr
|
||||||
resolveEntityDebug(void *ctx UNUSED, const xmlChar *publicId, const xmlChar *systemId)
|
resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
|
||||||
{
|
{
|
||||||
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
||||||
|
|
||||||
@ -217,7 +205,7 @@ resolveEntityDebug(void *ctx UNUSED, const xmlChar *publicId, const xmlChar *sys
|
|||||||
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
||||||
*/
|
*/
|
||||||
static xmlEntityPtr
|
static xmlEntityPtr
|
||||||
getEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.getEntity(%s)\n", name);
|
fprintf(stdout, "SAX.getEntity(%s)\n", name);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -233,7 +221,7 @@ getEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
|||||||
* Returns the xmlParserInputPtr
|
* Returns the xmlParserInputPtr
|
||||||
*/
|
*/
|
||||||
static xmlEntityPtr
|
static xmlEntityPtr
|
||||||
getParameterEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
|
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -252,7 +240,7 @@ getParameterEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
|||||||
* An entity definition has been parsed
|
* An entity definition has been parsed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
entityDeclDebug(void *ctx UNUSED, const xmlChar *name, int type,
|
entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
|
||||||
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
|
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
|
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
|
||||||
@ -268,9 +256,9 @@ entityDeclDebug(void *ctx UNUSED, const xmlChar *name, int type,
|
|||||||
* An attribute definition has been parsed
|
* An attribute definition has been parsed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
attributeDeclDebug(void *ctx UNUSED, const xmlChar *elem, const xmlChar *name,
|
attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *elem, const xmlChar *name,
|
||||||
int type, int def, const xmlChar *defaultValue,
|
int type, int def, const xmlChar *defaultValue,
|
||||||
xmlEnumerationPtr tree UNUSED)
|
xmlEnumerationPtr tree ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
|
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
|
||||||
elem, name, type, def, defaultValue);
|
elem, name, type, def, defaultValue);
|
||||||
@ -286,8 +274,8 @@ attributeDeclDebug(void *ctx UNUSED, const xmlChar *elem, const xmlChar *name,
|
|||||||
* An element definition has been parsed
|
* An element definition has been parsed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
elementDeclDebug(void *ctx UNUSED, const xmlChar *name, int type,
|
elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
|
||||||
xmlElementContentPtr content UNUSED)
|
xmlElementContentPtr content ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
|
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
|
||||||
name, type);
|
name, type);
|
||||||
@ -303,7 +291,7 @@ elementDeclDebug(void *ctx UNUSED, const xmlChar *name, int type,
|
|||||||
* What to do when a notation declaration has been parsed.
|
* What to do when a notation declaration has been parsed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
notationDeclDebug(void *ctx UNUSED, const xmlChar *name,
|
notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||||
const xmlChar *publicId, const xmlChar *systemId)
|
const xmlChar *publicId, const xmlChar *systemId)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
|
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
|
||||||
@ -321,7 +309,7 @@ notationDeclDebug(void *ctx UNUSED, const xmlChar *name,
|
|||||||
* What to do when an unparsed entity declaration is parsed
|
* What to do when an unparsed entity declaration is parsed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
unparsedEntityDeclDebug(void *ctx UNUSED, const xmlChar *name,
|
unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||||
const xmlChar *publicId, const xmlChar *systemId,
|
const xmlChar *publicId, const xmlChar *systemId,
|
||||||
const xmlChar *notationName)
|
const xmlChar *notationName)
|
||||||
{
|
{
|
||||||
@ -339,7 +327,7 @@ unparsedEntityDeclDebug(void *ctx UNUSED, const xmlChar *name,
|
|||||||
* Everything is available on the context, so this is useless in our case.
|
* Everything is available on the context, so this is useless in our case.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
setDocumentLocatorDebug(void *ctx UNUSED, xmlSAXLocatorPtr loc UNUSED)
|
setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.setDocumentLocator()\n");
|
fprintf(stdout, "SAX.setDocumentLocator()\n");
|
||||||
}
|
}
|
||||||
@ -351,7 +339,7 @@ setDocumentLocatorDebug(void *ctx UNUSED, xmlSAXLocatorPtr loc UNUSED)
|
|||||||
* called when the document start being processed.
|
* called when the document start being processed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
startDocumentDebug(void *ctx UNUSED)
|
startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.startDocument()\n");
|
fprintf(stdout, "SAX.startDocument()\n");
|
||||||
}
|
}
|
||||||
@ -363,7 +351,7 @@ startDocumentDebug(void *ctx UNUSED)
|
|||||||
* called when the document end has been detected.
|
* called when the document end has been detected.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
endDocumentDebug(void *ctx UNUSED)
|
endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.endDocument()\n");
|
fprintf(stdout, "SAX.endDocument()\n");
|
||||||
}
|
}
|
||||||
@ -376,7 +364,7 @@ endDocumentDebug(void *ctx UNUSED)
|
|||||||
* called when an opening tag has been processed.
|
* called when an opening tag has been processed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
startElementDebug(void *ctx UNUSED, const xmlChar *name, const xmlChar **atts)
|
startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -410,7 +398,7 @@ startElementDebug(void *ctx UNUSED, const xmlChar *name, const xmlChar **atts)
|
|||||||
* called when the end of an element has been detected.
|
* called when the end of an element has been detected.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
endElementDebug(void *ctx UNUSED, const xmlChar *name)
|
endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
|
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
|
||||||
}
|
}
|
||||||
@ -425,7 +413,7 @@ endElementDebug(void *ctx UNUSED, const xmlChar *name)
|
|||||||
* Question: how much at a time ???
|
* Question: how much at a time ???
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
charactersDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
|
||||||
{
|
{
|
||||||
unsigned char output[40];
|
unsigned char output[40];
|
||||||
int inlen = len, outlen = 30;
|
int inlen = len, outlen = 30;
|
||||||
@ -446,7 +434,7 @@ charactersDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
|||||||
* Question: how much at a time ???
|
* Question: how much at a time ???
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cdataDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
cdataDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
|
||||||
{
|
{
|
||||||
unsigned char output[40];
|
unsigned char output[40];
|
||||||
int inlen = len, outlen = 30;
|
int inlen = len, outlen = 30;
|
||||||
@ -465,7 +453,7 @@ cdataDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
|||||||
* called when an entity reference is detected.
|
* called when an entity reference is detected.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
referenceDebug(void *ctx UNUSED, const xmlChar *name)
|
referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.reference(%s)\n", name);
|
fprintf(stdout, "SAX.reference(%s)\n", name);
|
||||||
}
|
}
|
||||||
@ -481,7 +469,7 @@ referenceDebug(void *ctx UNUSED, const xmlChar *name)
|
|||||||
* Question: how much at a time ???
|
* Question: how much at a time ???
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ignorableWhitespaceDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
|
||||||
{
|
{
|
||||||
char output[40];
|
char output[40];
|
||||||
int i;
|
int i;
|
||||||
@ -503,7 +491,7 @@ ignorableWhitespaceDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
|||||||
* A processing instruction has been parsed.
|
* A processing instruction has been parsed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
processingInstructionDebug(void *ctx UNUSED, const xmlChar *target,
|
processingInstructionDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *target,
|
||||||
const xmlChar *data)
|
const xmlChar *data)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
|
fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
|
||||||
@ -518,7 +506,7 @@ processingInstructionDebug(void *ctx UNUSED, const xmlChar *target,
|
|||||||
* A comment has been parsed.
|
* A comment has been parsed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
commentDebug(void *ctx UNUSED, const xmlChar *value)
|
commentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.comment(%s)\n", value);
|
fprintf(stdout, "SAX.comment(%s)\n", value);
|
||||||
}
|
}
|
||||||
@ -533,7 +521,7 @@ commentDebug(void *ctx UNUSED, const xmlChar *value)
|
|||||||
* extra parameters.
|
* extra parameters.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
warningDebug(void *ctx UNUSED, const char *msg, ...)
|
warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
@ -553,7 +541,7 @@ warningDebug(void *ctx UNUSED, const char *msg, ...)
|
|||||||
* extra parameters.
|
* extra parameters.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
errorDebug(void *ctx UNUSED, const char *msg, ...)
|
errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
@ -573,7 +561,7 @@ errorDebug(void *ctx UNUSED, const char *msg, ...)
|
|||||||
* extra parameters.
|
* extra parameters.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
fatalErrorDebug(void *ctx UNUSED, const char *msg, ...)
|
fatalErrorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
|
70
testSAX.c
70
testSAX.c
@ -44,18 +44,6 @@
|
|||||||
#include <libxml/debugXML.h>
|
#include <libxml/debugXML.h>
|
||||||
#include <libxml/xmlmemory.h>
|
#include <libxml/xmlmemory.h>
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int debug = 0;
|
static int debug = 0;
|
||||||
static int copy = 0;
|
static int copy = 0;
|
||||||
static int recovery = 0;
|
static int recovery = 0;
|
||||||
@ -110,7 +98,7 @@ extern xmlSAXHandlerPtr debugSAXHandler;
|
|||||||
* Returns 1 if true
|
* Returns 1 if true
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
isStandaloneDebug(void *ctx UNUSED)
|
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.isStandalone()\n");
|
fprintf(stdout, "SAX.isStandalone()\n");
|
||||||
return(0);
|
return(0);
|
||||||
@ -125,7 +113,7 @@ isStandaloneDebug(void *ctx UNUSED)
|
|||||||
* Returns 1 if true
|
* Returns 1 if true
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
hasInternalSubsetDebug(void *ctx UNUSED)
|
hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.hasInternalSubset()\n");
|
fprintf(stdout, "SAX.hasInternalSubset()\n");
|
||||||
return(0);
|
return(0);
|
||||||
@ -140,7 +128,7 @@ hasInternalSubsetDebug(void *ctx UNUSED)
|
|||||||
* Returns 1 if true
|
* Returns 1 if true
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
hasExternalSubsetDebug(void *ctx UNUSED)
|
hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.hasExternalSubset()\n");
|
fprintf(stdout, "SAX.hasExternalSubset()\n");
|
||||||
return(0);
|
return(0);
|
||||||
@ -153,7 +141,7 @@ hasExternalSubsetDebug(void *ctx UNUSED)
|
|||||||
* Does this document has an internal subset
|
* Does this document has an internal subset
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
internalSubsetDebug(void *ctx UNUSED, const xmlChar *name,
|
internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||||
const xmlChar *ExternalID, const xmlChar *SystemID)
|
const xmlChar *ExternalID, const xmlChar *SystemID)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.internalSubset(%s,", name);
|
fprintf(stdout, "SAX.internalSubset(%s,", name);
|
||||||
@ -174,7 +162,7 @@ internalSubsetDebug(void *ctx UNUSED, const xmlChar *name,
|
|||||||
* Does this document has an external subset
|
* Does this document has an external subset
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
externalSubsetDebug(void *ctx UNUSED, const xmlChar *name,
|
externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||||
const xmlChar *ExternalID, const xmlChar *SystemID)
|
const xmlChar *ExternalID, const xmlChar *SystemID)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.externalSubset(%s,", name);
|
fprintf(stdout, "SAX.externalSubset(%s,", name);
|
||||||
@ -203,7 +191,7 @@ externalSubsetDebug(void *ctx UNUSED, const xmlChar *name,
|
|||||||
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
||||||
*/
|
*/
|
||||||
static xmlParserInputPtr
|
static xmlParserInputPtr
|
||||||
resolveEntityDebug(void *ctx UNUSED, const xmlChar *publicId, const xmlChar *systemId)
|
resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
|
||||||
{
|
{
|
||||||
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
|
||||||
|
|
||||||
@ -235,7 +223,7 @@ resolveEntityDebug(void *ctx UNUSED, const xmlChar *publicId, const xmlChar *sys
|
|||||||
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
||||||
*/
|
*/
|
||||||
static xmlEntityPtr
|
static xmlEntityPtr
|
||||||
getEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.getEntity(%s)\n", name);
|
fprintf(stdout, "SAX.getEntity(%s)\n", name);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -251,7 +239,7 @@ getEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
|||||||
* Returns the xmlParserInputPtr
|
* Returns the xmlParserInputPtr
|
||||||
*/
|
*/
|
||||||
static xmlEntityPtr
|
static xmlEntityPtr
|
||||||
getParameterEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
|
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
@ -270,7 +258,7 @@ getParameterEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
|||||||
* An entity definition has been parsed
|
* An entity definition has been parsed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
entityDeclDebug(void *ctx UNUSED, const xmlChar *name, int type,
|
entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
|
||||||
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
|
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
|
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
|
||||||
@ -286,9 +274,9 @@ entityDeclDebug(void *ctx UNUSED, const xmlChar *name, int type,
|
|||||||
* An attribute definition has been parsed
|
* An attribute definition has been parsed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
attributeDeclDebug(void *ctx UNUSED, const xmlChar *elem, const xmlChar *name,
|
attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *elem, const xmlChar *name,
|
||||||
int type, int def, const xmlChar *defaultValue,
|
int type, int def, const xmlChar *defaultValue,
|
||||||
xmlEnumerationPtr tree UNUSED)
|
xmlEnumerationPtr tree ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
if (defaultValue == NULL)
|
if (defaultValue == NULL)
|
||||||
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, NULL, ...)\n",
|
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, NULL, ...)\n",
|
||||||
@ -308,8 +296,8 @@ attributeDeclDebug(void *ctx UNUSED, const xmlChar *elem, const xmlChar *name,
|
|||||||
* An element definition has been parsed
|
* An element definition has been parsed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
elementDeclDebug(void *ctx UNUSED, const xmlChar *name, int type,
|
elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
|
||||||
xmlElementContentPtr content UNUSED)
|
xmlElementContentPtr content ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
|
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
|
||||||
name, type);
|
name, type);
|
||||||
@ -325,7 +313,7 @@ elementDeclDebug(void *ctx UNUSED, const xmlChar *name, int type,
|
|||||||
* What to do when a notation declaration has been parsed.
|
* What to do when a notation declaration has been parsed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
notationDeclDebug(void *ctx UNUSED, const xmlChar *name,
|
notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||||
const xmlChar *publicId, const xmlChar *systemId)
|
const xmlChar *publicId, const xmlChar *systemId)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
|
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
|
||||||
@ -343,7 +331,7 @@ notationDeclDebug(void *ctx UNUSED, const xmlChar *name,
|
|||||||
* What to do when an unparsed entity declaration is parsed
|
* What to do when an unparsed entity declaration is parsed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
unparsedEntityDeclDebug(void *ctx UNUSED, const xmlChar *name,
|
unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||||
const xmlChar *publicId, const xmlChar *systemId,
|
const xmlChar *publicId, const xmlChar *systemId,
|
||||||
const xmlChar *notationName)
|
const xmlChar *notationName)
|
||||||
{
|
{
|
||||||
@ -361,7 +349,7 @@ unparsedEntityDeclDebug(void *ctx UNUSED, const xmlChar *name,
|
|||||||
* Everything is available on the context, so this is useless in our case.
|
* Everything is available on the context, so this is useless in our case.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
setDocumentLocatorDebug(void *ctx UNUSED, xmlSAXLocatorPtr loc UNUSED)
|
setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.setDocumentLocator()\n");
|
fprintf(stdout, "SAX.setDocumentLocator()\n");
|
||||||
}
|
}
|
||||||
@ -373,7 +361,7 @@ setDocumentLocatorDebug(void *ctx UNUSED, xmlSAXLocatorPtr loc UNUSED)
|
|||||||
* called when the document start being processed.
|
* called when the document start being processed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
startDocumentDebug(void *ctx UNUSED)
|
startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.startDocument()\n");
|
fprintf(stdout, "SAX.startDocument()\n");
|
||||||
}
|
}
|
||||||
@ -385,7 +373,7 @@ startDocumentDebug(void *ctx UNUSED)
|
|||||||
* called when the document end has been detected.
|
* called when the document end has been detected.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
endDocumentDebug(void *ctx UNUSED)
|
endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.endDocument()\n");
|
fprintf(stdout, "SAX.endDocument()\n");
|
||||||
}
|
}
|
||||||
@ -398,7 +386,7 @@ endDocumentDebug(void *ctx UNUSED)
|
|||||||
* called when an opening tag has been processed.
|
* called when an opening tag has been processed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
startElementDebug(void *ctx UNUSED, const xmlChar *name, const xmlChar **atts)
|
startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -421,7 +409,7 @@ startElementDebug(void *ctx UNUSED, const xmlChar *name, const xmlChar **atts)
|
|||||||
* called when the end of an element has been detected.
|
* called when the end of an element has been detected.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
endElementDebug(void *ctx UNUSED, const xmlChar *name)
|
endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
|
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
|
||||||
}
|
}
|
||||||
@ -436,7 +424,7 @@ endElementDebug(void *ctx UNUSED, const xmlChar *name)
|
|||||||
* Question: how much at a time ???
|
* Question: how much at a time ???
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
charactersDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
|
||||||
{
|
{
|
||||||
char output[40];
|
char output[40];
|
||||||
int i;
|
int i;
|
||||||
@ -456,7 +444,7 @@ charactersDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
|||||||
* called when an entity reference is detected.
|
* called when an entity reference is detected.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
referenceDebug(void *ctx UNUSED, const xmlChar *name)
|
referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.reference(%s)\n", name);
|
fprintf(stdout, "SAX.reference(%s)\n", name);
|
||||||
}
|
}
|
||||||
@ -472,7 +460,7 @@ referenceDebug(void *ctx UNUSED, const xmlChar *name)
|
|||||||
* Question: how much at a time ???
|
* Question: how much at a time ???
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ignorableWhitespaceDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
|
||||||
{
|
{
|
||||||
char output[40];
|
char output[40];
|
||||||
int i;
|
int i;
|
||||||
@ -493,7 +481,7 @@ ignorableWhitespaceDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
|||||||
* A processing instruction has been parsed.
|
* A processing instruction has been parsed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
processingInstructionDebug(void *ctx UNUSED, const xmlChar *target,
|
processingInstructionDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *target,
|
||||||
const xmlChar *data)
|
const xmlChar *data)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
|
fprintf(stdout, "SAX.processingInstruction(%s, %s)\n",
|
||||||
@ -509,7 +497,7 @@ processingInstructionDebug(void *ctx UNUSED, const xmlChar *target,
|
|||||||
* called when a pcdata block has been parsed
|
* called when a pcdata block has been parsed
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
cdataBlockDebug(void *ctx UNUSED, const xmlChar *value, int len)
|
cdataBlockDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value, int len)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.pcdata(%.20s, %d)\n",
|
fprintf(stdout, "SAX.pcdata(%.20s, %d)\n",
|
||||||
(char *) value, len);
|
(char *) value, len);
|
||||||
@ -523,7 +511,7 @@ cdataBlockDebug(void *ctx UNUSED, const xmlChar *value, int len)
|
|||||||
* A comment has been parsed.
|
* A comment has been parsed.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
commentDebug(void *ctx UNUSED, const xmlChar *value)
|
commentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "SAX.comment(%s)\n", value);
|
fprintf(stdout, "SAX.comment(%s)\n", value);
|
||||||
}
|
}
|
||||||
@ -538,7 +526,7 @@ commentDebug(void *ctx UNUSED, const xmlChar *value)
|
|||||||
* extra parameters.
|
* extra parameters.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
warningDebug(void *ctx UNUSED, const char *msg, ...)
|
warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
@ -558,7 +546,7 @@ warningDebug(void *ctx UNUSED, const char *msg, ...)
|
|||||||
* extra parameters.
|
* extra parameters.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
errorDebug(void *ctx UNUSED, const char *msg, ...)
|
errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
@ -578,7 +566,7 @@ errorDebug(void *ctx UNUSED, const char *msg, ...)
|
|||||||
* extra parameters.
|
* extra parameters.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
fatalErrorDebug(void *ctx UNUSED, const char *msg, ...)
|
fatalErrorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
|
18
tree.c
18
tree.c
@ -37,18 +37,6 @@
|
|||||||
#include <libxml/valid.h>
|
#include <libxml/valid.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
xmlNsPtr xmlNewReconciliedNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns);
|
xmlNsPtr xmlNewReconciliedNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns);
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@ -3620,7 +3608,7 @@ xmlTextMerge(xmlNodePtr first, xmlNodePtr second) {
|
|||||||
* namespace if defined
|
* namespace if defined
|
||||||
*/
|
*/
|
||||||
xmlNsPtr *
|
xmlNsPtr *
|
||||||
xmlGetNsList(xmlDocPtr doc UNUSED, xmlNodePtr node) {
|
xmlGetNsList(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node) {
|
||||||
xmlNsPtr cur;
|
xmlNsPtr cur;
|
||||||
xmlNsPtr *ret = NULL;
|
xmlNsPtr *ret = NULL;
|
||||||
int nbns = 0;
|
int nbns = 0;
|
||||||
@ -5441,7 +5429,7 @@ xmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDtdPtr dtd, const char *encoding) {
|
|||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
xmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
|
xmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
|
||||||
const char *encoding UNUSED) {
|
const char *encoding ATTRIBUTE_UNUSED) {
|
||||||
xmlChar *value;
|
xmlChar *value;
|
||||||
|
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
@ -5798,7 +5786,7 @@ xmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
|
|||||||
void
|
void
|
||||||
xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr,
|
xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr,
|
||||||
int * doc_txt_len, const char * txt_encoding,
|
int * doc_txt_len, const char * txt_encoding,
|
||||||
int format UNUSED) {
|
int format ATTRIBUTE_UNUSED) {
|
||||||
int dummy = 0;
|
int dummy = 0;
|
||||||
|
|
||||||
xmlCharEncoding doc_charset;
|
xmlCharEncoding doc_charset;
|
||||||
|
26
valid.c
26
valid.c
@ -28,18 +28,6 @@
|
|||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
#include <libxml/list.h>
|
#include <libxml/list.h>
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generic function for accessing stacks in the Validity Context
|
* Generic function for accessing stacks in the Validity Context
|
||||||
*/
|
*/
|
||||||
@ -862,7 +850,7 @@ xmlCreateAttributeTable(void) {
|
|||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
xmlScanAttributeDeclCallback(xmlAttributePtr attr, xmlAttributePtr *list,
|
xmlScanAttributeDeclCallback(xmlAttributePtr attr, xmlAttributePtr *list,
|
||||||
const xmlChar* name UNUSED) {
|
const xmlChar* name ATTRIBUTE_UNUSED) {
|
||||||
attr->nexth = *list;
|
attr->nexth = *list;
|
||||||
*list = attr;
|
*list = attr;
|
||||||
}
|
}
|
||||||
@ -1319,7 +1307,7 @@ xmlFreeNotation(xmlNotationPtr nota) {
|
|||||||
* Returns NULL if not, othervise the entity
|
* Returns NULL if not, othervise the entity
|
||||||
*/
|
*/
|
||||||
xmlNotationPtr
|
xmlNotationPtr
|
||||||
xmlAddNotationDecl(xmlValidCtxtPtr ctxt UNUSED, xmlDtdPtr dtd,
|
xmlAddNotationDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlDtdPtr dtd,
|
||||||
const xmlChar *name,
|
const xmlChar *name,
|
||||||
const xmlChar *PublicID, const xmlChar *SystemID) {
|
const xmlChar *PublicID, const xmlChar *SystemID) {
|
||||||
xmlNotationPtr ret;
|
xmlNotationPtr ret;
|
||||||
@ -1793,7 +1781,7 @@ xmlWalkRemoveRef(const void *data, const void *user)
|
|||||||
* Returns NULL if not, othervise the new xmlRefPtr
|
* Returns NULL if not, othervise the new xmlRefPtr
|
||||||
*/
|
*/
|
||||||
xmlRefPtr
|
xmlRefPtr
|
||||||
xmlAddRef(xmlValidCtxtPtr ctxt UNUSED, xmlDocPtr doc, const xmlChar *value,
|
xmlAddRef(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlDocPtr doc, const xmlChar *value,
|
||||||
xmlAttrPtr attr) {
|
xmlAttrPtr attr) {
|
||||||
xmlRefPtr ret;
|
xmlRefPtr ret;
|
||||||
xmlRefTablePtr table;
|
xmlRefTablePtr table;
|
||||||
@ -2394,8 +2382,8 @@ xmlValidateNmtokensValue(const xmlChar *value) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
xmlValidateNotationDecl(xmlValidCtxtPtr ctxt UNUSED, xmlDocPtr doc UNUSED,
|
xmlValidateNotationDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlDocPtr doc ATTRIBUTE_UNUSED,
|
||||||
xmlNotationPtr nota UNUSED) {
|
xmlNotationPtr nota ATTRIBUTE_UNUSED) {
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
return(ret);
|
return(ret);
|
||||||
@ -2633,7 +2621,7 @@ xmlValidNormalizeAttributeValue(xmlDocPtr doc, xmlNodePtr elem,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
xmlValidateAttributeIdCallback(xmlAttributePtr attr, int *count,
|
xmlValidateAttributeIdCallback(xmlAttributePtr attr, int *count,
|
||||||
const xmlChar* name UNUSED) {
|
const xmlChar* name ATTRIBUTE_UNUSED) {
|
||||||
if (attr->atype == XML_ATTRIBUTE_ID) (*count)++;
|
if (attr->atype == XML_ATTRIBUTE_ID) (*count)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3911,7 +3899,7 @@ xmlValidateDtd(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlDtdPtr dtd) {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
xmlValidateAttributeCallback(xmlAttributePtr cur, xmlValidCtxtPtr ctxt,
|
xmlValidateAttributeCallback(xmlAttributePtr cur, xmlValidCtxtPtr ctxt,
|
||||||
const xmlChar *name UNUSED) {
|
const xmlChar *name ATTRIBUTE_UNUSED) {
|
||||||
if (cur == NULL)
|
if (cur == NULL)
|
||||||
return;
|
return;
|
||||||
switch (cur->atype) {
|
switch (cur->atype) {
|
||||||
|
16
xmlIO.c
16
xmlIO.c
@ -118,18 +118,6 @@ xmlOutputCallback xmlOutputCallbackTable[MAX_OUTPUT_CALLBACK];
|
|||||||
int xmlOutputCallbackNr = 0;
|
int xmlOutputCallbackNr = 0;
|
||||||
int xmlOutputCallbackInitialized = 0;
|
int xmlOutputCallbackInitialized = 0;
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
* Standard I/O for file accesses *
|
* Standard I/O for file accesses *
|
||||||
@ -226,7 +214,7 @@ xmlFdClose (void * context) {
|
|||||||
* Returns 1 if matches, 0 otherwise
|
* Returns 1 if matches, 0 otherwise
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlFileMatch (const char *filename UNUSED) {
|
xmlFileMatch (const char *filename ATTRIBUTE_UNUSED) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,7 +357,7 @@ xmlFileFlush (void * context) {
|
|||||||
* Returns 1 if matches, 0 otherwise
|
* Returns 1 if matches, 0 otherwise
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
xmlGzfileMatch (const char *filename UNUSED) {
|
xmlGzfileMatch (const char *filename ATTRIBUTE_UNUSED) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
xmlmemory.c
12
xmlmemory.c
@ -33,18 +33,6 @@
|
|||||||
#include <libxml/xmlmemory.h>
|
#include <libxml/xmlmemory.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void xmlMallocBreakpoint(void);
|
void xmlMallocBreakpoint(void);
|
||||||
void * xmlMemMalloc(int size);
|
void * xmlMemMalloc(int size);
|
||||||
void * xmlMallocLoc(int size, const char * file, int line);
|
void * xmlMallocLoc(int size, const char * file, int line);
|
||||||
|
@ -121,6 +121,15 @@ extern void xmlCheckVersion(int version);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#include <ansidecl.h>
|
||||||
|
#ifndef ATTRIBUTE_UNUSED
|
||||||
|
#define ATTRIBUTE_UNUSED
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define ATTRIBUTE_UNUSED
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
12
xpointer.c
12
xpointer.c
@ -15,18 +15,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
|
||||||
* *
|
|
||||||
* When running GCC in vaacum cleaner mode *
|
|
||||||
* *
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define UNUSED __attribute__((__unused__))
|
|
||||||
#else
|
|
||||||
#define UNUSED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: better handling of error cases, the full expression should
|
* TODO: better handling of error cases, the full expression should
|
||||||
* be parsed beforehand instead of a progressive evaluation
|
* be parsed beforehand instead of a progressive evaluation
|
||||||
|
Reference in New Issue
Block a user