1 * Summary: internals routines and limits exported by the parser.
2 * Description: this module exports a number of internal parsing routines
3 * they are not really all intended for applications but
4 * can prove useful doing low level processing.
6 * Copy: See Copyright for the status of this software.
8 * Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
10 /if not defined(XML_PARSER_INTERNALS_H__)
11 /define XML_PARSER_INTERNALS_H__
13 /include "libxmlrpg/xmlversion"
14 /include "libxmlrpg/xmlTypesC"
15 /include "libxmlrpg/parser"
16 /include "libxmlrpg/HTMLparser"
17 /include "libxmlrpg/chvalid"
21 * arbitrary depth limit for the XML documents that we allow to
22 * process. This is not a limitation of the parser but a safety
23 * boundary feature, use XML_PARSE_HUGE option to override it.
25 d xmlParserMaxDepth...
26 d s import('xmlParserMaxDepth')
29 * XML_MAX_TEXT_LENGTH:
31 * Maximum size allowed for a single text node when building a tree.
32 * This is not a limitation of the parser but a safety boundary feature,
33 * use XML_PARSE_HUGE option to override it.
36 d XML_MAX_TEXT_LENGTH...
39 * XML_MAX_NAME_LENGTH:
41 * Maximum size allowed for a markup identitier
42 * This is not a limitation of the parser but a safety boundary feature,
43 * use XML_PARSE_HUGE option to override it.
44 * Note that with the use of parsing dictionaries overriding the limit
45 * may result in more runtime memory usage in face of "unfriendly' content
48 d XML_MAX_NAME_LENGTH...
51 * XML_MAX_DICTIONARY_LIMIT:
53 * Maximum size allowed by the parser for a dictionary by default
54 * This is not a limitation of the parser but a safety boundary feature,
55 * use XML_PARSE_HUGE option to override it.
58 d XML_MAX_DICTIONARY_LIMIT...
61 * XML_MAX_LOOKUP_LIMIT:
63 * Maximum size allowed by the parser for ahead lookup
64 * This is an upper boundary enforced by the parser to avoid bad
65 * behaviour on "unfriendly' content
68 d XML_MAX_LOOKUP_LIMIT...
73 * Identifiers can be longer, but this will be more costly
81 * The parser tries to always have that amount of input ready.
82 * One of the point is providing context when reporting errors.
86 * Global variables used for predefined strings.
88 d xmlStringText s 4 import('xmlStringText') \0 in 5th byte
90 d xmlStringTextNoenc...
91 d s 9 import('xmlStringTextNoenc') \0 in 10th byte
94 d s 7 import('xmlStringComment') \0 in 8th byte
96 * Function to finish the work of the macros where needed.
98 d xmlIsLetter pr extproc('xmlIsLetter')
100 d c value like(xmlCint)
104 d xmlCreateFileParserCtxt...
105 d pr extproc('xmlCreateFileParserCtxt')
106 d like(xmlParserCtxtPtr)
107 d filename * value options(*string) const char *
109 d xmlCreateURLParserCtxt...
110 d pr extproc('xmlCreateURLParserCtxt')
111 d like(xmlParserCtxtPtr)
112 d filename * value options(*string) const char *
113 d options value like(xmlCint)
115 d xmlCreateMemoryParserCtxt...
116 d pr extproc('xmlCreateMemoryParserCtxt')
117 d like(xmlParserCtxtPtr)
118 d buffer * value options(*string) const char *
119 d size value like(xmlCint)
121 d xmlCreateEntityParserCtxt...
122 d pr extproc('xmlCreateEntityParserCtxt')
123 d like(xmlParserCtxtPtr)
124 d URL * value options(*string) const xmlChar *
125 d ID * value options(*string) const xmlChar *
126 d base * value options(*string) const xmlChar *
128 d xmlSwitchEncoding...
129 d pr extproc('xmlSwitchEncoding')
131 d ctxt value like(xmlParserCtxtPtr)
132 d enc value like(xmlCharEncoding)
134 d xmlSwitchToEncoding...
135 d pr extproc('xmlSwitchToEncoding')
137 d ctxt value like(xmlParserCtxtPtr)
138 d handler value like(xmlCharEncodingHandlerPtr)
140 d xmlSwitchInputEncoding...
141 d pr extproc('xmlSwitchInputEncoding')
143 d ctxt value like(xmlParserCtxtPtr)
144 d input value like(xmlParserInputPtr)
145 d handler value like(xmlCharEncodingHandlerPtr)
149 d xmlNewStringInputStream...
150 d pr extproc('xmlNewStringInputStream')
151 d like(xmlParserInputPtr)
152 d ctxt value like(xmlParserCtxtPtr)
153 d buffer * value options(*string) const xmlChar *
155 d xmlNewEntityInputStream...
156 d pr extproc('xmlNewEntityInputStream')
157 d like(xmlParserInputPtr)
158 d ctxt value like(xmlParserCtxtPtr)
159 d entity value like(xmlEntityPtr)
161 d xmlPushInput pr extproc('xmlPushInput')
163 d ctxt value like(xmlParserCtxtPtr)
164 d input value like(xmlParserInputPtr)
166 d xmlPopInput pr extproc('xmlPopInput')
168 d ctxt value like(xmlParserCtxtPtr)
170 d xmlFreeInputStream...
171 d pr extproc('xmlFreeInputStream')
172 d input value like(xmlParserInputPtr)
174 d xmlNewInputFromFile...
175 d pr extproc('xmlNewInputFromFile')
176 d like(xmlParserInputPtr)
177 d ctxt value like(xmlParserCtxtPtr)
178 d filename * value options(*string) const char *
180 d xmlNewInputStream...
181 d pr extproc('xmlNewInputStream')
182 d like(xmlParserInputPtr)
183 d ctxt value like(xmlParserCtxtPtr)
187 d xmlSplitQName pr * extproc('xmlSplitQName') xmlChar *
188 d ctxt value like(xmlParserCtxtPtr)
189 d name * value options(*string) const xmlChar *
190 d prefix * xmlChar *(*)
192 * Generic production rules.
194 d xmlParseName pr * extproc('xmlParseName') const xmlChar *
195 d ctxt value like(xmlParserCtxtPtr)
198 d pr * extproc('xmlParseNmtoken') xmlChar *
199 d ctxt value like(xmlParserCtxtPtr)
201 d xmlParseEntityValue...
202 d pr * extproc('xmlParseEntityValue') xmlChar *
203 d ctxt value like(xmlParserCtxtPtr)
204 d orig * xmlChar *(*)
206 d xmlParseAttValue...
207 d pr * extproc('xmlParseAttValue') xmlChar *
208 d ctxt value like(xmlParserCtxtPtr)
210 d xmlParseSystemLiteral...
211 d pr * extproc('xmlParseSystemLiteral') xmlChar *
212 d ctxt value like(xmlParserCtxtPtr)
214 d xmlParsePubidLiteral...
215 d pr * extproc('xmlParsePubidLiteral') xmlChar *
216 d ctxt value like(xmlParserCtxtPtr)
218 d xmlParseCharData...
219 d pr extproc('xmlParseCharData')
220 d ctxt value like(xmlParserCtxtPtr)
221 d cdata value like(xmlCint)
223 d xmlParseExternalID...
224 d pr * extproc('xmlParseExternalID') xmlChar *
225 d ctxt value like(xmlParserCtxtPtr)
226 d publicID * xmlChar *(*)
227 d strict value like(xmlCint)
230 d pr extproc('xmlParseComment')
231 d ctxt value like(xmlParserCtxtPtr)
233 d xmlParsePITarget...
234 d pr * extproc('xmlParsePITarget') const xmlChar *
235 d ctxt value like(xmlParserCtxtPtr)
237 d xmlParsePI pr extproc('xmlParsePI')
238 d ctxt value like(xmlParserCtxtPtr)
240 d xmlParseNotationDecl...
241 d pr extproc('xmlParseNotationDecl')
242 d ctxt value like(xmlParserCtxtPtr)
244 d xmlParseEntityDecl...
245 d pr extproc('xmlParseEntityDecl')
246 d ctxt value like(xmlParserCtxtPtr)
248 d xmlParseDefaultDecl...
249 d pr extproc('xmlParseDefaultDecl')
251 d ctxt value like(xmlParserCtxtPtr)
252 d value * xmlChar *(*)
254 d xmlParseNotationType...
255 d pr extproc('xmlParseNotationType')
256 d like(xmlEnumerationPtr)
257 d ctxt value like(xmlParserCtxtPtr)
259 d xmlParseEnumerationType...
260 d pr extproc('xmlParseEnumerationType')
261 d like(xmlEnumerationPtr)
262 d ctxt value like(xmlParserCtxtPtr)
264 d xmlParseEnumeratedType...
265 d pr extproc('xmlParseEnumeratedType')
267 d ctxt value like(xmlParserCtxtPtr)
268 d tree * value xmlEnumerationPtr *
270 d xmlParseAttributeType...
271 d pr extproc('xmlParseAttributeType')
273 d ctxt value like(xmlParserCtxtPtr)
274 d tree * value xmlEnumerationPtr *
276 d xmlParseAttributeListDecl...
277 d pr extproc('xmlParseAttributeListDecl')
278 d ctxt value like(xmlParserCtxtPtr)
280 d xmlParseElementMixedContentDecl...
282 d 'xmlParseElementMixedContentDecl')
283 d like(xmlElementContentPtr)
284 d ctxt value like(xmlParserCtxtPtr)
285 d inputchk value like(xmlCint)
287 d xmlParseElementChildrenContentDecl...
289 d 'xmlParseElementChildrenContentDecl')
290 d like(xmlElementContentPtr)
291 d ctxt value like(xmlParserCtxtPtr)
292 d inputchk value like(xmlCint)
294 d xmlParseElementContentDecl...
295 d pr extproc('xmlParseElementContentDecl')
297 d ctxt value like(xmlParserCtxtPtr)
298 d name * value options(*string) const xmlChar *
299 d result * value xmlElementContentPtr
302 d xmlParseElementDecl...
303 d pr extproc('xmlParseElementDecl')
305 d ctxt value like(xmlParserCtxtPtr)
307 d xmlParseMarkupDecl...
308 d pr extproc('xmlParseMarkupDecl')
309 d ctxt value like(xmlParserCtxtPtr)
312 d pr extproc('xmlParseCharRef')
314 d ctxt value like(xmlParserCtxtPtr)
316 d xmlParseEntityRef...
317 d pr extproc('xmlParseEntityRef')
319 d ctxt value like(xmlParserCtxtPtr)
321 d xmlParseReference...
322 d pr extproc('xmlParseReference')
323 d ctxt value like(xmlParserCtxtPtr)
325 d xmlParsePEReference...
326 d pr extproc('xmlParsePEReference')
327 d ctxt value like(xmlParserCtxtPtr)
329 d xmlParseDocTypeDecl...
330 d pr extproc('xmlParseDocTypeDecl')
331 d ctxt value like(xmlParserCtxtPtr)
333 /if defined(LIBXML_SAX1_ENABLED)
334 d xmlParseAttribute...
335 d pr * extproc('xmlParseAttribute') const xmlChar *
336 d ctxt value like(xmlParserCtxtPtr)
337 d value * xmlChar *(*)
339 d xmlParseStartTag...
340 d pr * extproc('xmlParseStartTag') const xmlChar *
341 d ctxt value like(xmlParserCtxtPtr)
343 d xmlParseEndTag pr extproc('xmlParseEndTag')
344 d ctxt value like(xmlParserCtxtPtr)
345 /endif LIBXML_SAX1_ENABLED
347 d xmlParseCDSect pr extproc('xmlParseCDSect')
348 d ctxt value like(xmlParserCtxtPtr)
351 d pr extproc('xmlParseContent')
352 d ctxt value like(xmlParserCtxtPtr)
355 d pr extproc('xmlParseElement')
356 d ctxt value like(xmlParserCtxtPtr)
358 d xmlParseVersionNum...
359 d pr * extproc('xmlParseVersionNum') xmlChar *
360 d ctxt value like(xmlParserCtxtPtr)
362 d xmlParseVersionInfo...
363 d pr * extproc('xmlParseVersionInfo') xmlChar *
364 d ctxt value like(xmlParserCtxtPtr)
367 d pr * extproc('xmlParseEncName') xmlChar *
368 d ctxt value like(xmlParserCtxtPtr)
370 d xmlParseEncodingDecl...
371 d pr * extproc('xmlParseEncodingDecl') const xmlChar *
372 d ctxt value like(xmlParserCtxtPtr)
374 d xmlParseSDDecl pr extproc('xmlParseSDDecl')
376 d ctxt value like(xmlParserCtxtPtr)
379 d pr extproc('xmlParseXMLDecl')
380 d ctxt value like(xmlParserCtxtPtr)
382 d xmlParseTextDecl...
383 d pr extproc('xmlParseTextDecl')
384 d ctxt value like(xmlParserCtxtPtr)
386 d xmlParseMisc pr extproc('xmlParseMisc')
387 d ctxt value like(xmlParserCtxtPtr)
389 d xmlParseExternalSubset...
390 d pr extproc('xmlParseExternalSubset')
391 d ctxt value like(xmlParserCtxtPtr)
392 d ExternalID * value options(*string) const xmlChar *
393 d SystemID * value options(*string) const xmlChar *
395 * XML_SUBSTITUTE_NONE:
397 * If no entities need to be substituted.
399 d XML_SUBSTITUTE_NONE...
402 * XML_SUBSTITUTE_REF:
404 * Whether general entities need to be substituted.
406 d XML_SUBSTITUTE_REF...
409 * XML_SUBSTITUTE_PEREF:
411 * Whether parameter entities need to be substituted.
413 d XML_SUBSTITUTE_PEREF...
416 * XML_SUBSTITUTE_BOTH:
418 * Both general and parameter entities need to be substituted.
420 d XML_SUBSTITUTE_BOTH...
423 d xmlStringDecodeEntities...
424 d pr * extproc('xmlStringDecodeEntities') xmlChar *
425 d ctxt value like(xmlParserCtxtPtr)
426 d str * value options(*string) const xmlChar *
427 d what value like(xmlCint)
428 d end value like(xmlChar)
429 d end2 value like(xmlChar)
430 d end3 value like(xmlChar)
432 d xmlStringLenDecodeEntities...
433 d pr * extproc('xmlStringLenDecodeEntities')xmlChar *
434 d ctxt value like(xmlParserCtxtPtr)
435 d str * value options(*string) const xmlChar *
436 d len value like(xmlCint)
437 d what value like(xmlCint)
438 d end value like(xmlChar)
439 d end2 value like(xmlChar)
440 d end3 value like(xmlChar)
442 * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
444 d nodePush pr extproc('nodePush')
446 d ctxt value like(xmlParserCtxtPtr)
447 d value value like(xmlNodePtr)
449 d nodePop pr extproc('nodePop')
451 d ctxt value like(xmlParserCtxtPtr)
453 d inputPush pr extproc('inputPush')
455 d ctxt value like(xmlParserCtxtPtr)
456 d value value like(xmlParserInputPtr)
458 d inputPop pr extproc('inputPop')
459 d like(xmlParserInputPtr)
460 d ctxt value like(xmlParserCtxtPtr)
462 d namePop pr * extproc('namePop') const xmlChar *
463 d ctxt value like(xmlParserCtxtPtr)
465 d namePush pr extproc('namePush')
467 d ctxt value like(xmlParserCtxtPtr)
468 d value * value options(*string) const xmlChar *
470 * other commodities shared between parser.c and parserInternals.
472 d xmlSkipBlankChars...
473 d pr extproc('xmlSkipBlankChars')
475 d ctxt value like(xmlParserCtxtPtr)
477 d xmlStringCurrentChar...
478 d pr extproc('xmlStringCurrentChar')
480 d ctxt value like(xmlParserCtxtPtr)
481 d cur * value options(*string) const xmlChar *
484 d xmlParserHandlePEReference...
485 d pr extproc('xmlParserHandlePEReference')
486 d ctxt value like(xmlParserCtxtPtr)
488 d xmlCheckLanguageID...
489 d pr extproc('xmlCheckLanguageID')
491 d lang * value options(*string) const xmlChar *
493 * Really core function shared with HTML parser.
495 d xmlCurrentChar pr extproc('xmlCurrentChar')
497 d ctxt value like(xmlParserCtxtPtr)
500 d xmlCopyCharMultiByte...
501 d pr extproc('xmlCopyCharMultiByte')
503 d out * value options(*string) xmlChar *
504 d val value like(xmlCint)
506 d xmlCopyChar pr extproc('xmlCopyChar')
508 d len value like(xmlCint)
509 d out * value options(*string) xmlChar *
510 d val value like(xmlCint)
512 d xmlNextChar pr extproc('xmlNextChar')
513 d ctxt value like(xmlParserCtxtPtr)
515 d xmlParserInputShrink...
516 d pr extproc('xmlParserInputShrink')
517 d in value like(xmlParserInputPtr)
519 /if defined(LIBXML_HTML_ENABLED)
521 * Actually comes from the HTML parser but launched from the init stuff.
523 d htmlInitAutoClose...
524 d pr extproc('htmlInitAutoClose')
526 d htmlCreateFileParserCtxt...
527 d pr extproc('htmlCreateFileParserCtxt')
528 d like(htmlParserCtxtPtr)
529 d filename * value options(*string) const char *
530 d encoding * value options(*string) const char *
533 * Specific function to keep track of entities references
534 * and used by the XSLT debugger.
536 /if defined(LIBXML_LEGACY_ENABLED)
537 * xmlEntityReferenceFunc:
539 * @firstNode: the fist node in the chunk
540 * @lastNode: the last nod in the chunk
542 * Callback function used when one needs to be able to track back the
543 * provenance of a chunk of nodes inherited from an entity replacement.
545 d xmlEntityReferenceFunc...
546 d s * based(######typedef######)
549 d xmlSetEntityReferenceFunc...
550 d pr extproc('xmlSetEntityReferenceFunc')
551 d func value like(xmlEntityReferenceFunc)
553 d xmlParseQuotedString...
554 d pr * extproc('xmlParseQuotedString') xmlChar *
555 d ctxt value like(xmlParserCtxtPtr)
557 d xmlParseNamespace...
558 d pr extproc('xmlParseNamespace')
559 d ctxt value like(xmlParserCtxtPtr)
561 d xmlNamespaceParseNSDef...
562 d pr * extproc('xmlNamespaceParseNSDef') xmlChar *
563 d ctxt value like(xmlParserCtxtPtr)
565 d xmlScanName pr * extproc('xmlScanName') xmlChar *
566 d ctxt value like(xmlParserCtxtPtr)
568 d xmlNamespaceParseNCName...
569 d pr * extproc('xmlNamespaceParseNCName') xmlChar *
570 d ctxt value like(xmlParserCtxtPtr)
572 d xmlParserHandleReference...
573 d pr extproc('xmlParserHandleReference')
574 d ctxt value like(xmlParserCtxtPtr)
576 d xmlNamespaceParseQName...
577 d pr * extproc('xmlNamespaceParseQName') xmlChar *
578 d ctxt value like(xmlParserCtxtPtr)
579 d prefix * xmlChar *(*)
583 d xmlDecodeEntities...
584 d pr * extproc('xmlDecodeEntities') xmlChar *
585 d ctxt value like(xmlParserCtxtPtr)
586 d len value like(xmlCint)
587 d what value like(xmlCint)
588 d end value like(xmlChar)
589 d end2 value like(xmlChar)
590 d end3 value like(xmlChar)
593 d pr extproc('xmlHandleEntity')
594 d ctxt value like(xmlParserCtxtPtr)
595 d entity value like(xmlEntityPtr)
596 /endif LIBXML_LEGACY_ENABLD