1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-22 22:03:34 +03:00

make the deprecated interfaces log an error message to be sure it won't

* SAX.c: make the deprecated interfaces log an error message
  to be sure it won't get used.
Daniel
This commit is contained in:
Daniel Veillard 2003-08-21 10:39:13 +00:00
parent 1af9a41f24
commit 11af42945f
2 changed files with 47 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Thu Aug 21 12:37:46 CEST 2003 Daniel Veillard <daniel@veillard.com>
* SAX.c: make the deprecated interfaces log an error message
to be sure it won't get used.
Thu Aug 21 00:50:32 CEST 2003 Daniel Veillard <daniel@veillard.com> Thu Aug 21 00:50:32 CEST 2003 Daniel Veillard <daniel@veillard.com>
* Makefile.am SAX2.c include/libxml/Makefile.am include/libxml/SAX2.h: * Makefile.am SAX2.c include/libxml/Makefile.am include/libxml/SAX2.h:

42
SAX.c
View File

@ -31,6 +31,14 @@
/* #define DEBUG_SAX */ /* #define DEBUG_SAX */
/* #define DEBUG_SAX_TREE */ /* #define DEBUG_SAX_TREE */
static int deprecated_msg = 0;
#define DEPRECATED(n) \
if (deprecated_msg == 0) \
xmlGenericError(xmlGenericErrorContext, \
"Use of deprecated SAXv1 function %s\n", n); \
deprecated_msg++;
/** /**
* getPublicId: * getPublicId:
* @ctx: the user data (XML parser context) * @ctx: the user data (XML parser context)
@ -43,6 +51,7 @@
const xmlChar * const xmlChar *
getPublicId(void *ctx) getPublicId(void *ctx)
{ {
DEPRECATED("getPublicId")
return(xmlSAX2GetPublicId(ctx)); return(xmlSAX2GetPublicId(ctx));
} }
@ -59,6 +68,7 @@ getPublicId(void *ctx)
const xmlChar * const xmlChar *
getSystemId(void *ctx) getSystemId(void *ctx)
{ {
DEPRECATED("getSystemId")
return(xmlSAX2GetSystemId(ctx)); return(xmlSAX2GetSystemId(ctx));
} }
@ -74,6 +84,7 @@ getSystemId(void *ctx)
int int
getLineNumber(void *ctx) getLineNumber(void *ctx)
{ {
DEPRECATED("getLineNumber")
return(xmlSAX2GetLineNumber(ctx)); return(xmlSAX2GetLineNumber(ctx));
} }
@ -89,6 +100,7 @@ getLineNumber(void *ctx)
int int
getColumnNumber(void *ctx) getColumnNumber(void *ctx)
{ {
DEPRECATED("getColumnNumber")
return(xmlSAX2GetColumnNumber(ctx)); return(xmlSAX2GetColumnNumber(ctx));
} }
@ -104,6 +116,7 @@ getColumnNumber(void *ctx)
int int
isStandalone(void *ctx) isStandalone(void *ctx)
{ {
DEPRECATED("isStandalone")
return(xmlSAX2IsStandalone(ctx)); return(xmlSAX2IsStandalone(ctx));
} }
@ -119,6 +132,7 @@ isStandalone(void *ctx)
int int
hasInternalSubset(void *ctx) hasInternalSubset(void *ctx)
{ {
DEPRECATED("hasInternalSubset")
return(xmlSAX2HasInternalSubset(ctx)); return(xmlSAX2HasInternalSubset(ctx));
} }
@ -134,6 +148,7 @@ hasInternalSubset(void *ctx)
int int
hasExternalSubset(void *ctx) hasExternalSubset(void *ctx)
{ {
DEPRECATED("hasExternalSubset")
return(xmlSAX2HasExternalSubset(ctx)); return(xmlSAX2HasExternalSubset(ctx));
} }
@ -151,6 +166,7 @@ void
internalSubset(void *ctx, const xmlChar *name, internalSubset(void *ctx, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID) const xmlChar *ExternalID, const xmlChar *SystemID)
{ {
DEPRECATED("internalSubset")
xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID); xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
} }
@ -168,6 +184,7 @@ void
externalSubset(void *ctx, const xmlChar *name, externalSubset(void *ctx, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID) const xmlChar *ExternalID, const xmlChar *SystemID)
{ {
DEPRECATED("externalSubset")
xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID); xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
} }
@ -189,6 +206,7 @@ externalSubset(void *ctx, const xmlChar *name,
xmlParserInputPtr xmlParserInputPtr
resolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId) resolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId)
{ {
DEPRECATED("resolveEntity")
return(xmlSAX2ResolveEntity(ctx, publicId, systemId)); return(xmlSAX2ResolveEntity(ctx, publicId, systemId));
} }
@ -205,6 +223,7 @@ resolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId)
xmlEntityPtr xmlEntityPtr
getEntity(void *ctx, const xmlChar *name) getEntity(void *ctx, const xmlChar *name)
{ {
DEPRECATED("getEntity")
return(xmlSAX2GetEntity(ctx, name)); return(xmlSAX2GetEntity(ctx, name));
} }
@ -221,6 +240,7 @@ getEntity(void *ctx, const xmlChar *name)
xmlEntityPtr xmlEntityPtr
getParameterEntity(void *ctx, const xmlChar *name) getParameterEntity(void *ctx, const xmlChar *name)
{ {
DEPRECATED("getParameterEntity")
return(xmlSAX2GetParameterEntity(ctx, name)); return(xmlSAX2GetParameterEntity(ctx, name));
} }
@ -241,6 +261,7 @@ void
entityDecl(void *ctx, const xmlChar *name, int type, entityDecl(void *ctx, const xmlChar *name, int type,
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
{ {
DEPRECATED("entityDecl")
xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content); xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
} }
@ -262,6 +283,7 @@ attributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname,
int type, int def, const xmlChar *defaultValue, int type, int def, const xmlChar *defaultValue,
xmlEnumerationPtr tree) xmlEnumerationPtr tree)
{ {
DEPRECATED("attributeDecl")
xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, tree); xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, tree);
} }
@ -279,6 +301,7 @@ void
elementDecl(void *ctx, const xmlChar * name, int type, elementDecl(void *ctx, const xmlChar * name, int type,
xmlElementContentPtr content) xmlElementContentPtr content)
{ {
DEPRECATED("elementDecl")
xmlSAX2ElementDecl(ctx, name, type, content); xmlSAX2ElementDecl(ctx, name, type, content);
} }
@ -296,6 +319,7 @@ void
notationDecl(void *ctx, const xmlChar *name, notationDecl(void *ctx, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId) const xmlChar *publicId, const xmlChar *systemId)
{ {
DEPRECATED("notationDecl")
xmlSAX2NotationDecl(ctx, name, publicId, systemId); xmlSAX2NotationDecl(ctx, name, publicId, systemId);
} }
@ -315,6 +339,7 @@ unparsedEntityDecl(void *ctx, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId, const xmlChar *publicId, const xmlChar *systemId,
const xmlChar *notationName) const xmlChar *notationName)
{ {
DEPRECATED("unparsedEntityDecl")
xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId, notationName); xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId, notationName);
} }
@ -330,6 +355,7 @@ unparsedEntityDecl(void *ctx, const xmlChar *name,
void void
setDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED) setDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
{ {
DEPRECATED("setDocumentLocator")
} }
/** /**
@ -342,6 +368,7 @@ setDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UN
void void
startDocument(void *ctx) startDocument(void *ctx)
{ {
DEPRECATED("startDocument")
xmlSAX2StartDocument(ctx); xmlSAX2StartDocument(ctx);
} }
@ -355,6 +382,7 @@ startDocument(void *ctx)
void void
endDocument(void *ctx) endDocument(void *ctx)
{ {
DEPRECATED("endDocument")
xmlSAX2EndDocument(ctx); xmlSAX2EndDocument(ctx);
} }
@ -373,6 +401,7 @@ endDocument(void *ctx)
void void
attribute(void *ctx ATTRIBUTE_UNUSED, const xmlChar *fullname ATTRIBUTE_UNUSED, const xmlChar *value ATTRIBUTE_UNUSED) attribute(void *ctx ATTRIBUTE_UNUSED, const xmlChar *fullname ATTRIBUTE_UNUSED, const xmlChar *value ATTRIBUTE_UNUSED)
{ {
DEPRECATED("attribute")
} }
/** /**
@ -387,6 +416,7 @@ attribute(void *ctx ATTRIBUTE_UNUSED, const xmlChar *fullname ATTRIBUTE_UNUSED,
void void
startElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) startElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
{ {
DEPRECATED("startElement")
xmlSAX2StartElement(ctx, fullname, atts); xmlSAX2StartElement(ctx, fullname, atts);
} }
@ -401,6 +431,7 @@ startElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
void void
endElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED) endElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
{ {
DEPRECATED("endElement")
xmlSAX2EndElement(ctx, name); xmlSAX2EndElement(ctx, name);
} }
@ -415,6 +446,7 @@ endElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
void void
reference(void *ctx, const xmlChar *name) reference(void *ctx, const xmlChar *name)
{ {
DEPRECATED("reference")
xmlSAX2Reference(ctx, name); xmlSAX2Reference(ctx, name);
} }
@ -430,6 +462,7 @@ reference(void *ctx, const xmlChar *name)
void void
characters(void *ctx, const xmlChar *ch, int len) characters(void *ctx, const xmlChar *ch, int len)
{ {
DEPRECATED("characters")
xmlSAX2Characters(ctx, ch, len); xmlSAX2Characters(ctx, ch, len);
} }
@ -446,6 +479,7 @@ characters(void *ctx, const xmlChar *ch, int len)
void void
ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED) ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED)
{ {
DEPRECATED("ignorableWhitespace")
} }
/** /**
@ -461,6 +495,7 @@ void
processingInstruction(void *ctx, const xmlChar *target, processingInstruction(void *ctx, const xmlChar *target,
const xmlChar *data) const xmlChar *data)
{ {
DEPRECATED("processingInstruction")
xmlSAX2ProcessingInstruction(ctx, target, data); xmlSAX2ProcessingInstruction(ctx, target, data);
} }
@ -476,6 +511,7 @@ processingInstruction(void *ctx, const xmlChar *target,
void void
globalNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED) globalNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED)
{ {
DEPRECATED("globalNamespace")
} }
/** /**
@ -490,6 +526,7 @@ globalNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED
void void
setNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name ATTRIBUTE_UNUSED) setNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name ATTRIBUTE_UNUSED)
{ {
DEPRECATED("setNamespace")
} }
/** /**
@ -505,6 +542,7 @@ setNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name ATTRIBUTE_UNUSED)
xmlNsPtr xmlNsPtr
getNamespace(void *ctx ATTRIBUTE_UNUSED) getNamespace(void *ctx ATTRIBUTE_UNUSED)
{ {
DEPRECATED("getNamespace")
return(NULL); return(NULL);
} }
@ -523,6 +561,7 @@ getNamespace(void *ctx ATTRIBUTE_UNUSED)
int int
checkNamespace(void *ctx ATTRIBUTE_UNUSED, xmlChar *namespace ATTRIBUTE_UNUSED) checkNamespace(void *ctx ATTRIBUTE_UNUSED, xmlChar *namespace ATTRIBUTE_UNUSED)
{ {
DEPRECATED("checkNamespace")
return(0); return(0);
} }
@ -538,6 +577,7 @@ checkNamespace(void *ctx ATTRIBUTE_UNUSED, xmlChar *namespace ATTRIBUTE_UNUSED)
void void
namespaceDecl(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED) namespaceDecl(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED)
{ {
DEPRECATED("namespaceDecl")
} }
/** /**
@ -551,6 +591,7 @@ namespaceDecl(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED,
void void
comment(void *ctx, const xmlChar *value) comment(void *ctx, const xmlChar *value)
{ {
DEPRECATED("comment")
xmlSAX2Comment(ctx, value); xmlSAX2Comment(ctx, value);
} }
@ -566,6 +607,7 @@ comment(void *ctx, const xmlChar *value)
void void
cdataBlock(void *ctx, const xmlChar *value, int len) cdataBlock(void *ctx, const xmlChar *value, int len)
{ {
DEPRECATED("cdataBlock")
xmlSAX2CDataBlock(ctx, value, len); xmlSAX2CDataBlock(ctx, value, len);
} }