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:
70
testSAX.c
70
testSAX.c
@ -44,18 +44,6 @@
|
||||
#include <libxml/debugXML.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 copy = 0;
|
||||
static int recovery = 0;
|
||||
@ -110,7 +98,7 @@ extern xmlSAXHandlerPtr debugSAXHandler;
|
||||
* Returns 1 if true
|
||||
*/
|
||||
static int
|
||||
isStandaloneDebug(void *ctx UNUSED)
|
||||
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fprintf(stdout, "SAX.isStandalone()\n");
|
||||
return(0);
|
||||
@ -125,7 +113,7 @@ isStandaloneDebug(void *ctx UNUSED)
|
||||
* Returns 1 if true
|
||||
*/
|
||||
static int
|
||||
hasInternalSubsetDebug(void *ctx UNUSED)
|
||||
hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fprintf(stdout, "SAX.hasInternalSubset()\n");
|
||||
return(0);
|
||||
@ -140,7 +128,7 @@ hasInternalSubsetDebug(void *ctx UNUSED)
|
||||
* Returns 1 if true
|
||||
*/
|
||||
static int
|
||||
hasExternalSubsetDebug(void *ctx UNUSED)
|
||||
hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fprintf(stdout, "SAX.hasExternalSubset()\n");
|
||||
return(0);
|
||||
@ -153,7 +141,7 @@ hasExternalSubsetDebug(void *ctx UNUSED)
|
||||
* Does this document has an internal subset
|
||||
*/
|
||||
static void
|
||||
internalSubsetDebug(void *ctx UNUSED, const xmlChar *name,
|
||||
internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||
const xmlChar *ExternalID, const xmlChar *SystemID)
|
||||
{
|
||||
fprintf(stdout, "SAX.internalSubset(%s,", name);
|
||||
@ -174,7 +162,7 @@ internalSubsetDebug(void *ctx UNUSED, const xmlChar *name,
|
||||
* Does this document has an external subset
|
||||
*/
|
||||
static void
|
||||
externalSubsetDebug(void *ctx UNUSED, const xmlChar *name,
|
||||
externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||
const xmlChar *ExternalID, const xmlChar *SystemID)
|
||||
{
|
||||
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.
|
||||
*/
|
||||
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; */
|
||||
|
||||
@ -235,7 +223,7 @@ resolveEntityDebug(void *ctx UNUSED, const xmlChar *publicId, const xmlChar *sys
|
||||
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
||||
*/
|
||||
static xmlEntityPtr
|
||||
getEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
||||
getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||
{
|
||||
fprintf(stdout, "SAX.getEntity(%s)\n", name);
|
||||
return(NULL);
|
||||
@ -251,7 +239,7 @@ getEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
||||
* Returns the xmlParserInputPtr
|
||||
*/
|
||||
static xmlEntityPtr
|
||||
getParameterEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
||||
getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
|
||||
{
|
||||
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
|
||||
return(NULL);
|
||||
@ -270,7 +258,7 @@ getParameterEntityDebug(void *ctx UNUSED, const xmlChar *name)
|
||||
* An entity definition has been parsed
|
||||
*/
|
||||
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)
|
||||
{
|
||||
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
|
||||
*/
|
||||
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,
|
||||
xmlEnumerationPtr tree UNUSED)
|
||||
xmlEnumerationPtr tree ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (defaultValue == NULL)
|
||||
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
|
||||
*/
|
||||
static void
|
||||
elementDeclDebug(void *ctx UNUSED, const xmlChar *name, int type,
|
||||
xmlElementContentPtr content UNUSED)
|
||||
elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
|
||||
xmlElementContentPtr content ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
|
||||
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.
|
||||
*/
|
||||
static void
|
||||
notationDeclDebug(void *ctx UNUSED, const xmlChar *name,
|
||||
notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
|
||||
const xmlChar *publicId, const xmlChar *systemId)
|
||||
{
|
||||
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
|
||||
*/
|
||||
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 *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.
|
||||
*/
|
||||
static void
|
||||
setDocumentLocatorDebug(void *ctx UNUSED, xmlSAXLocatorPtr loc UNUSED)
|
||||
setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fprintf(stdout, "SAX.setDocumentLocator()\n");
|
||||
}
|
||||
@ -373,7 +361,7 @@ setDocumentLocatorDebug(void *ctx UNUSED, xmlSAXLocatorPtr loc UNUSED)
|
||||
* called when the document start being processed.
|
||||
*/
|
||||
static void
|
||||
startDocumentDebug(void *ctx UNUSED)
|
||||
startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fprintf(stdout, "SAX.startDocument()\n");
|
||||
}
|
||||
@ -385,7 +373,7 @@ startDocumentDebug(void *ctx UNUSED)
|
||||
* called when the document end has been detected.
|
||||
*/
|
||||
static void
|
||||
endDocumentDebug(void *ctx UNUSED)
|
||||
endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fprintf(stdout, "SAX.endDocument()\n");
|
||||
}
|
||||
@ -398,7 +386,7 @@ endDocumentDebug(void *ctx UNUSED)
|
||||
* called when an opening tag has been processed.
|
||||
*/
|
||||
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;
|
||||
|
||||
@ -421,7 +409,7 @@ startElementDebug(void *ctx UNUSED, const xmlChar *name, const xmlChar **atts)
|
||||
* called when the end of an element has been detected.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
@ -436,7 +424,7 @@ endElementDebug(void *ctx UNUSED, const xmlChar *name)
|
||||
* Question: how much at a time ???
|
||||
*/
|
||||
static void
|
||||
charactersDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
||||
charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
|
||||
{
|
||||
char output[40];
|
||||
int i;
|
||||
@ -456,7 +444,7 @@ charactersDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
||||
* called when an entity reference is detected.
|
||||
*/
|
||||
static void
|
||||
referenceDebug(void *ctx UNUSED, const xmlChar *name)
|
||||
referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *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 ???
|
||||
*/
|
||||
static void
|
||||
ignorableWhitespaceDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
||||
ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
|
||||
{
|
||||
char output[40];
|
||||
int i;
|
||||
@ -493,7 +481,7 @@ ignorableWhitespaceDebug(void *ctx UNUSED, const xmlChar *ch, int len)
|
||||
* A processing instruction has been parsed.
|
||||
*/
|
||||
static void
|
||||
processingInstructionDebug(void *ctx UNUSED, const xmlChar *target,
|
||||
processingInstructionDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *target,
|
||||
const xmlChar *data)
|
||||
{
|
||||
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
|
||||
*/
|
||||
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",
|
||||
(char *) value, len);
|
||||
@ -523,7 +511,7 @@ cdataBlockDebug(void *ctx UNUSED, const xmlChar *value, int len)
|
||||
* A comment has been parsed.
|
||||
*/
|
||||
static void
|
||||
commentDebug(void *ctx UNUSED, const xmlChar *value)
|
||||
commentDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *value)
|
||||
{
|
||||
fprintf(stdout, "SAX.comment(%s)\n", value);
|
||||
}
|
||||
@ -538,7 +526,7 @@ commentDebug(void *ctx UNUSED, const xmlChar *value)
|
||||
* extra parameters.
|
||||
*/
|
||||
static void
|
||||
warningDebug(void *ctx UNUSED, const char *msg, ...)
|
||||
warningDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@ -558,7 +546,7 @@ warningDebug(void *ctx UNUSED, const char *msg, ...)
|
||||
* extra parameters.
|
||||
*/
|
||||
static void
|
||||
errorDebug(void *ctx UNUSED, const char *msg, ...)
|
||||
errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@ -578,7 +566,7 @@ errorDebug(void *ctx UNUSED, const char *msg, ...)
|
||||
* extra parameters.
|
||||
*/
|
||||
static void
|
||||
fatalErrorDebug(void *ctx UNUSED, const char *msg, ...)
|
||||
fatalErrorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
Reference in New Issue
Block a user