| OLD | NEW |
| 1 /* | 1 /* |
| 2 * legacy.c: set of deprecated routines, not to be used anymore but | 2 * legacy.c: set of deprecated routines, not to be used anymore but |
| 3 * kept purely for ABI compatibility | 3 * kept purely for ABI compatibility |
| 4 * | 4 * |
| 5 * See Copyright for the status of this software. | 5 * See Copyright for the status of this software. |
| 6 * | 6 * |
| 7 * daniel@veillard.com | 7 * daniel@veillard.com |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #define IN_LIBXML | 10 #define IN_LIBXML |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 386 } |
| 387 | 387 |
| 388 /** | 388 /** |
| 389 * xmlDecodeEntities: | 389 * xmlDecodeEntities: |
| 390 * @ctxt: the parser context | 390 * @ctxt: the parser context |
| 391 * @len: the len to decode (in bytes !), -1 for no size limit | 391 * @len: the len to decode (in bytes !), -1 for no size limit |
| 392 * @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF | 392 * @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF |
| 393 * @end: an end marker xmlChar, 0 if none | 393 * @end: an end marker xmlChar, 0 if none |
| 394 * @end2: an end marker xmlChar, 0 if none | 394 * @end2: an end marker xmlChar, 0 if none |
| 395 * @end3: an end marker xmlChar, 0 if none | 395 * @end3: an end marker xmlChar, 0 if none |
| 396 * | 396 * |
| 397 * This function is deprecated, we now always process entities content | 397 * This function is deprecated, we now always process entities content |
| 398 * through xmlStringDecodeEntities | 398 * through xmlStringDecodeEntities |
| 399 * | 399 * |
| 400 * TODO: remove it in next major release. | 400 * TODO: remove it in next major release. |
| 401 * | 401 * |
| 402 * [67] Reference ::= EntityRef | CharRef | 402 * [67] Reference ::= EntityRef | CharRef |
| 403 * | 403 * |
| 404 * [69] PEReference ::= '%' Name ';' | 404 * [69] PEReference ::= '%' Name ';' |
| 405 * | 405 * |
| 406 * Returns A newly allocated string with the substitution done. The caller | 406 * Returns A newly allocated string with the substitution done. The caller |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 xmlGenericError(xmlGenericErrorContext, | 449 xmlGenericError(xmlGenericErrorContext, |
| 450 "xmlNamespaceParseNCName() deprecated function reached\n
"); | 450 "xmlNamespaceParseNCName() deprecated function reached\n
"); |
| 451 deprecated = 1; | 451 deprecated = 1; |
| 452 } | 452 } |
| 453 return (NULL); | 453 return (NULL); |
| 454 } | 454 } |
| 455 | 455 |
| 456 /** | 456 /** |
| 457 * xmlNamespaceParseQName: | 457 * xmlNamespaceParseQName: |
| 458 * @ctxt: an XML parser context | 458 * @ctxt: an XML parser context |
| 459 * @prefix: a xmlChar ** | 459 * @prefix: a xmlChar ** |
| 460 * | 460 * |
| 461 * TODO: this seems not in use anymore, the namespace handling is done on | 461 * TODO: this seems not in use anymore, the namespace handling is done on |
| 462 * top of the SAX interfaces, i.e. not on raw input. | 462 * top of the SAX interfaces, i.e. not on raw input. |
| 463 * | 463 * |
| 464 * parse an XML qualified name | 464 * parse an XML qualified name |
| 465 * | 465 * |
| 466 * [NS 5] QName ::= (Prefix ':')? LocalPart | 466 * [NS 5] QName ::= (Prefix ':')? LocalPart |
| 467 * | 467 * |
| 468 * [NS 6] Prefix ::= NCName | 468 * [NS 6] Prefix ::= NCName |
| 469 * | 469 * |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 xmlGenericError(xmlGenericErrorContext, | 596 xmlGenericError(xmlGenericErrorContext, |
| 597 "xmlScanName() deprecated function reached\n"); | 597 "xmlScanName() deprecated function reached\n"); |
| 598 deprecated = 1; | 598 deprecated = 1; |
| 599 } | 599 } |
| 600 return (NULL); | 600 return (NULL); |
| 601 } | 601 } |
| 602 | 602 |
| 603 /** | 603 /** |
| 604 * xmlParserHandleReference: | 604 * xmlParserHandleReference: |
| 605 * @ctxt: the parser context | 605 * @ctxt: the parser context |
| 606 * | 606 * |
| 607 * TODO: Remove, now deprecated ... the test is done directly in the | 607 * TODO: Remove, now deprecated ... the test is done directly in the |
| 608 * content parsing | 608 * content parsing |
| 609 * routines. | 609 * routines. |
| 610 * | 610 * |
| 611 * [67] Reference ::= EntityRef | CharRef | 611 * [67] Reference ::= EntityRef | CharRef |
| 612 * | 612 * |
| 613 * [68] EntityRef ::= '&' Name ';' | 613 * [68] EntityRef ::= '&' Name ';' |
| 614 * | 614 * |
| 615 * [ WFC: Entity Declared ] | 615 * [ WFC: Entity Declared ] |
| 616 * the Name given in the entity reference must match that in an entity | 616 * the Name given in the entity reference must match that in an entity |
| 617 * declaration, except that well-formed documents need not declare any | 617 * declaration, except that well-formed documents need not declare any |
| 618 * of the following entities: amp, lt, gt, apos, quot. | 618 * of the following entities: amp, lt, gt, apos, quot. |
| 619 * | 619 * |
| 620 * [ WFC: Parsed Entity ] | 620 * [ WFC: Parsed Entity ] |
| 621 * An entity reference must not contain the name of an unparsed entity | 621 * An entity reference must not contain the name of an unparsed entity |
| 622 * | 622 * |
| 623 * [66] CharRef ::= '&#' [0-9]+ ';' | | 623 * [66] CharRef ::= '&#' [0-9]+ ';' | |
| 624 * '&#x' [0-9a-fA-F]+ ';' | 624 * '&#x' [0-9a-fA-F]+ ';' |
| 625 * | 625 * |
| 626 * A PEReference may have been detected in the current input stream | 626 * A PEReference may have been detected in the current input stream |
| 627 * the handling is done accordingly to | 627 * the handling is done accordingly to |
| 628 * http://www.w3.org/TR/REC-xml#entproc | 628 * http://www.w3.org/TR/REC-xml#entproc |
| 629 */ | 629 */ |
| 630 void | 630 void |
| 631 xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) | 631 xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) |
| 632 { | 632 { |
| 633 static int deprecated = 0; | 633 static int deprecated = 0; |
| 634 | 634 |
| 635 if (!deprecated) { | 635 if (!deprecated) { |
| 636 xmlGenericError(xmlGenericErrorContext, | 636 xmlGenericError(xmlGenericErrorContext, |
| 637 "xmlParserHandleReference() deprecated function reached\
n"); | 637 "xmlParserHandleReference() deprecated function reached\
n"); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 xmlGenericError(xmlGenericErrorContext, | 686 xmlGenericError(xmlGenericErrorContext, |
| 687 "xmlNewGlobalNs() deprecated function reached\n"); | 687 "xmlNewGlobalNs() deprecated function reached\n"); |
| 688 deprecated = 1; | 688 deprecated = 1; |
| 689 } | 689 } |
| 690 return (NULL); | 690 return (NULL); |
| 691 } | 691 } |
| 692 | 692 |
| 693 /** | 693 /** |
| 694 * xmlUpgradeOldNs: | 694 * xmlUpgradeOldNs: |
| 695 * @doc: a document pointer | 695 * @doc: a document pointer |
| 696 * | 696 * |
| 697 * Upgrade old style Namespaces (PI) and move them to the root of the document. | 697 * Upgrade old style Namespaces (PI) and move them to the root of the document. |
| 698 * DEPRECATED | 698 * DEPRECATED |
| 699 */ | 699 */ |
| 700 void | 700 void |
| 701 xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED) | 701 xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED) |
| 702 { | 702 { |
| 703 static int deprecated = 0; | 703 static int deprecated = 0; |
| 704 | 704 |
| 705 if (!deprecated) { | 705 if (!deprecated) { |
| 706 xmlGenericError(xmlGenericErrorContext, | 706 xmlGenericError(xmlGenericErrorContext, |
| 707 "xmlUpgradeOldNs() deprecated function reached\n"); | 707 "xmlUpgradeOldNs() deprecated function reached\n"); |
| 708 deprecated = 1; | 708 deprecated = 1; |
| 709 } | 709 } |
| 710 } | 710 } |
| 711 | 711 |
| 712 /** | 712 /** |
| 713 * xmlEncodeEntities: | 713 * xmlEncodeEntities: |
| 714 * @doc: the document containing the string | 714 * @doc: the document containing the string |
| 715 * @input: A string to convert to XML. | 715 * @input: A string to convert to XML. |
| 716 * | 716 * |
| 717 * TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary | 717 * TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary |
| 718 * compatibility | 718 * compatibility |
| 719 * | 719 * |
| 720 * People must migrate their code to xmlEncodeEntitiesReentrant ! | 720 * People must migrate their code to xmlEncodeEntitiesReentrant ! |
| 721 * This routine will issue a warning when encountered. | 721 * This routine will issue a warning when encountered. |
| 722 * | 722 * |
| 723 * Returns NULL | 723 * Returns NULL |
| 724 */ | 724 */ |
| 725 const xmlChar * | 725 const xmlChar * |
| 726 xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED, | 726 xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED, |
| 727 const xmlChar * input ATTRIBUTE_UNUSED) | 727 const xmlChar * input ATTRIBUTE_UNUSED) |
| 728 { | 728 { |
| 729 static int warning = 1; | 729 static int warning = 1; |
| 730 | 730 |
| 731 if (warning) { | 731 if (warning) { |
| 732 xmlGenericError(xmlGenericErrorContext, | 732 xmlGenericError(xmlGenericErrorContext, |
| 733 "Deprecated API xmlEncodeEntities() used\n"); | 733 "Deprecated API xmlEncodeEntities() used\n"); |
| 734 xmlGenericError(xmlGenericErrorContext, | 734 xmlGenericError(xmlGenericErrorContext, |
| 735 " change code to use xmlEncodeEntitiesReentrant()\n"); | 735 " change code to use xmlEncodeEntitiesReentrant()\n"); |
| 736 warning = 0; | 736 warning = 0; |
| 737 } | 737 } |
| 738 return (NULL); | 738 return (NULL); |
| 739 } | 739 } |
| 740 | 740 |
| 741 /************************************************************************ | 741 /************************************************************************ |
| 742 * * | 742 * * |
| 743 *» » Old set of SAXv1 functions » » » » * | 743 *» » Old set of SAXv1 functions» » » » * |
| 744 * * | 744 * * |
| 745 ************************************************************************/ | 745 ************************************************************************/ |
| 746 static int deprecated_v1_msg = 0; | 746 static int deprecated_v1_msg = 0; |
| 747 | 747 |
| 748 #define DEPRECATED(n) \ | 748 #define DEPRECATED(n) \ |
| 749 if (deprecated_v1_msg == 0) \ | 749 if (deprecated_v1_msg == 0) \ |
| 750 xmlGenericError(xmlGenericErrorContext, \ | 750 xmlGenericError(xmlGenericErrorContext, \ |
| 751 "Use of deprecated SAXv1 function %s\n", n); \ | 751 "Use of deprecated SAXv1 function %s\n", n); \ |
| 752 deprecated_v1_msg++; | 752 deprecated_v1_msg++; |
| 753 | 753 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 getParameterEntity(void *ctx, const xmlChar * name) | 954 getParameterEntity(void *ctx, const xmlChar * name) |
| 955 { | 955 { |
| 956 DEPRECATED("getParameterEntity") | 956 DEPRECATED("getParameterEntity") |
| 957 return (xmlSAX2GetParameterEntity(ctx, name)); | 957 return (xmlSAX2GetParameterEntity(ctx, name)); |
| 958 } | 958 } |
| 959 | 959 |
| 960 | 960 |
| 961 /** | 961 /** |
| 962 * entityDecl: | 962 * entityDecl: |
| 963 * @ctx: the user data (XML parser context) | 963 * @ctx: the user data (XML parser context) |
| 964 * @name: the entity name | 964 * @name: the entity name |
| 965 * @type: the entity type | 965 * @type: the entity type |
| 966 * @publicId: The public ID of the entity | 966 * @publicId: The public ID of the entity |
| 967 * @systemId: The system ID of the entity | 967 * @systemId: The system ID of the entity |
| 968 * @content: the entity value (without processing). | 968 * @content: the entity value (without processing). |
| 969 * | 969 * |
| 970 * An entity definition has been parsed | 970 * An entity definition has been parsed |
| 971 * DEPRECATED: use xmlSAX2EntityDecl() | 971 * DEPRECATED: use xmlSAX2EntityDecl() |
| 972 */ | 972 */ |
| 973 void | 973 void |
| 974 entityDecl(void *ctx, const xmlChar * name, int type, | 974 entityDecl(void *ctx, const xmlChar * name, int type, |
| 975 const xmlChar * publicId, const xmlChar * systemId, | 975 const xmlChar * publicId, const xmlChar * systemId, |
| 976 xmlChar * content) | 976 xmlChar * content) |
| 977 { | 977 { |
| 978 DEPRECATED("entityDecl") | 978 DEPRECATED("entityDecl") |
| 979 xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content); | 979 xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content); |
| 980 } | 980 } |
| 981 | 981 |
| 982 /** | 982 /** |
| 983 * attributeDecl: | 983 * attributeDecl: |
| 984 * @ctx: the user data (XML parser context) | 984 * @ctx: the user data (XML parser context) |
| 985 * @elem: the name of the element | 985 * @elem: the name of the element |
| 986 * @fullname: the attribute name | 986 * @fullname: the attribute name |
| 987 * @type: the attribute type | 987 * @type: the attribute type |
| 988 * @def: the type of default value | 988 * @def: the type of default value |
| 989 * @defaultValue: the attribute default value | 989 * @defaultValue: the attribute default value |
| 990 * @tree: the tree of enumerated value set | 990 * @tree: the tree of enumerated value set |
| 991 * | 991 * |
| 992 * An attribute definition has been parsed | 992 * An attribute definition has been parsed |
| 993 * DEPRECATED: use xmlSAX2AttributeDecl() | 993 * DEPRECATED: use xmlSAX2AttributeDecl() |
| 994 */ | 994 */ |
| 995 void | 995 void |
| 996 attributeDecl(void *ctx, const xmlChar * elem, const xmlChar * fullname, | 996 attributeDecl(void *ctx, const xmlChar * elem, const xmlChar * fullname, |
| 997 int type, int def, const xmlChar * defaultValue, | 997 int type, int def, const xmlChar * defaultValue, |
| 998 xmlEnumerationPtr tree) | 998 xmlEnumerationPtr tree) |
| 999 { | 999 { |
| 1000 DEPRECATED("attributeDecl") | 1000 DEPRECATED("attributeDecl") |
| 1001 xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, | 1001 xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, |
| 1002 tree); | 1002 tree); |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 /** | 1005 /** |
| 1006 * elementDecl: | 1006 * elementDecl: |
| 1007 * @ctx: the user data (XML parser context) | 1007 * @ctx: the user data (XML parser context) |
| 1008 * @name: the element name | 1008 * @name: the element name |
| 1009 * @type: the element type | 1009 * @type: the element type |
| 1010 * @content: the element value tree | 1010 * @content: the element value tree |
| 1011 * | 1011 * |
| 1012 * An element definition has been parsed | 1012 * An element definition has been parsed |
| 1013 * DEPRECATED: use xmlSAX2ElementDecl() | 1013 * DEPRECATED: use xmlSAX2ElementDecl() |
| 1014 */ | 1014 */ |
| 1015 void | 1015 void |
| 1016 elementDecl(void *ctx, const xmlChar * name, int type, | 1016 elementDecl(void *ctx, const xmlChar * name, int type, |
| 1017 xmlElementContentPtr content) | 1017 xmlElementContentPtr content) |
| 1018 { | 1018 { |
| 1019 DEPRECATED("elementDecl") | 1019 DEPRECATED("elementDecl") |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 * @ctx: the user data (XML parser context) | 1144 * @ctx: the user data (XML parser context) |
| 1145 * @name: The element name | 1145 * @name: The element name |
| 1146 * | 1146 * |
| 1147 * called when the end of an element has been detected. | 1147 * called when the end of an element has been detected. |
| 1148 * DEPRECATED: use xmlSAX2EndElement() | 1148 * DEPRECATED: use xmlSAX2EndElement() |
| 1149 */ | 1149 */ |
| 1150 void | 1150 void |
| 1151 endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED) | 1151 endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED) |
| 1152 { | 1152 { |
| 1153 DEPRECATED("endElement") | 1153 DEPRECATED("endElement") |
| 1154 xmlSAX2EndElement(ctx, name); | 1154 xmlSAX2EndElement(ctx, name); |
| 1155 } | 1155 } |
| 1156 | 1156 |
| 1157 /** | 1157 /** |
| 1158 * reference: | 1158 * reference: |
| 1159 * @ctx: the user data (XML parser context) | 1159 * @ctx: the user data (XML parser context) |
| 1160 * @name: The entity name | 1160 * @name: The entity name |
| 1161 * | 1161 * |
| 1162 * called when an entity reference is detected. | 1162 * called when an entity reference is detected. |
| 1163 * DEPRECATED: use xmlSAX2Reference() | 1163 * DEPRECATED: use xmlSAX2Reference() |
| 1164 */ | 1164 */ |
| 1165 void | 1165 void |
| 1166 reference(void *ctx, const xmlChar * name) | 1166 reference(void *ctx, const xmlChar * name) |
| 1167 { | 1167 { |
| 1168 DEPRECATED("reference") | 1168 DEPRECATED("reference") |
| 1169 xmlSAX2Reference(ctx, name); | 1169 xmlSAX2Reference(ctx, name); |
| 1170 } | 1170 } |
| 1171 | 1171 |
| 1172 /** | 1172 /** |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1334 void | 1334 void |
| 1335 cdataBlock(void *ctx, const xmlChar * value, int len) | 1335 cdataBlock(void *ctx, const xmlChar * value, int len) |
| 1336 { | 1336 { |
| 1337 DEPRECATED("cdataBlock") | 1337 DEPRECATED("cdataBlock") |
| 1338 xmlSAX2CDataBlock(ctx, value, len); | 1338 xmlSAX2CDataBlock(ctx, value, len); |
| 1339 } | 1339 } |
| 1340 #define bottom_legacy | 1340 #define bottom_legacy |
| 1341 #include "elfgcchack.h" | 1341 #include "elfgcchack.h" |
| 1342 #endif /* LIBXML_LEGACY_ENABLED */ | 1342 #endif /* LIBXML_LEGACY_ENABLED */ |
| 1343 | 1343 |
| OLD | NEW |