1 /*
2 * legacy.c: set of deprecated routines, not to be used anymore but
3 * kept purely for ABI compatibility
4 *
5 * See Copyright for the status of this software.
6 *
7 * daniel@veillard.com
8 */
9
10 #define IN_LIBXML
11 #include "libxml.h"
12
13 #ifdef LIBXML_LEGACY_ENABLED
14 #include <stdio.h>
15 #include <string.h>
16
17 #include <libxml/tree.h>
18 #include <libxml/entities.h>
19 #include <libxml/SAX.h>
20 #include <libxml/parserInternals.h>
21 #include <libxml/HTMLparser.h>
22
23 void xmlUpgradeOldNs(xmlDocPtr doc);
24
25 /************************************************************************
26 * *
27 * Deprecated functions kept for compatibility *
28 * *
29 ************************************************************************/
30
31 #ifdef LIBXML_HTML_ENABLED
32 xmlChar *htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len, xmlChar end,
33 xmlChar end2, xmlChar end3);
34
35 /**
36 * htmlDecodeEntities:
37 * @ctxt: the parser context
38 * @len: the len to decode (in bytes !), -1 for no size limit
39 * @end: an end marker xmlChar, 0 if none
40 * @end2: an end marker xmlChar, 0 if none
41 * @end3: an end marker xmlChar, 0 if none
42 *
43 * Substitute the HTML entities by their value
44 *
45 * DEPRECATED !!!!
46 *
47 * Returns A newly allocated string with the substitution done. The caller
48 * must deallocate it !
49 */
50 xmlChar *
htmlDecodeEntities(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,int len ATTRIBUTE_UNUSED,xmlChar end ATTRIBUTE_UNUSED,xmlChar end2 ATTRIBUTE_UNUSED,xmlChar end3 ATTRIBUTE_UNUSED)51 htmlDecodeEntities(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
52 int len ATTRIBUTE_UNUSED, xmlChar end ATTRIBUTE_UNUSED,
53 xmlChar end2 ATTRIBUTE_UNUSED,
54 xmlChar end3 ATTRIBUTE_UNUSED)
55 {
56 static int deprecated = 0;
57
58 if (!deprecated) {
59 fprintf(stderr,
60 "htmlDecodeEntities() deprecated function reached\n");
61 deprecated = 1;
62 }
63 return (NULL);
64 }
65 #endif
66
67 /**
68 * xmlInitializePredefinedEntities:
69 *
70 * Set up the predefined entities.
71 * Deprecated call
72 */
73 void
xmlInitializePredefinedEntities(void)74 xmlInitializePredefinedEntities(void)
75 {
76 }
77
78 /**
79 * xmlCleanupPredefinedEntities:
80 *
81 * Cleanup up the predefined entities table.
82 * Deprecated call
83 */
84 void
xmlCleanupPredefinedEntities(void)85 xmlCleanupPredefinedEntities(void)
86 {
87 }
88
89 static const char* const xmlFeaturesList[] = {
90 "validate",
91 "load subset",
92 "keep blanks",
93 "disable SAX",
94 "fetch external entities",
95 "substitute entities",
96 "gather line info",
97 "user data",
98 "is html",
99 "is standalone",
100 "stop parser",
101 "document",
102 "is well formed",
103 "is valid",
104 "SAX block",
105 "SAX function internalSubset",
106 "SAX function isStandalone",
107 "SAX function hasInternalSubset",
108 "SAX function hasExternalSubset",
109 "SAX function resolveEntity",
110 "SAX function getEntity",
111 "SAX function entityDecl",
112 "SAX function notationDecl",
113 "SAX function attributeDecl",
114 "SAX function elementDecl",
115 "SAX function unparsedEntityDecl",
116 "SAX function setDocumentLocator",
117 "SAX function startDocument",
118 "SAX function endDocument",
119 "SAX function startElement",
120 "SAX function endElement",
121 "SAX function reference",
122 "SAX function characters",
123 "SAX function ignorableWhitespace",
124 "SAX function processingInstruction",
125 "SAX function comment",
126 "SAX function warning",
127 "SAX function error",
128 "SAX function fatalError",
129 "SAX function getParameterEntity",
130 "SAX function cdataBlock",
131 "SAX function externalSubset",
132 };
133
134 /**
135 * xmlGetFeaturesList:
136 * @len: the length of the features name array (input/output)
137 * @result: an array of string to be filled with the features name.
138 *
139 * Copy at most *@len feature names into the @result array
140 *
141 * Returns -1 in case or error, or the total number of features,
142 * len is updated with the number of strings copied,
143 * strings must not be deallocated
144 */
145 int
xmlGetFeaturesList(int * len,const char ** result)146 xmlGetFeaturesList(int *len, const char **result)
147 {
148 int ret, i;
149
150 ret = sizeof(xmlFeaturesList) / sizeof(xmlFeaturesList[0]);
151 if ((len == NULL) || (result == NULL))
152 return (ret);
153 if ((*len < 0) || (*len >= 1000))
154 return (-1);
155 if (*len > ret)
156 *len = ret;
157 for (i = 0; i < *len; i++)
158 result[i] = xmlFeaturesList[i];
159 return (ret);
160 }
161
162 /**
163 * xmlGetFeature:
164 * @ctxt: an XML/HTML parser context
165 * @name: the feature name
166 * @result: location to store the result
167 *
168 * Read the current value of one feature of this parser instance
169 *
170 * Returns -1 in case or error, 0 otherwise
171 */
172 int
xmlGetFeature(xmlParserCtxtPtr ctxt,const char * name,void * result)173 xmlGetFeature(xmlParserCtxtPtr ctxt, const char *name, void *result)
174 {
175 if ((ctxt == NULL) || (name == NULL) || (result == NULL))
176 return (-1);
177
178 if (!strcmp(name, "validate")) {
179 *((int *) result) = ctxt->validate;
180 } else if (!strcmp(name, "keep blanks")) {
181 *((int *) result) = ctxt->keepBlanks;
182 } else if (!strcmp(name, "disable SAX")) {
183 *((int *) result) = ctxt->disableSAX;
184 } else if (!strcmp(name, "fetch external entities")) {
185 *((int *) result) = ctxt->loadsubset;
186 } else if (!strcmp(name, "substitute entities")) {
187 *((int *) result) = ctxt->replaceEntities;
188 } else if (!strcmp(name, "gather line info")) {
189 *((int *) result) = ctxt->record_info;
190 } else if (!strcmp(name, "user data")) {
191 *((void **) result) = ctxt->userData;
192 } else if (!strcmp(name, "is html")) {
193 *((int *) result) = ctxt->html;
194 } else if (!strcmp(name, "is standalone")) {
195 *((int *) result) = ctxt->standalone;
196 } else if (!strcmp(name, "document")) {
197 *((xmlDocPtr *) result) = ctxt->myDoc;
198 } else if (!strcmp(name, "is well formed")) {
199 *((int *) result) = ctxt->wellFormed;
200 } else if (!strcmp(name, "is valid")) {
201 *((int *) result) = ctxt->valid;
202 } else if (!strcmp(name, "SAX block")) {
203 *((xmlSAXHandlerPtr *) result) = ctxt->sax;
204 } else if (!strcmp(name, "SAX function internalSubset")) {
205 *((internalSubsetSAXFunc *) result) = ctxt->sax->internalSubset;
206 } else if (!strcmp(name, "SAX function isStandalone")) {
207 *((isStandaloneSAXFunc *) result) = ctxt->sax->isStandalone;
208 } else if (!strcmp(name, "SAX function hasInternalSubset")) {
209 *((hasInternalSubsetSAXFunc *) result) =
210 ctxt->sax->hasInternalSubset;
211 } else if (!strcmp(name, "SAX function hasExternalSubset")) {
212 *((hasExternalSubsetSAXFunc *) result) =
213 ctxt->sax->hasExternalSubset;
214 } else if (!strcmp(name, "SAX function resolveEntity")) {
215 *((resolveEntitySAXFunc *) result) = ctxt->sax->resolveEntity;
216 } else if (!strcmp(name, "SAX function getEntity")) {
217 *((getEntitySAXFunc *) result) = ctxt->sax->getEntity;
218 } else if (!strcmp(name, "SAX function entityDecl")) {
219 *((entityDeclSAXFunc *) result) = ctxt->sax->entityDecl;
220 } else if (!strcmp(name, "SAX function notationDecl")) {
221 *((notationDeclSAXFunc *) result) = ctxt->sax->notationDecl;
222 } else if (!strcmp(name, "SAX function attributeDecl")) {
223 *((attributeDeclSAXFunc *) result) = ctxt->sax->attributeDecl;
224 } else if (!strcmp(name, "SAX function elementDecl")) {
225 *((elementDeclSAXFunc *) result) = ctxt->sax->elementDecl;
226 } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
227 *((unparsedEntityDeclSAXFunc *) result) =
228 ctxt->sax->unparsedEntityDecl;
229 } else if (!strcmp(name, "SAX function setDocumentLocator")) {
230 *((setDocumentLocatorSAXFunc *) result) =
231 ctxt->sax->setDocumentLocator;
232 } else if (!strcmp(name, "SAX function startDocument")) {
233 *((startDocumentSAXFunc *) result) = ctxt->sax->startDocument;
234 } else if (!strcmp(name, "SAX function endDocument")) {
235 *((endDocumentSAXFunc *) result) = ctxt->sax->endDocument;
236 } else if (!strcmp(name, "SAX function startElement")) {
237 *((startElementSAXFunc *) result) = ctxt->sax->startElement;
238 } else if (!strcmp(name, "SAX function endElement")) {
239 *((endElementSAXFunc *) result) = ctxt->sax->endElement;
240 } else if (!strcmp(name, "SAX function reference")) {
241 *((referenceSAXFunc *) result) = ctxt->sax->reference;
242 } else if (!strcmp(name, "SAX function characters")) {
243 *((charactersSAXFunc *) result) = ctxt->sax->characters;
244 } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
245 *((ignorableWhitespaceSAXFunc *) result) =
246 ctxt->sax->ignorableWhitespace;
247 } else if (!strcmp(name, "SAX function processingInstruction")) {
248 *((processingInstructionSAXFunc *) result) =
249 ctxt->sax->processingInstruction;
250 } else if (!strcmp(name, "SAX function comment")) {
251 *((commentSAXFunc *) result) = ctxt->sax->comment;
252 } else if (!strcmp(name, "SAX function warning")) {
253 *((warningSAXFunc *) result) = ctxt->sax->warning;
254 } else if (!strcmp(name, "SAX function error")) {
255 *((errorSAXFunc *) result) = ctxt->sax->error;
256 } else if (!strcmp(name, "SAX function fatalError")) {
257 *((fatalErrorSAXFunc *) result) = ctxt->sax->fatalError;
258 } else if (!strcmp(name, "SAX function getParameterEntity")) {
259 *((getParameterEntitySAXFunc *) result) =
260 ctxt->sax->getParameterEntity;
261 } else if (!strcmp(name, "SAX function cdataBlock")) {
262 *((cdataBlockSAXFunc *) result) = ctxt->sax->cdataBlock;
263 } else if (!strcmp(name, "SAX function externalSubset")) {
264 *((externalSubsetSAXFunc *) result) = ctxt->sax->externalSubset;
265 } else {
266 return (-1);
267 }
268 return (0);
269 }
270
271 /**
272 * xmlSetFeature:
273 * @ctxt: an XML/HTML parser context
274 * @name: the feature name
275 * @value: pointer to the location of the new value
276 *
277 * Change the current value of one feature of this parser instance
278 *
279 * Returns -1 in case or error, 0 otherwise
280 */
281 int
xmlSetFeature(xmlParserCtxtPtr ctxt,const char * name,void * value)282 xmlSetFeature(xmlParserCtxtPtr ctxt, const char *name, void *value)
283 {
284 if ((ctxt == NULL) || (name == NULL) || (value == NULL))
285 return (-1);
286
287 if (!strcmp(name, "validate")) {
288 int newvalidate = *((int *) value);
289
290 if ((!ctxt->validate) && (newvalidate != 0)) {
291 if (ctxt->vctxt.warning == NULL)
292 ctxt->vctxt.warning = xmlParserValidityWarning;
293 if (ctxt->vctxt.error == NULL)
294 ctxt->vctxt.error = xmlParserValidityError;
295 ctxt->vctxt.nodeMax = 0;
296 }
297 ctxt->validate = newvalidate;
298 } else if (!strcmp(name, "keep blanks")) {
299 ctxt->keepBlanks = *((int *) value);
300 } else if (!strcmp(name, "disable SAX")) {
301 ctxt->disableSAX = *((int *) value);
302 } else if (!strcmp(name, "fetch external entities")) {
303 ctxt->loadsubset = *((int *) value);
304 } else if (!strcmp(name, "substitute entities")) {
305 ctxt->replaceEntities = *((int *) value);
306 } else if (!strcmp(name, "gather line info")) {
307 ctxt->record_info = *((int *) value);
308 } else if (!strcmp(name, "user data")) {
309 ctxt->userData = *((void **) value);
310 } else if (!strcmp(name, "is html")) {
311 ctxt->html = *((int *) value);
312 } else if (!strcmp(name, "is standalone")) {
313 ctxt->standalone = *((int *) value);
314 } else if (!strcmp(name, "document")) {
315 ctxt->myDoc = *((xmlDocPtr *) value);
316 } else if (!strcmp(name, "is well formed")) {
317 ctxt->wellFormed = *((int *) value);
318 } else if (!strcmp(name, "is valid")) {
319 ctxt->valid = *((int *) value);
320 } else if (!strcmp(name, "SAX block")) {
321 ctxt->sax = *((xmlSAXHandlerPtr *) value);
322 } else if (!strcmp(name, "SAX function internalSubset")) {
323 ctxt->sax->internalSubset = *((internalSubsetSAXFunc *) value);
324 } else if (!strcmp(name, "SAX function isStandalone")) {
325 ctxt->sax->isStandalone = *((isStandaloneSAXFunc *) value);
326 } else if (!strcmp(name, "SAX function hasInternalSubset")) {
327 ctxt->sax->hasInternalSubset =
328 *((hasInternalSubsetSAXFunc *) value);
329 } else if (!strcmp(name, "SAX function hasExternalSubset")) {
330 ctxt->sax->hasExternalSubset =
331 *((hasExternalSubsetSAXFunc *) value);
332 } else if (!strcmp(name, "SAX function resolveEntity")) {
333 ctxt->sax->resolveEntity = *((resolveEntitySAXFunc *) value);
334 } else if (!strcmp(name, "SAX function getEntity")) {
335 ctxt->sax->getEntity = *((getEntitySAXFunc *) value);
336 } else if (!strcmp(name, "SAX function entityDecl")) {
337 ctxt->sax->entityDecl = *((entityDeclSAXFunc *) value);
338 } else if (!strcmp(name, "SAX function notationDecl")) {
339 ctxt->sax->notationDecl = *((notationDeclSAXFunc *) value);
340 } else if (!strcmp(name, "SAX function attributeDecl")) {
341 ctxt->sax->attributeDecl = *((attributeDeclSAXFunc *) value);
342 } else if (!strcmp(name, "SAX function elementDecl")) {
343 ctxt->sax->elementDecl = *((elementDeclSAXFunc *) value);
344 } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
345 ctxt->sax->unparsedEntityDecl =
346 *((unparsedEntityDeclSAXFunc *) value);
347 } else if (!strcmp(name, "SAX function setDocumentLocator")) {
348 ctxt->sax->setDocumentLocator =
349 *((setDocumentLocatorSAXFunc *) value);
350 } else if (!strcmp(name, "SAX function startDocument")) {
351 ctxt->sax->startDocument = *((startDocumentSAXFunc *) value);
352 } else if (!strcmp(name, "SAX function endDocument")) {
353 ctxt->sax->endDocument = *((endDocumentSAXFunc *) value);
354 } else if (!strcmp(name, "SAX function startElement")) {
355 ctxt->sax->startElement = *((startElementSAXFunc *) value);
356 } else if (!strcmp(name, "SAX function endElement")) {
357 ctxt->sax->endElement = *((endElementSAXFunc *) value);
358 } else if (!strcmp(name, "SAX function reference")) {
359 ctxt->sax->reference = *((referenceSAXFunc *) value);
360 } else if (!strcmp(name, "SAX function characters")) {
361 ctxt->sax->characters = *((charactersSAXFunc *) value);
362 } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
363 ctxt->sax->ignorableWhitespace =
364 *((ignorableWhitespaceSAXFunc *) value);
365 } else if (!strcmp(name, "SAX function processingInstruction")) {
366 ctxt->sax->processingInstruction =
367 *((processingInstructionSAXFunc *) value);
368 } else if (!strcmp(name, "SAX function comment")) {
369 ctxt->sax->comment = *((commentSAXFunc *) value);
370 } else if (!strcmp(name, "SAX function warning")) {
371 ctxt->sax->warning = *((warningSAXFunc *) value);
372 } else if (!strcmp(name, "SAX function error")) {
373 ctxt->sax->error = *((errorSAXFunc *) value);
374 } else if (!strcmp(name, "SAX function fatalError")) {
375 ctxt->sax->fatalError = *((fatalErrorSAXFunc *) value);
376 } else if (!strcmp(name, "SAX function getParameterEntity")) {
377 ctxt->sax->getParameterEntity =
378 *((getParameterEntitySAXFunc *) value);
379 } else if (!strcmp(name, "SAX function cdataBlock")) {
380 ctxt->sax->cdataBlock = *((cdataBlockSAXFunc *) value);
381 } else if (!strcmp(name, "SAX function externalSubset")) {
382 ctxt->sax->externalSubset = *((externalSubsetSAXFunc *) value);
383 } else {
384 return (-1);
385 }
386 return (0);
387 }
388
389 /**
390 * xmlDecodeEntities:
391 * @ctxt: the parser context
392 * @len: the len to decode (in bytes !), -1 for no size limit
393 * @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
394 * @end: an end marker xmlChar, 0 if none
395 * @end2: an end marker xmlChar, 0 if none
396 * @end3: an end marker xmlChar, 0 if none
397 *
398 * This function is deprecated, we now always process entities content
399 * through xmlStringDecodeEntities
400 *
401 * TODO: remove it in next major release.
402 *
403 * [67] Reference ::= EntityRef | CharRef
404 *
405 * [69] PEReference ::= '%' Name ';'
406 *
407 * Returns A newly allocated string with the substitution done. The caller
408 * must deallocate it !
409 */
410 xmlChar *
xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,int len ATTRIBUTE_UNUSED,int what ATTRIBUTE_UNUSED,xmlChar end ATTRIBUTE_UNUSED,xmlChar end2 ATTRIBUTE_UNUSED,xmlChar end3 ATTRIBUTE_UNUSED)411 xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
412 int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED,
413 xmlChar end ATTRIBUTE_UNUSED,
414 xmlChar end2 ATTRIBUTE_UNUSED,
415 xmlChar end3 ATTRIBUTE_UNUSED)
416 {
417 static int deprecated = 0;
418
419 if (!deprecated) {
420 fprintf(stderr,
421 "xmlDecodeEntities() deprecated function reached\n");
422 deprecated = 1;
423 }
424 return (NULL);
425 }
426
427 /**
428 * xmlNamespaceParseNCName:
429 * @ctxt: an XML parser context
430 *
431 * parse an XML namespace name.
432 *
433 * TODO: this seems not in use anymore, the namespace handling is done on
434 * top of the SAX interfaces, i.e. not on raw input.
435 *
436 * [NS 3] NCName ::= (Letter | '_') (NCNameChar)*
437 *
438 * [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
439 * CombiningChar | Extender
440 *
441 * Returns the namespace name or NULL
442 */
443
444 xmlChar *
xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)445 xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
446 {
447 static int deprecated = 0;
448
449 if (!deprecated) {
450 fprintf(stderr,
451 "xmlNamespaceParseNCName() deprecated function reached\n");
452 deprecated = 1;
453 }
454 return (NULL);
455 }
456
457 /**
458 * xmlNamespaceParseQName:
459 * @ctxt: an XML parser context
460 * @prefix: a xmlChar **
461 *
462 * TODO: this seems not in use anymore, the namespace handling is done on
463 * top of the SAX interfaces, i.e. not on raw input.
464 *
465 * parse an XML qualified name
466 *
467 * [NS 5] QName ::= (Prefix ':')? LocalPart
468 *
469 * [NS 6] Prefix ::= NCName
470 *
471 * [NS 7] LocalPart ::= NCName
472 *
473 * Returns the local part, and prefix is updated
474 * to get the Prefix if any.
475 */
476
477 xmlChar *
xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,xmlChar ** prefix ATTRIBUTE_UNUSED)478 xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
479 xmlChar ** prefix ATTRIBUTE_UNUSED)
480 {
481
482 static int deprecated = 0;
483
484 if (!deprecated) {
485 fprintf(stderr,
486 "xmlNamespaceParseQName() deprecated function reached\n");
487 deprecated = 1;
488 }
489 return (NULL);
490 }
491
492 /**
493 * xmlNamespaceParseNSDef:
494 * @ctxt: an XML parser context
495 *
496 * parse a namespace prefix declaration
497 *
498 * TODO: this seems not in use anymore, the namespace handling is done on
499 * top of the SAX interfaces, i.e. not on raw input.
500 *
501 * [NS 1] NSDef ::= PrefixDef Eq SystemLiteral
502 *
503 * [NS 2] PrefixDef ::= 'xmlns' (':' NCName)?
504 *
505 * Returns the namespace name
506 */
507
508 xmlChar *
xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)509 xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
510 {
511 static int deprecated = 0;
512
513 if (!deprecated) {
514 fprintf(stderr,
515 "xmlNamespaceParseNSDef() deprecated function reached\n");
516 deprecated = 1;
517 }
518 return (NULL);
519 }
520
521 /**
522 * xmlParseQuotedString:
523 * @ctxt: an XML parser context
524 *
525 * Parse and return a string between quotes or doublequotes
526 *
527 * TODO: Deprecated, to be removed at next drop of binary compatibility
528 *
529 * Returns the string parser or NULL.
530 */
531 xmlChar *
xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)532 xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
533 {
534 static int deprecated = 0;
535
536 if (!deprecated) {
537 fprintf(stderr,
538 "xmlParseQuotedString() deprecated function reached\n");
539 deprecated = 1;
540 }
541 return (NULL);
542 }
543
544 /**
545 * xmlParseNamespace:
546 * @ctxt: an XML parser context
547 *
548 * xmlParseNamespace: parse specific PI '<?namespace ...' constructs.
549 *
550 * This is what the older xml-name Working Draft specified, a bunch of
551 * other stuff may still rely on it, so support is still here as
552 * if it was declared on the root of the Tree:-(
553 *
554 * TODO: remove from library
555 *
556 * To be removed at next drop of binary compatibility
557 */
558
559 void
xmlParseNamespace(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)560 xmlParseNamespace(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
561 {
562 static int deprecated = 0;
563
564 if (!deprecated) {
565 fprintf(stderr,
566 "xmlParseNamespace() deprecated function reached\n");
567 deprecated = 1;
568 }
569 }
570
571 /**
572 * xmlScanName:
573 * @ctxt: an XML parser context
574 *
575 * Trickery: parse an XML name but without consuming the input flow
576 * Needed for rollback cases. Used only when parsing entities references.
577 *
578 * TODO: seems deprecated now, only used in the default part of
579 * xmlParserHandleReference
580 *
581 * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
582 * CombiningChar | Extender
583 *
584 * [5] Name ::= (Letter | '_' | ':') (NameChar)*
585 *
586 * [6] Names ::= Name (S Name)*
587 *
588 * Returns the Name parsed or NULL
589 */
590
591 xmlChar *
xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)592 xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
593 {
594 static int deprecated = 0;
595
596 if (!deprecated) {
597 fprintf(stderr,
598 "xmlScanName() deprecated function reached\n");
599 deprecated = 1;
600 }
601 return (NULL);
602 }
603
604 /**
605 * xmlParserHandleReference:
606 * @ctxt: the parser context
607 *
608 * TODO: Remove, now deprecated ... the test is done directly in the
609 * content parsing
610 * routines.
611 *
612 * [67] Reference ::= EntityRef | CharRef
613 *
614 * [68] EntityRef ::= '&' Name ';'
615 *
616 * [ WFC: Entity Declared ]
617 * the Name given in the entity reference must match that in an entity
618 * declaration, except that well-formed documents need not declare any
619 * of the following entities: amp, lt, gt, apos, quot.
620 *
621 * [ WFC: Parsed Entity ]
622 * An entity reference must not contain the name of an unparsed entity
623 *
624 * [66] CharRef ::= '&#' [0-9]+ ';' |
625 * '&#x' [0-9a-fA-F]+ ';'
626 *
627 * A PEReference may have been detected in the current input stream
628 * the handling is done accordingly to
629 * http://www.w3.org/TR/REC-xml#entproc
630 */
631 void
xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)632 xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
633 {
634 static int deprecated = 0;
635
636 if (!deprecated) {
637 fprintf(stderr,
638 "xmlParserHandleReference() deprecated function reached\n");
639 deprecated = 1;
640 }
641
642 return;
643 }
644
645 /**
646 * xmlHandleEntity:
647 * @ctxt: an XML parser context
648 * @entity: an XML entity pointer.
649 *
650 * Default handling of defined entities, when should we define a new input
651 * stream ? When do we just handle that as a set of chars ?
652 *
653 * OBSOLETE: to be removed at some point.
654 */
655
656 void
xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,xmlEntityPtr entity ATTRIBUTE_UNUSED)657 xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
658 xmlEntityPtr entity ATTRIBUTE_UNUSED)
659 {
660 static int deprecated = 0;
661
662 if (!deprecated) {
663 fprintf(stderr,
664 "xmlHandleEntity() deprecated function reached\n");
665 deprecated = 1;
666 }
667 }
668
669 /**
670 * xmlNewGlobalNs:
671 * @doc: the document carrying the namespace
672 * @href: the URI associated
673 * @prefix: the prefix for the namespace
674 *
675 * Creation of a Namespace, the old way using PI and without scoping
676 * DEPRECATED !!!
677 * Returns NULL this functionality had been removed
678 */
679 xmlNsPtr
xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED,const xmlChar * href ATTRIBUTE_UNUSED,const xmlChar * prefix ATTRIBUTE_UNUSED)680 xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED,
681 const xmlChar * href ATTRIBUTE_UNUSED,
682 const xmlChar * prefix ATTRIBUTE_UNUSED)
683 {
684 static int deprecated = 0;
685
686 if (!deprecated) {
687 fprintf(stderr,
688 "xmlNewGlobalNs() deprecated function reached\n");
689 deprecated = 1;
690 }
691 return (NULL);
692 }
693
694 /**
695 * xmlUpgradeOldNs:
696 * @doc: a document pointer
697 *
698 * Upgrade old style Namespaces (PI) and move them to the root of the document.
699 * DEPRECATED
700 */
701 void
xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED)702 xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED)
703 {
704 static int deprecated = 0;
705
706 if (!deprecated) {
707 fprintf(stderr,
708 "xmlUpgradeOldNs() deprecated function reached\n");
709 deprecated = 1;
710 }
711 }
712
713 /**
714 * xmlEncodeEntities:
715 * @doc: the document containing the string
716 * @input: A string to convert to XML.
717 *
718 * TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary
719 * compatibility
720 *
721 * People must migrate their code to xmlEncodeEntitiesReentrant !
722 * This routine will issue a warning when encountered.
723 *
724 * Returns NULL
725 */
726 const xmlChar *
xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED,const xmlChar * input ATTRIBUTE_UNUSED)727 xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED,
728 const xmlChar * input ATTRIBUTE_UNUSED)
729 {
730 static int warning = 1;
731
732 if (warning) {
733 fprintf(stderr,
734 "Deprecated API xmlEncodeEntities() used\n");
735 fprintf(stderr,
736 " change code to use xmlEncodeEntitiesReentrant()\n");
737 warning = 0;
738 }
739 return (NULL);
740 }
741
742 /**
743 * xmlSetEntityReferenceFunc:
744 * @func: A valid function
745 *
746 * Set the function to call call back when a xml reference has been made
747 */
748 void
xmlSetEntityReferenceFunc(xmlEntityReferenceFunc func ATTRIBUTE_UNUSED)749 xmlSetEntityReferenceFunc(xmlEntityReferenceFunc func ATTRIBUTE_UNUSED)
750 {
751 }
752
753 /************************************************************************
754 * *
755 * Old set of SAXv1 functions *
756 * *
757 ************************************************************************/
758 static int deprecated_v1_msg = 0;
759
760 #define DEPRECATED(n) \
761 if (deprecated_v1_msg == 0) \
762 fprintf(stderr, \
763 "Use of deprecated SAXv1 function %s\n", n); \
764 deprecated_v1_msg++;
765
766 /**
767 * getPublicId:
768 * @ctx: the user data (XML parser context)
769 *
770 * Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
771 * DEPRECATED: use xmlSAX2GetPublicId()
772 *
773 * Returns a xmlChar *
774 */
775 const xmlChar *
getPublicId(void * ctx)776 getPublicId(void *ctx)
777 {
778 DEPRECATED("getPublicId")
779 return (xmlSAX2GetPublicId(ctx));
780 }
781
782 /**
783 * getSystemId:
784 * @ctx: the user data (XML parser context)
785 *
786 * Provides the system ID, basically URL or filename e.g.
787 * http://www.sgmlsource.com/dtds/memo.dtd
788 * DEPRECATED: use xmlSAX2GetSystemId()
789 *
790 * Returns a xmlChar *
791 */
792 const xmlChar *
getSystemId(void * ctx)793 getSystemId(void *ctx)
794 {
795 DEPRECATED("getSystemId")
796 return (xmlSAX2GetSystemId(ctx));
797 }
798
799 /**
800 * getLineNumber:
801 * @ctx: the user data (XML parser context)
802 *
803 * Provide the line number of the current parsing point.
804 * DEPRECATED: use xmlSAX2GetLineNumber()
805 *
806 * Returns an int
807 */
808 int
getLineNumber(void * ctx)809 getLineNumber(void *ctx)
810 {
811 DEPRECATED("getLineNumber")
812 return (xmlSAX2GetLineNumber(ctx));
813 }
814
815 /**
816 * getColumnNumber:
817 * @ctx: the user data (XML parser context)
818 *
819 * Provide the column number of the current parsing point.
820 * DEPRECATED: use xmlSAX2GetColumnNumber()
821 *
822 * Returns an int
823 */
824 int
getColumnNumber(void * ctx)825 getColumnNumber(void *ctx)
826 {
827 DEPRECATED("getColumnNumber")
828 return (xmlSAX2GetColumnNumber(ctx));
829 }
830
831 /**
832 * isStandalone:
833 * @ctx: the user data (XML parser context)
834 *
835 * Is this document tagged standalone ?
836 * DEPRECATED: use xmlSAX2IsStandalone()
837 *
838 * Returns 1 if true
839 */
840 int
isStandalone(void * ctx)841 isStandalone(void *ctx)
842 {
843 DEPRECATED("isStandalone")
844 return (xmlSAX2IsStandalone(ctx));
845 }
846
847 /**
848 * hasInternalSubset:
849 * @ctx: the user data (XML parser context)
850 *
851 * Does this document has an internal subset
852 * DEPRECATED: use xmlSAX2HasInternalSubset()
853 *
854 * Returns 1 if true
855 */
856 int
hasInternalSubset(void * ctx)857 hasInternalSubset(void *ctx)
858 {
859 DEPRECATED("hasInternalSubset")
860 return (xmlSAX2HasInternalSubset(ctx));
861 }
862
863 /**
864 * hasExternalSubset:
865 * @ctx: the user data (XML parser context)
866 *
867 * Does this document has an external subset
868 * DEPRECATED: use xmlSAX2HasExternalSubset()
869 *
870 * Returns 1 if true
871 */
872 int
hasExternalSubset(void * ctx)873 hasExternalSubset(void *ctx)
874 {
875 DEPRECATED("hasExternalSubset")
876 return (xmlSAX2HasExternalSubset(ctx));
877 }
878
879 /**
880 * internalSubset:
881 * @ctx: the user data (XML parser context)
882 * @name: the root element name
883 * @ExternalID: the external ID
884 * @SystemID: the SYSTEM ID (e.g. filename or URL)
885 *
886 * Callback on internal subset declaration.
887 * DEPRECATED: use xmlSAX2InternalSubset()
888 */
889 void
internalSubset(void * ctx,const xmlChar * name,const xmlChar * ExternalID,const xmlChar * SystemID)890 internalSubset(void *ctx, const xmlChar * name,
891 const xmlChar * ExternalID, const xmlChar * SystemID)
892 {
893 DEPRECATED("internalSubset")
894 xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
895 }
896
897 /**
898 * externalSubset:
899 * @ctx: the user data (XML parser context)
900 * @name: the root element name
901 * @ExternalID: the external ID
902 * @SystemID: the SYSTEM ID (e.g. filename or URL)
903 *
904 * Callback on external subset declaration.
905 * DEPRECATED: use xmlSAX2ExternalSubset()
906 */
907 void
externalSubset(void * ctx,const xmlChar * name,const xmlChar * ExternalID,const xmlChar * SystemID)908 externalSubset(void *ctx, const xmlChar * name,
909 const xmlChar * ExternalID, const xmlChar * SystemID)
910 {
911 DEPRECATED("externalSubset")
912 xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
913 }
914
915 /**
916 * resolveEntity:
917 * @ctx: the user data (XML parser context)
918 * @publicId: The public ID of the entity
919 * @systemId: The system ID of the entity
920 *
921 * The entity loader, to control the loading of external entities,
922 * the application can either:
923 * - override this resolveEntity() callback in the SAX block
924 * - or better use the xmlSetExternalEntityLoader() function to
925 * set up it's own entity resolution routine
926 * DEPRECATED: use xmlSAX2ResolveEntity()
927 *
928 * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
929 */
930 xmlParserInputPtr
resolveEntity(void * ctx,const xmlChar * publicId,const xmlChar * systemId)931 resolveEntity(void *ctx, const xmlChar * publicId,
932 const xmlChar * systemId)
933 {
934 DEPRECATED("resolveEntity")
935 return (xmlSAX2ResolveEntity(ctx, publicId, systemId));
936 }
937
938 /**
939 * getEntity:
940 * @ctx: the user data (XML parser context)
941 * @name: The entity name
942 *
943 * Get an entity by name
944 * DEPRECATED: use xmlSAX2GetEntity()
945 *
946 * Returns the xmlEntityPtr if found.
947 */
948 xmlEntityPtr
getEntity(void * ctx,const xmlChar * name)949 getEntity(void *ctx, const xmlChar * name)
950 {
951 DEPRECATED("getEntity")
952 return (xmlSAX2GetEntity(ctx, name));
953 }
954
955 /**
956 * getParameterEntity:
957 * @ctx: the user data (XML parser context)
958 * @name: The entity name
959 *
960 * Get a parameter entity by name
961 * DEPRECATED: use xmlSAX2GetParameterEntity()
962 *
963 * Returns the xmlEntityPtr if found.
964 */
965 xmlEntityPtr
getParameterEntity(void * ctx,const xmlChar * name)966 getParameterEntity(void *ctx, const xmlChar * name)
967 {
968 DEPRECATED("getParameterEntity")
969 return (xmlSAX2GetParameterEntity(ctx, name));
970 }
971
972
973 /**
974 * entityDecl:
975 * @ctx: the user data (XML parser context)
976 * @name: the entity name
977 * @type: the entity type
978 * @publicId: The public ID of the entity
979 * @systemId: The system ID of the entity
980 * @content: the entity value (without processing).
981 *
982 * An entity definition has been parsed
983 * DEPRECATED: use xmlSAX2EntityDecl()
984 */
985 void
entityDecl(void * ctx,const xmlChar * name,int type,const xmlChar * publicId,const xmlChar * systemId,xmlChar * content)986 entityDecl(void *ctx, const xmlChar * name, int type,
987 const xmlChar * publicId, const xmlChar * systemId,
988 xmlChar * content)
989 {
990 DEPRECATED("entityDecl")
991 xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
992 }
993
994 /**
995 * attributeDecl:
996 * @ctx: the user data (XML parser context)
997 * @elem: the name of the element
998 * @fullname: the attribute name
999 * @type: the attribute type
1000 * @def: the type of default value
1001 * @defaultValue: the attribute default value
1002 * @tree: the tree of enumerated value set
1003 *
1004 * An attribute definition has been parsed
1005 * DEPRECATED: use xmlSAX2AttributeDecl()
1006 */
1007 void
attributeDecl(void * ctx,const xmlChar * elem,const xmlChar * fullname,int type,int def,const xmlChar * defaultValue,xmlEnumerationPtr tree)1008 attributeDecl(void *ctx, const xmlChar * elem, const xmlChar * fullname,
1009 int type, int def, const xmlChar * defaultValue,
1010 xmlEnumerationPtr tree)
1011 {
1012 DEPRECATED("attributeDecl")
1013 xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue,
1014 tree);
1015 }
1016
1017 /**
1018 * elementDecl:
1019 * @ctx: the user data (XML parser context)
1020 * @name: the element name
1021 * @type: the element type
1022 * @content: the element value tree
1023 *
1024 * An element definition has been parsed
1025 * DEPRECATED: use xmlSAX2ElementDecl()
1026 */
1027 void
elementDecl(void * ctx,const xmlChar * name,int type,xmlElementContentPtr content)1028 elementDecl(void *ctx, const xmlChar * name, int type,
1029 xmlElementContentPtr content)
1030 {
1031 DEPRECATED("elementDecl")
1032 xmlSAX2ElementDecl(ctx, name, type, content);
1033 }
1034
1035 /**
1036 * notationDecl:
1037 * @ctx: the user data (XML parser context)
1038 * @name: The name of the notation
1039 * @publicId: The public ID of the entity
1040 * @systemId: The system ID of the entity
1041 *
1042 * What to do when a notation declaration has been parsed.
1043 * DEPRECATED: use xmlSAX2NotationDecl()
1044 */
1045 void
notationDecl(void * ctx,const xmlChar * name,const xmlChar * publicId,const xmlChar * systemId)1046 notationDecl(void *ctx, const xmlChar * name,
1047 const xmlChar * publicId, const xmlChar * systemId)
1048 {
1049 DEPRECATED("notationDecl")
1050 xmlSAX2NotationDecl(ctx, name, publicId, systemId);
1051 }
1052
1053 /**
1054 * unparsedEntityDecl:
1055 * @ctx: the user data (XML parser context)
1056 * @name: The name of the entity
1057 * @publicId: The public ID of the entity
1058 * @systemId: The system ID of the entity
1059 * @notationName: the name of the notation
1060 *
1061 * What to do when an unparsed entity declaration is parsed
1062 * DEPRECATED: use xmlSAX2UnparsedEntityDecl()
1063 */
1064 void
unparsedEntityDecl(void * ctx,const xmlChar * name,const xmlChar * publicId,const xmlChar * systemId,const xmlChar * notationName)1065 unparsedEntityDecl(void *ctx, const xmlChar * name,
1066 const xmlChar * publicId, const xmlChar * systemId,
1067 const xmlChar * notationName)
1068 {
1069 DEPRECATED("unparsedEntityDecl")
1070 xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId,
1071 notationName);
1072 }
1073
1074 /**
1075 * setDocumentLocator:
1076 * @ctx: the user data (XML parser context)
1077 * @loc: A SAX Locator
1078 *
1079 * Receive the document locator at startup, actually xmlDefaultSAXLocator
1080 * Everything is available on the context, so this is useless in our case.
1081 * DEPRECATED
1082 */
1083 void
setDocumentLocator(void * ctx ATTRIBUTE_UNUSED,xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)1084 setDocumentLocator(void *ctx ATTRIBUTE_UNUSED,
1085 xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
1086 {
1087 DEPRECATED("setDocumentLocator")
1088 }
1089
1090 /**
1091 * startDocument:
1092 * @ctx: the user data (XML parser context)
1093 *
1094 * called when the document start being processed.
1095 * DEPRECATED: use xmlSAX2StartDocument()
1096 */
1097 void
startDocument(void * ctx)1098 startDocument(void *ctx)
1099 {
1100 /* don't be too painful for glade users */
1101 /* DEPRECATED("startDocument") */
1102 xmlSAX2StartDocument(ctx);
1103 }
1104
1105 /**
1106 * endDocument:
1107 * @ctx: the user data (XML parser context)
1108 *
1109 * called when the document end has been detected.
1110 * DEPRECATED: use xmlSAX2EndDocument()
1111 */
1112 void
endDocument(void * ctx)1113 endDocument(void *ctx)
1114 {
1115 DEPRECATED("endDocument")
1116 xmlSAX2EndDocument(ctx);
1117 }
1118
1119 /**
1120 * attribute:
1121 * @ctx: the user data (XML parser context)
1122 * @fullname: The attribute name, including namespace prefix
1123 * @value: The attribute value
1124 *
1125 * Handle an attribute that has been read by the parser.
1126 * The default handling is to convert the attribute into an
1127 * DOM subtree and past it in a new xmlAttr element added to
1128 * the element.
1129 * DEPRECATED: use xmlSAX2Attribute()
1130 */
1131 void
attribute(void * ctx ATTRIBUTE_UNUSED,const xmlChar * fullname ATTRIBUTE_UNUSED,const xmlChar * value ATTRIBUTE_UNUSED)1132 attribute(void *ctx ATTRIBUTE_UNUSED,
1133 const xmlChar * fullname ATTRIBUTE_UNUSED,
1134 const xmlChar * value ATTRIBUTE_UNUSED)
1135 {
1136 DEPRECATED("attribute")
1137 }
1138
1139 /**
1140 * startElement:
1141 * @ctx: the user data (XML parser context)
1142 * @fullname: The element name, including namespace prefix
1143 * @atts: An array of name/value attributes pairs, NULL terminated
1144 *
1145 * called when an opening tag has been processed.
1146 * DEPRECATED: use xmlSAX2StartElement()
1147 */
1148 void
startElement(void * ctx,const xmlChar * fullname,const xmlChar ** atts)1149 startElement(void *ctx, const xmlChar * fullname, const xmlChar ** atts)
1150 {
1151 xmlSAX2StartElement(ctx, fullname, atts);
1152 }
1153
1154 /**
1155 * endElement:
1156 * @ctx: the user data (XML parser context)
1157 * @name: The element name
1158 *
1159 * called when the end of an element has been detected.
1160 * DEPRECATED: use xmlSAX2EndElement()
1161 */
1162 void
endElement(void * ctx,const xmlChar * name ATTRIBUTE_UNUSED)1163 endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED)
1164 {
1165 DEPRECATED("endElement")
1166 xmlSAX2EndElement(ctx, name);
1167 }
1168
1169 /**
1170 * reference:
1171 * @ctx: the user data (XML parser context)
1172 * @name: The entity name
1173 *
1174 * called when an entity reference is detected.
1175 * DEPRECATED: use xmlSAX2Reference()
1176 */
1177 void
reference(void * ctx,const xmlChar * name)1178 reference(void *ctx, const xmlChar * name)
1179 {
1180 DEPRECATED("reference")
1181 xmlSAX2Reference(ctx, name);
1182 }
1183
1184 /**
1185 * characters:
1186 * @ctx: the user data (XML parser context)
1187 * @ch: a xmlChar string
1188 * @len: the number of xmlChar
1189 *
1190 * receiving some chars from the parser.
1191 * DEPRECATED: use xmlSAX2Characters()
1192 */
1193 void
characters(void * ctx,const xmlChar * ch,int len)1194 characters(void *ctx, const xmlChar * ch, int len)
1195 {
1196 DEPRECATED("characters")
1197 xmlSAX2Characters(ctx, ch, len);
1198 }
1199
1200 /**
1201 * ignorableWhitespace:
1202 * @ctx: the user data (XML parser context)
1203 * @ch: a xmlChar string
1204 * @len: the number of xmlChar
1205 *
1206 * receiving some ignorable whitespaces from the parser.
1207 * UNUSED: by default the DOM building will use characters
1208 * DEPRECATED: use xmlSAX2IgnorableWhitespace()
1209 */
1210 void
ignorableWhitespace(void * ctx ATTRIBUTE_UNUSED,const xmlChar * ch ATTRIBUTE_UNUSED,int len ATTRIBUTE_UNUSED)1211 ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED,
1212 const xmlChar * ch ATTRIBUTE_UNUSED,
1213 int len ATTRIBUTE_UNUSED)
1214 {
1215 DEPRECATED("ignorableWhitespace")
1216 }
1217
1218 /**
1219 * processingInstruction:
1220 * @ctx: the user data (XML parser context)
1221 * @target: the target name
1222 * @data: the PI data's
1223 *
1224 * A processing instruction has been parsed.
1225 * DEPRECATED: use xmlSAX2ProcessingInstruction()
1226 */
1227 void
processingInstruction(void * ctx,const xmlChar * target,const xmlChar * data)1228 processingInstruction(void *ctx, const xmlChar * target,
1229 const xmlChar * data)
1230 {
1231 DEPRECATED("processingInstruction")
1232 xmlSAX2ProcessingInstruction(ctx, target, data);
1233 }
1234
1235 /**
1236 * globalNamespace:
1237 * @ctx: the user data (XML parser context)
1238 * @href: the namespace associated URN
1239 * @prefix: the namespace prefix
1240 *
1241 * An old global namespace has been parsed.
1242 * DEPRECATED
1243 */
1244 void
globalNamespace(void * ctx ATTRIBUTE_UNUSED,const xmlChar * href ATTRIBUTE_UNUSED,const xmlChar * prefix ATTRIBUTE_UNUSED)1245 globalNamespace(void *ctx ATTRIBUTE_UNUSED,
1246 const xmlChar * href ATTRIBUTE_UNUSED,
1247 const xmlChar * prefix ATTRIBUTE_UNUSED)
1248 {
1249 DEPRECATED("globalNamespace")
1250 }
1251
1252 /**
1253 * setNamespace:
1254 * @ctx: the user data (XML parser context)
1255 * @name: the namespace prefix
1256 *
1257 * Set the current element namespace.
1258 * DEPRECATED
1259 */
1260
1261 void
setNamespace(void * ctx ATTRIBUTE_UNUSED,const xmlChar * name ATTRIBUTE_UNUSED)1262 setNamespace(void *ctx ATTRIBUTE_UNUSED,
1263 const xmlChar * name ATTRIBUTE_UNUSED)
1264 {
1265 DEPRECATED("setNamespace")
1266 }
1267
1268 /**
1269 * getNamespace:
1270 * @ctx: the user data (XML parser context)
1271 *
1272 * Get the current element namespace.
1273 * DEPRECATED
1274 *
1275 * Returns the xmlNsPtr or NULL if none
1276 */
1277
1278 xmlNsPtr
getNamespace(void * ctx ATTRIBUTE_UNUSED)1279 getNamespace(void *ctx ATTRIBUTE_UNUSED)
1280 {
1281 DEPRECATED("getNamespace")
1282 return (NULL);
1283 }
1284
1285 /**
1286 * checkNamespace:
1287 * @ctx: the user data (XML parser context)
1288 * @namespace: the namespace to check against
1289 *
1290 * Check that the current element namespace is the same as the
1291 * one read upon parsing.
1292 * DEPRECATED
1293 *
1294 * Returns 1 if true 0 otherwise
1295 */
1296
1297 int
checkNamespace(void * ctx ATTRIBUTE_UNUSED,xmlChar * namespace ATTRIBUTE_UNUSED)1298 checkNamespace(void *ctx ATTRIBUTE_UNUSED,
1299 xmlChar * namespace ATTRIBUTE_UNUSED)
1300 {
1301 DEPRECATED("checkNamespace")
1302 return (0);
1303 }
1304
1305 /**
1306 * namespaceDecl:
1307 * @ctx: the user data (XML parser context)
1308 * @href: the namespace associated URN
1309 * @prefix: the namespace prefix
1310 *
1311 * A namespace has been parsed.
1312 * DEPRECATED
1313 */
1314 void
namespaceDecl(void * ctx ATTRIBUTE_UNUSED,const xmlChar * href ATTRIBUTE_UNUSED,const xmlChar * prefix ATTRIBUTE_UNUSED)1315 namespaceDecl(void *ctx ATTRIBUTE_UNUSED,
1316 const xmlChar * href ATTRIBUTE_UNUSED,
1317 const xmlChar * prefix ATTRIBUTE_UNUSED)
1318 {
1319 DEPRECATED("namespaceDecl")
1320 }
1321
1322 /**
1323 * comment:
1324 * @ctx: the user data (XML parser context)
1325 * @value: the comment content
1326 *
1327 * A comment has been parsed.
1328 * DEPRECATED: use xmlSAX2Comment()
1329 */
1330 void
comment(void * ctx,const xmlChar * value)1331 comment(void *ctx, const xmlChar * value)
1332 {
1333 DEPRECATED("comment")
1334 xmlSAX2Comment(ctx, value);
1335 }
1336
1337 /**
1338 * cdataBlock:
1339 * @ctx: the user data (XML parser context)
1340 * @value: The pcdata content
1341 * @len: the block length
1342 *
1343 * called when a pcdata block has been parsed
1344 * DEPRECATED: use xmlSAX2CDataBlock()
1345 */
1346 void
cdataBlock(void * ctx,const xmlChar * value,int len)1347 cdataBlock(void *ctx, const xmlChar * value, int len)
1348 {
1349 DEPRECATED("cdataBlock")
1350 xmlSAX2CDataBlock(ctx, value, len);
1351 }
1352
1353 /*
1354 * nanoftp.h
1355 */
1356
1357 /** DOC_DISABLE */
1358
1359 #ifdef _WIN32
1360 #include <winsock2.h>
1361 #else
1362 #define SOCKET int
1363 #endif
1364
1365 typedef void
1366 (*ftpListCallback)(void *userData, const char *filename, const char *attrib,
1367 const char *owner, const char *group, unsigned long size,
1368 int links, int year, const char *month, int day, int hour,
1369 int minute);
1370
1371 typedef void
1372 (*ftpDataCallback) (void *userData, const char *data, int len);
1373
1374 XMLPUBFUN void
1375 xmlNanoFTPInit(void);
1376
1377 void
xmlNanoFTPInit(void)1378 xmlNanoFTPInit(void) {
1379 }
1380
1381 XMLPUBFUN void
1382 xmlNanoFTPCleanup(void);
1383
1384 void
xmlNanoFTPCleanup(void)1385 xmlNanoFTPCleanup(void) {
1386 }
1387
1388 XMLPUBFUN void
1389 xmlNanoFTPProxy(const char *host, int port, const char *user,
1390 const char *passwd, int type);
1391
1392 void
xmlNanoFTPProxy(const char * host ATTRIBUTE_UNUSED,int port ATTRIBUTE_UNUSED,const char * user ATTRIBUTE_UNUSED,const char * passwd ATTRIBUTE_UNUSED,int type ATTRIBUTE_UNUSED)1393 xmlNanoFTPProxy(const char *host ATTRIBUTE_UNUSED, int port ATTRIBUTE_UNUSED,
1394 const char *user ATTRIBUTE_UNUSED,
1395 const char *passwd ATTRIBUTE_UNUSED, int type ATTRIBUTE_UNUSED) {
1396 }
1397
1398 XMLPUBFUN int
1399 xmlNanoFTPUpdateURL(void *ctx, const char *URL);
1400
1401 int
xmlNanoFTPUpdateURL(void * ctx ATTRIBUTE_UNUSED,const char * URL ATTRIBUTE_UNUSED)1402 xmlNanoFTPUpdateURL(void *ctx ATTRIBUTE_UNUSED,
1403 const char *URL ATTRIBUTE_UNUSED) {
1404 return(-1);
1405 }
1406
1407 XMLPUBFUN void
1408 xmlNanoFTPScanProxy(const char *URL);
1409
1410 void
xmlNanoFTPScanProxy(const char * URL ATTRIBUTE_UNUSED)1411 xmlNanoFTPScanProxy(const char *URL ATTRIBUTE_UNUSED) {
1412 }
1413
1414 XMLPUBFUN void *
1415 xmlNanoFTPNewCtxt(const char *URL);
1416
1417 void*
xmlNanoFTPNewCtxt(const char * URL ATTRIBUTE_UNUSED)1418 xmlNanoFTPNewCtxt(const char *URL ATTRIBUTE_UNUSED) {
1419 return(NULL);
1420 }
1421
1422 XMLPUBFUN void
1423 xmlNanoFTPFreeCtxt(void *ctx);
1424
1425 void
xmlNanoFTPFreeCtxt(void * ctx ATTRIBUTE_UNUSED)1426 xmlNanoFTPFreeCtxt(void * ctx ATTRIBUTE_UNUSED) {
1427 }
1428
1429 XMLPUBFUN int
1430 xmlNanoFTPGetResponse(void *ctx);
1431
1432 int
xmlNanoFTPGetResponse(void * ctx ATTRIBUTE_UNUSED)1433 xmlNanoFTPGetResponse(void *ctx ATTRIBUTE_UNUSED) {
1434 return(-1);
1435 }
1436
1437 XMLPUBFUN int
1438 xmlNanoFTPCheckResponse(void *ctx);
1439
1440 int
xmlNanoFTPCheckResponse(void * ctx ATTRIBUTE_UNUSED)1441 xmlNanoFTPCheckResponse(void *ctx ATTRIBUTE_UNUSED) {
1442 return(-1);
1443 }
1444
1445 XMLPUBFUN int
1446 xmlNanoFTPQuit(void *ctx);
1447
1448 int
xmlNanoFTPQuit(void * ctx ATTRIBUTE_UNUSED)1449 xmlNanoFTPQuit(void *ctx ATTRIBUTE_UNUSED) {
1450 return(-1);
1451 }
1452
1453 XMLPUBFUN int
1454 xmlNanoFTPConnect(void *ctx);
1455
1456 int
xmlNanoFTPConnect(void * ctx ATTRIBUTE_UNUSED)1457 xmlNanoFTPConnect(void *ctx ATTRIBUTE_UNUSED) {
1458 return(-1);
1459 }
1460
1461 XMLPUBFUN void *
1462 xmlNanoFTPConnectTo(const char *server, int port);
1463
1464 void*
xmlNanoFTPConnectTo(const char * server ATTRIBUTE_UNUSED,int port ATTRIBUTE_UNUSED)1465 xmlNanoFTPConnectTo(const char *server ATTRIBUTE_UNUSED,
1466 int port ATTRIBUTE_UNUSED) {
1467 return(NULL);
1468 }
1469
1470 XMLPUBFUN int
1471 xmlNanoFTPCwd(void *ctx, const char *directory);
1472
1473 int
xmlNanoFTPCwd(void * ctx ATTRIBUTE_UNUSED,const char * directory ATTRIBUTE_UNUSED)1474 xmlNanoFTPCwd(void *ctx ATTRIBUTE_UNUSED,
1475 const char *directory ATTRIBUTE_UNUSED) {
1476 return(-1);
1477 }
1478
1479 XMLPUBFUN int
1480 xmlNanoFTPDele(void *ctx, const char *file);
1481
1482 int
xmlNanoFTPDele(void * ctx ATTRIBUTE_UNUSED,const char * file ATTRIBUTE_UNUSED)1483 xmlNanoFTPDele(void *ctx ATTRIBUTE_UNUSED, const char *file ATTRIBUTE_UNUSED) {
1484 return(-1);
1485 }
1486
1487 XMLPUBFUN SOCKET
1488 xmlNanoFTPGetConnection(void *ctx);
1489
1490 SOCKET
xmlNanoFTPGetConnection(void * ctx ATTRIBUTE_UNUSED)1491 xmlNanoFTPGetConnection(void *ctx ATTRIBUTE_UNUSED) {
1492 return(-1);
1493 }
1494
1495 XMLPUBFUN int
1496 xmlNanoFTPCloseConnection(void *ctx);
1497
1498 int
xmlNanoFTPCloseConnection(void * ctx ATTRIBUTE_UNUSED)1499 xmlNanoFTPCloseConnection(void *ctx ATTRIBUTE_UNUSED) {
1500 return(-1);
1501 }
1502
1503 XMLPUBFUN int
1504 xmlNanoFTPList(void *ctx, ftpListCallback callback, void *userData,
1505 const char *filename);
1506
1507 int
xmlNanoFTPList(void * ctx ATTRIBUTE_UNUSED,ftpListCallback callback ATTRIBUTE_UNUSED,void * userData ATTRIBUTE_UNUSED,const char * filename ATTRIBUTE_UNUSED)1508 xmlNanoFTPList(void *ctx ATTRIBUTE_UNUSED,
1509 ftpListCallback callback ATTRIBUTE_UNUSED,
1510 void *userData ATTRIBUTE_UNUSED,
1511 const char *filename ATTRIBUTE_UNUSED) {
1512 return(-1);
1513 }
1514
1515 XMLPUBFUN SOCKET
1516 xmlNanoFTPGetSocket(void *ctx, const char *filename);
1517
1518 SOCKET
xmlNanoFTPGetSocket(void * ctx ATTRIBUTE_UNUSED,const char * filename ATTRIBUTE_UNUSED)1519 xmlNanoFTPGetSocket(void *ctx ATTRIBUTE_UNUSED,
1520 const char *filename ATTRIBUTE_UNUSED) {
1521 return(-1);
1522 }
1523
1524 XMLPUBFUN int
1525 xmlNanoFTPGet(void *ctx, ftpDataCallback callback, void *userData,
1526 const char *filename);
1527
1528 int
xmlNanoFTPGet(void * ctx ATTRIBUTE_UNUSED,ftpDataCallback callback ATTRIBUTE_UNUSED,void * userData ATTRIBUTE_UNUSED,const char * filename ATTRIBUTE_UNUSED)1529 xmlNanoFTPGet(void *ctx ATTRIBUTE_UNUSED,
1530 ftpDataCallback callback ATTRIBUTE_UNUSED,
1531 void *userData ATTRIBUTE_UNUSED,
1532 const char *filename ATTRIBUTE_UNUSED) {
1533 return(-1);
1534 }
1535
1536 XMLPUBFUN int
1537 xmlNanoFTPRead(void *ctx, void *dest, int len);
1538
1539 int
xmlNanoFTPRead(void * ctx ATTRIBUTE_UNUSED,void * dest ATTRIBUTE_UNUSED,int len ATTRIBUTE_UNUSED)1540 xmlNanoFTPRead(void *ctx ATTRIBUTE_UNUSED, void *dest ATTRIBUTE_UNUSED,
1541 int len ATTRIBUTE_UNUSED) {
1542 return(-1);
1543 }
1544
1545 XMLPUBFUN void *
1546 xmlNanoFTPOpen(const char *URL);
1547
1548 void*
xmlNanoFTPOpen(const char * URL ATTRIBUTE_UNUSED)1549 xmlNanoFTPOpen(const char *URL ATTRIBUTE_UNUSED) {
1550 return(NULL);
1551 }
1552
1553 XMLPUBFUN int
1554 xmlNanoFTPClose(void *ctx);
1555
1556 int
xmlNanoFTPClose(void * ctx ATTRIBUTE_UNUSED)1557 xmlNanoFTPClose(void *ctx ATTRIBUTE_UNUSED) {
1558 return(-1);
1559 }
1560
1561 XMLPUBFUN int
1562 xmlIOFTPMatch(const char *filename);
1563
1564 int
xmlIOFTPMatch(const char * filename ATTRIBUTE_UNUSED)1565 xmlIOFTPMatch(const char *filename ATTRIBUTE_UNUSED) {
1566 return(0);
1567 }
1568
1569 XMLPUBFUN void *
1570 xmlIOFTPOpen(const char *filename);
1571
1572 void *
xmlIOFTPOpen(const char * filename ATTRIBUTE_UNUSED)1573 xmlIOFTPOpen(const char *filename ATTRIBUTE_UNUSED) {
1574 return(NULL);
1575 }
1576
1577 XMLPUBFUN int
1578 xmlIOFTPRead(void *context, char *buffer, int len);
1579
1580 int
xmlIOFTPRead(void * context ATTRIBUTE_UNUSED,char * buffer ATTRIBUTE_UNUSED,int len ATTRIBUTE_UNUSED)1581 xmlIOFTPRead(void *context ATTRIBUTE_UNUSED, char *buffer ATTRIBUTE_UNUSED,
1582 int len ATTRIBUTE_UNUSED) {
1583 return(-1);
1584 }
1585
1586 XMLPUBFUN int
1587 xmlIOFTPClose(void *context);
1588
1589 int
xmlIOFTPClose(void * context ATTRIBUTE_UNUSED)1590 xmlIOFTPClose(void *context ATTRIBUTE_UNUSED) {
1591 return(-1);
1592 }
1593
1594 /** DOC_ENABLE */
1595
1596 /*
1597 * xpointer.h
1598 */
1599
1600 /** DOC_DISABLE */
1601
1602 XMLPUBFUN void *
1603 xmlXPtrNewRange(void *start, int startindex,
1604 void *end, int endindex);
1605
1606 void *
xmlXPtrNewRange(void * start ATTRIBUTE_UNUSED,int startindex ATTRIBUTE_UNUSED,void * end ATTRIBUTE_UNUSED,int endindex ATTRIBUTE_UNUSED)1607 xmlXPtrNewRange(void *start ATTRIBUTE_UNUSED,
1608 int startindex ATTRIBUTE_UNUSED,
1609 void *end ATTRIBUTE_UNUSED,
1610 int endindex ATTRIBUTE_UNUSED) {
1611 return(NULL);
1612 }
1613
1614 XMLPUBFUN void *
1615 xmlXPtrNewRangePoints(void *start, void *end);
1616
1617 void *
xmlXPtrNewRangePoints(void * start ATTRIBUTE_UNUSED,void * end ATTRIBUTE_UNUSED)1618 xmlXPtrNewRangePoints(void *start ATTRIBUTE_UNUSED,
1619 void *end ATTRIBUTE_UNUSED) {
1620 return(NULL);
1621 }
1622
1623 XMLPUBFUN void *
1624 xmlXPtrNewRangePointNode(void *start, void *end);
1625
1626 void *
xmlXPtrNewRangePointNode(void * start ATTRIBUTE_UNUSED,void * end ATTRIBUTE_UNUSED)1627 xmlXPtrNewRangePointNode(void *start ATTRIBUTE_UNUSED,
1628 void *end ATTRIBUTE_UNUSED) {
1629 return(NULL);
1630 }
1631
1632 XMLPUBFUN void *
1633 xmlXPtrNewRangeNodePoint(void *start, void *end);
1634
1635 void *
xmlXPtrNewRangeNodePoint(void * start ATTRIBUTE_UNUSED,void * end ATTRIBUTE_UNUSED)1636 xmlXPtrNewRangeNodePoint(void *start ATTRIBUTE_UNUSED,
1637 void *end ATTRIBUTE_UNUSED) {
1638 return(NULL);
1639 }
1640
1641 XMLPUBFUN void *
1642 xmlXPtrNewRangeNodes(void *start, void *end);
1643
1644 void *
xmlXPtrNewRangeNodes(void * start ATTRIBUTE_UNUSED,void * end ATTRIBUTE_UNUSED)1645 xmlXPtrNewRangeNodes(void *start ATTRIBUTE_UNUSED,
1646 void *end ATTRIBUTE_UNUSED) {
1647 return(NULL);
1648 }
1649
1650 XMLPUBFUN void *
1651 xmlXPtrNewCollapsedRange(void *start);
1652
1653 void *
xmlXPtrNewCollapsedRange(void * start ATTRIBUTE_UNUSED)1654 xmlXPtrNewCollapsedRange(void *start ATTRIBUTE_UNUSED) {
1655 return(NULL);
1656 }
1657
1658 XMLPUBFUN void *
1659 xmlXPtrNewRangeNodeObject(void *start, void *end);
1660
1661 void *
xmlXPtrNewRangeNodeObject(void * start ATTRIBUTE_UNUSED,void * end ATTRIBUTE_UNUSED)1662 xmlXPtrNewRangeNodeObject(void *start ATTRIBUTE_UNUSED,
1663 void *end ATTRIBUTE_UNUSED) {
1664 return(NULL);
1665 }
1666
1667 XMLPUBFUN void *
1668 xmlXPtrLocationSetCreate(void *val);
1669
1670 void *
xmlXPtrLocationSetCreate(void * val ATTRIBUTE_UNUSED)1671 xmlXPtrLocationSetCreate(void *val ATTRIBUTE_UNUSED) {
1672 return(NULL);
1673 }
1674
1675 XMLPUBFUN void
1676 xmlXPtrLocationSetAdd(void *cur, void *val);
1677
1678 void
xmlXPtrLocationSetAdd(void * cur ATTRIBUTE_UNUSED,void * val ATTRIBUTE_UNUSED)1679 xmlXPtrLocationSetAdd(void *cur ATTRIBUTE_UNUSED,
1680 void *val ATTRIBUTE_UNUSED) {
1681 }
1682
1683 XMLPUBFUN void *
1684 xmlXPtrLocationSetMerge(void *val1, void *val2);
1685
1686 void *
xmlXPtrLocationSetMerge(void * val1 ATTRIBUTE_UNUSED,void * val2 ATTRIBUTE_UNUSED)1687 xmlXPtrLocationSetMerge(void *val1 ATTRIBUTE_UNUSED,
1688 void *val2 ATTRIBUTE_UNUSED) {
1689 return(NULL);
1690 }
1691
1692 XMLPUBFUN void
1693 xmlXPtrLocationSetDel(void *cur, void *val);
1694
1695 void
xmlXPtrLocationSetDel(void * cur ATTRIBUTE_UNUSED,void * val ATTRIBUTE_UNUSED)1696 xmlXPtrLocationSetDel(void *cur ATTRIBUTE_UNUSED,
1697 void *val ATTRIBUTE_UNUSED) {
1698 }
1699
1700 XMLPUBFUN void
1701 xmlXPtrLocationSetRemove(void *cur, int val);
1702
1703 void
xmlXPtrLocationSetRemove(void * cur ATTRIBUTE_UNUSED,int val ATTRIBUTE_UNUSED)1704 xmlXPtrLocationSetRemove(void *cur ATTRIBUTE_UNUSED,
1705 int val ATTRIBUTE_UNUSED) {
1706 }
1707
1708 XMLPUBFUN void
1709 xmlXPtrFreeLocationSet(void *obj);
1710
1711 void
xmlXPtrFreeLocationSet(void * obj ATTRIBUTE_UNUSED)1712 xmlXPtrFreeLocationSet(void *obj ATTRIBUTE_UNUSED) {
1713 }
1714
1715 XMLPUBFUN void *
1716 xmlXPtrNewLocationSetNodes(void *start, void *end);
1717
1718 void *
xmlXPtrNewLocationSetNodes(void * start ATTRIBUTE_UNUSED,void * end ATTRIBUTE_UNUSED)1719 xmlXPtrNewLocationSetNodes(void *start ATTRIBUTE_UNUSED,
1720 void *end ATTRIBUTE_UNUSED) {
1721 return(NULL);
1722 }
1723
1724 XMLPUBFUN void *
1725 xmlXPtrNewLocationSetNodeSet(void *set);
1726
1727 void *
xmlXPtrNewLocationSetNodeSet(void * set ATTRIBUTE_UNUSED)1728 xmlXPtrNewLocationSetNodeSet(void *set ATTRIBUTE_UNUSED) {
1729 return(NULL);
1730 }
1731
1732 XMLPUBFUN void *
1733 xmlXPtrWrapLocationSet(void *val);
1734
1735 void *
xmlXPtrWrapLocationSet(void * val ATTRIBUTE_UNUSED)1736 xmlXPtrWrapLocationSet(void *val ATTRIBUTE_UNUSED) {
1737 return(NULL);
1738 }
1739
1740 XMLPUBFUN void *
1741 xmlXPtrBuildNodeList(void *obj);
1742
1743 void *
xmlXPtrBuildNodeList(void * obj ATTRIBUTE_UNUSED)1744 xmlXPtrBuildNodeList(void *obj ATTRIBUTE_UNUSED) {
1745 return(NULL);
1746 }
1747
1748 XMLPUBFUN void
1749 xmlXPtrRangeToFunction(void *ctxt, int nargs);
1750
1751 void
xmlXPtrRangeToFunction(void * ctxt ATTRIBUTE_UNUSED,int nargs ATTRIBUTE_UNUSED)1752 xmlXPtrRangeToFunction(void *ctxt ATTRIBUTE_UNUSED,
1753 int nargs ATTRIBUTE_UNUSED) {
1754 }
1755
1756 /** DOC_ENABLE */
1757
1758 #endif /* LIBXML_LEGACY_ENABLED */
1759
1760