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/parser"
15 /include "libxmlrpg/HTMLparser"
16 /include "libxmlrpg/chvalid"
20 * arbitrary depth limit for the XML documents that we allow to
21 * process. This is not a limitation of the parser but a safety
22 * boundary feature, use XML_PARSE_HUGE option to override it.
24 d xmlParserMaxDepth...
25 d s 10u 0 import('xmlParserMaxDepth')
27 * XML_MAX_TEXT_LENGTH:
29 * Maximum size allowed for a single text node when building a tree.
30 * This is not a limitation of the parser but a safety boundary feature,
31 * use XML_PARSE_HUGE option to override it.
34 d XML_MAX_TEXT_LENGTH...
37 * XML_MAX_NAME_LENGTH:
39 * Maximum size allowed for a markup identitier
40 * This is not a limitation of the parser but a safety boundary feature,
41 * use XML_PARSE_HUGE option to override it.
42 * Note that with the use of parsing dictionaries overriding the limit
43 * may result in more runtime memory usage in face of "unfriendly' content
46 d XML_MAX_NAME_LENGTH...
49 * XML_MAX_DICTIONARY_LIMIT:
51 * Maximum size allowed by the parser for a dictionary by default
52 * This is not a limitation of the parser but a safety boundary feature,
53 * use XML_PARSE_HUGE option to override it.
56 d XML_MAX_DICTIONARY_LIMIT...
59 * XML_MAX_LOOKUP_LIMIT:
61 * Maximum size allowed by the parser for ahead lookup
62 * This is an upper boundary enforced by the parser to avoid bad
63 * behaviour on "unfriendly' content
66 d XML_MAX_LOOKUP_LIMIT...
71 * Identifiers can be longer, but this will be more costly
79 * The parser tries to always have that amount of input ready.
80 * One of the point is providing context when reporting errors.
84 * Global variables used for predefined strings.
86 d xmlStringText s 4 import('xmlStringText') \0 in 5th byte
88 d xmlStringTextNoenc...
89 d s 9 import('xmlStringTextNoenc') \0 in 10th byte
92 d s 7 import('xmlStringTextComment') \0 in 8th byte
94 * Function to finish the work of the macros where needed.
96 d xmlIsLetter pr 10i 0 extproc('xmlIsLetter')
101 d xmlCreateFileParserCtxt...
102 d pr extproc('xmlCreateFileParserCtxt')
103 d like(xmlParserCtxtPtr)
104 d filename * value options(*string) const char *
106 d xmlCreateURLParserCtxt...
107 d pr extproc('xmlCreateURLParserCtxt')
108 d like(xmlParserCtxtPtr)
109 d filename * value options(*string) const char *
110 d options 10i 0 value
112 d xmlCreateMemoryParserCtxt...
113 d pr extproc('xmlCreateMemoryParserCtxt')
114 d like(xmlParserCtxtPtr)
115 d buffer * value options(*string) const char *
118 d xmlCreateEntityParserCtxt...
119 d pr extproc('xmlCreateEntityParserCtxt')
120 d like(xmlParserCtxtPtr)
121 d URL * value options(*string) const xmlChar *
122 d ID * value options(*string) const xmlChar *
123 d base * value options(*string) const xmlChar *
125 d xmlSwitchEncoding...
126 d pr 10i 0 extproc('xmlSwitchEncoding')
127 d ctxt value like(xmlParserCtxtPtr)
128 d enc value like(xmlCharEncoding)
130 d xmlSwitchToEncoding...
131 d pr 10i 0 extproc('xmlSwitchToEncoding')
132 d ctxt value like(xmlParserCtxtPtr)
133 d handler value like(xmlCharEncodingHandlerPtr)
135 d xmlSwitchInputEncoding...
136 d pr 10i 0 extproc('xmlSwitchInputEncoding')
137 d ctxt value like(xmlParserCtxtPtr)
138 d input value like(xmlParserInputPtr)
139 d handler value like(xmlCharEncodingHandlerPtr)
143 d xmlNewStringInputStream...
144 d pr extproc('xmlNewStringInputStream')
145 d like(xmlParserInputPtr)
146 d ctxt value like(xmlParserCtxtPtr)
147 d buffer * value options(*string) const xmlChar *
149 d xmlNewEntityInputStream...
150 d pr extproc('xmlNewEntityInputStream')
151 d like(xmlParserInputPtr)
152 d ctxt value like(xmlParserCtxtPtr)
153 d entity value like(xmlEntityPtr)
155 d xmlPushInput pr 10i 0 extproc('xmlPushInput')
156 d ctxt value like(xmlParserCtxtPtr)
157 d input value like(xmlParserInputPtr)
159 d xmlPopInput pr extproc('xmlPopInput')
161 d ctxt value like(xmlParserCtxtPtr)
163 d xmlFreeInputStream...
164 d pr extproc('xmlFreeInputStream')
165 d input value like(xmlParserInputPtr)
167 d xmlNewInputFromFile...
168 d pr extproc('xmlNewInputFromFile')
169 d like(xmlParserInputPtr)
170 d ctxt value like(xmlParserCtxtPtr)
171 d filename * value options(*string) const char *
173 d xmlNewInputStream...
174 d pr extproc('xmlNewInputStream')
175 d like(xmlParserInputPtr)
176 d ctxt value like(xmlParserCtxtPtr)
180 d xmlSplitQName pr * extproc('xmlSplitQName') xmlChar *
181 d ctxt value like(xmlParserCtxtPtr)
182 d name * value options(*string) const xmlChar *
183 d prefix * xmlChar *(*)
185 * Generic production rules.
187 d xmlParseName pr * extproc('xmlParseName') const xmlChar *
188 d ctxt value like(xmlParserCtxtPtr)
191 d pr * extproc('xmlParseNmtoken') xmlChar *
192 d ctxt value like(xmlParserCtxtPtr)
194 d xmlParseEntityValue...
195 d pr * extproc('xmlParseEntityValue') xmlChar *
196 d ctxt value like(xmlParserCtxtPtr)
197 d orig * xmlChar *(*)
199 d xmlParseAttValue...
200 d pr * extproc('xmlParseAttValue') xmlChar *
201 d ctxt value like(xmlParserCtxtPtr)
203 d xmlParseSystemLiteral...
204 d pr * extproc('xmlParseSystemLiteral') xmlChar *
205 d ctxt value like(xmlParserCtxtPtr)
207 d xmlParsePubidLiteral...
208 d pr * extproc('xmlParsePubidLiteral') xmlChar *
209 d ctxt value like(xmlParserCtxtPtr)
211 d xmlParseCharData...
212 d pr extproc('xmlParseCharData')
213 d ctxt value like(xmlParserCtxtPtr)
216 d xmlParseExternalID...
217 d pr * extproc('xmlParseExternalID') xmlChar *
218 d ctxt value like(xmlParserCtxtPtr)
219 d publicID * xmlChar *(*)
223 d pr extproc('xmlParseComment')
224 d ctxt value like(xmlParserCtxtPtr)
226 d xmlParsePITarget...
227 d pr * extproc('xmlParsePITarget') const xmlChar *
228 d ctxt value like(xmlParserCtxtPtr)
230 d xmlParsePI pr extproc('xmlParsePI')
231 d ctxt value like(xmlParserCtxtPtr)
233 d xmlParseNotationDecl...
234 d pr extproc('xmlParseNotationDecl')
235 d ctxt value like(xmlParserCtxtPtr)
237 d xmlParseEntityDecl...
238 d pr extproc('xmlParseEntityDecl')
239 d ctxt value like(xmlParserCtxtPtr)
241 d xmlParseDefaultDecl...
242 d pr 10i 0 extproc('xmlParseDefaultDecl')
243 d ctxt value like(xmlParserCtxtPtr)
244 d value * xmlChar *(*)
246 d xmlParseNotationType...
247 d pr extproc('xmlParseNotationType')
248 d like(xmlEnumerationPtr)
249 d ctxt value like(xmlParserCtxtPtr)
251 d xmlParseEnumerationType...
252 d pr extproc('xmlParseEnumerationType')
253 d like(xmlEnumerationPtr)
254 d ctxt value like(xmlParserCtxtPtr)
256 d xmlParseEnumeratedType...
257 d pr 10i 0 extproc('xmlParseEnumeratedType')
258 d ctxt value like(xmlParserCtxtPtr)
259 d tree * value xmlEnumerationPtr *
261 d xmlParseAttributeType...
262 d pr 10i 0 extproc('xmlParseAttributeType')
263 d ctxt value like(xmlParserCtxtPtr)
264 d tree * value xmlEnumerationPtr *
266 d xmlParseAttributeListDecl...
267 d pr extproc('xmlParseAttributeListDecl')
268 d ctxt value like(xmlParserCtxtPtr)
270 d xmlParseElementMixedContentDecl...
272 d 'xmlParseElementMixedContentDecl')
273 d like(xmlElementContentPtr)
274 d ctxt value like(xmlParserCtxtPtr)
275 d inputchk 10i 0 value
277 d xmlParseElementChildrenContentDecl...
279 d 'xmlParseElementChildrenContentDecl')
280 d like(xmlElementContentPtr)
281 d ctxt value like(xmlParserCtxtPtr)
282 d inputchk 10i 0 value
284 d xmlParseElementContentDecl...
285 d pr 10i 0 extproc('xmlParseElementContentDecl')
286 d ctxt value like(xmlParserCtxtPtr)
287 d name * value options(*string) const xmlChar *
288 d result * value xmlElementContentPtr
291 d xmlParseElementDecl...
292 d pr 10i 0 extproc('xmlParseElementDecl')
293 d ctxt value like(xmlParserCtxtPtr)
295 d xmlParseMarkupDecl...
296 d pr extproc('xmlParseMarkupDecl')
297 d ctxt value like(xmlParserCtxtPtr)
300 d pr 10i 0 extproc('xmlParseCharRef')
301 d ctxt value like(xmlParserCtxtPtr)
303 d xmlParseEntityRef...
304 d pr extproc('xmlParseEntityRef')
306 d ctxt value like(xmlParserCtxtPtr)
308 d xmlParseReference...
309 d pr extproc('xmlParseReference')
310 d ctxt value like(xmlParserCtxtPtr)
312 d xmlParsePEReference...
313 d pr extproc('xmlParsePEReference')
314 d ctxt value like(xmlParserCtxtPtr)
316 d xmlParseDocTypeDecl...
317 d pr extproc('xmlParseDocTypeDecl')
318 d ctxt value like(xmlParserCtxtPtr)
320 /if defined(LIBXML_SAX1_ENABLED)
321 d xmlParseAttribute...
322 d pr * extproc('xmlParseAttribute') const xmlChar *
323 d ctxt value like(xmlParserCtxtPtr)
324 d value * xmlChar *(*)
326 d xmlParseStartTag...
327 d pr * extproc('xmlParseStartTag') const xmlChar *
328 d ctxt value like(xmlParserCtxtPtr)
330 d xmlParseEndTag pr extproc('xmlParseEndTag')
331 d ctxt value like(xmlParserCtxtPtr)
332 /endif LIBXML_SAX1_ENABLED
334 d xmlParseCDSect pr extproc('xmlParseCDSect')
335 d ctxt value like(xmlParserCtxtPtr)
338 d pr extproc('xmlParseContent')
339 d ctxt value like(xmlParserCtxtPtr)
342 d pr extproc('xmlParseElement')
343 d ctxt value like(xmlParserCtxtPtr)
345 d xmlParseVersionNum...
346 d pr * extproc('xmlParseVersionNum') xmlChar *
347 d ctxt value like(xmlParserCtxtPtr)
349 d xmlParseVersionInfo...
350 d pr * extproc('xmlParseVersionInfo') xmlChar *
351 d ctxt value like(xmlParserCtxtPtr)
354 d pr * extproc('xmlParseEncName') xmlChar *
355 d ctxt value like(xmlParserCtxtPtr)
357 d xmlParseEncodingDecl...
358 d pr * extproc('xmlParseEncodingDecl') const xmlChar *
359 d ctxt value like(xmlParserCtxtPtr)
361 d xmlParseSDDecl pr 10i 0 extproc('xmlParseSDDecl')
362 d ctxt value like(xmlParserCtxtPtr)
365 d pr extproc('xmlParseXMLDecl')
366 d ctxt value like(xmlParserCtxtPtr)
368 d xmlParseTextDecl...
369 d pr extproc('xmlParseTextDecl')
370 d ctxt value like(xmlParserCtxtPtr)
372 d xmlParseMisc pr extproc('xmlParseMisc')
373 d ctxt value like(xmlParserCtxtPtr)
375 d xmlParseExternalSubset...
376 d pr extproc('xmlParseExternalSubset')
377 d ctxt value like(xmlParserCtxtPtr)
378 d ExternalID * value options(*string) const xmlChar *
379 d SystemID * value options(*string) const xmlChar *
381 * XML_SUBSTITUTE_NONE:
383 * If no entities need to be substituted.
385 d XML_SUBSTITUTE_NONE...
388 * XML_SUBSTITUTE_REF:
390 * Whether general entities need to be substituted.
392 d XML_SUBSTITUTE_REF...
395 * XML_SUBSTITUTE_PEREF:
397 * Whether parameter entities need to be substituted.
399 d XML_SUBSTITUTE_PEREF...
402 * XML_SUBSTITUTE_BOTH:
404 * Both general and parameter entities need to be substituted.
406 d XML_SUBSTITUTE_BOTH...
409 d xmlStringDecodeEntities...
410 d pr * extproc('xmlStringDecodeEntities') xmlChar *
411 d ctxt value like(xmlParserCtxtPtr)
412 d str * value options(*string) const xmlChar *
414 d end value like(xmlChar)
415 d end2 value like(xmlChar)
416 d end3 value like(xmlChar)
418 d xmlStringLenDecodeEntities...
419 d pr * extproc('xmlStringLenDecodeEntities')xmlChar *
420 d ctxt value like(xmlParserCtxtPtr)
421 d str * value options(*string) const xmlChar *
424 d end value like(xmlChar)
425 d end2 value like(xmlChar)
426 d end3 value like(xmlChar)
428 * Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
430 d nodePush pr 10i 0 extproc('nodePush')
431 d ctxt value like(xmlParserCtxtPtr)
432 d value value like(xmlNodePtr)
434 d nodePop pr extproc('nodePop')
436 d ctxt value like(xmlParserCtxtPtr)
438 d inputPush pr 10i 0 extproc('inputPush')
439 d ctxt value like(xmlParserCtxtPtr)
440 d value value like(xmlParserInputPtr)
442 d inputPop pr extproc('inputPop')
443 d like(xmlParserInputPtr)
444 d ctxt value like(xmlParserCtxtPtr)
446 d namePop pr * extproc('namePop') const xmlChar *
447 d ctxt value like(xmlParserCtxtPtr)
449 d namePush pr 10i 0 extproc('namePush')
450 d ctxt value like(xmlParserCtxtPtr)
451 d value * value options(*string) const xmlChar *
453 * other commodities shared between parser.c and parserInternals.
455 d xmlSkipBlankChars...
456 d pr 10i 0 extproc('xmlSkipBlankChars')
457 d ctxt value like(xmlParserCtxtPtr)
459 d xmlStringCurrentChar...
460 d pr 10i 0 extproc('xmlStringCurrentChar')
461 d ctxt value like(xmlParserCtxtPtr)
462 d cur * value options(*string) const xmlChar *
465 d xmlParserHandlePEReference...
466 d pr extproc('xmlParserHandlePEReference')
467 d ctxt value like(xmlParserCtxtPtr)
469 d xmlCheckLanguageID...
470 d pr 10i 0 extproc('xmlCheckLanguageID')
471 d lang * value options(*string) const xmlChar *
473 * Really core function shared with HTML parser.
475 d xmlCurrentChar pr 10i 0 extproc('xmlCurrentChar')
476 d ctxt value like(xmlParserCtxtPtr)
479 d xmlCopyCharMultiByte...
480 d pr 10i 0 extproc('xmlCopyCharMultiByte')
481 d out * value options(*string) xmlChar *
484 d xmlCopyChar pr 10i 0 extproc('xmlCopyChar')
486 d out * value options(*string) xmlChar *
489 d xmlNextChar pr extproc('xmlNextChar')
490 d ctxt value like(xmlParserCtxtPtr)
492 d xmlParserInputShrink...
493 d pr extproc('xmlParserInputShrink')
494 d in value like(xmlParserInputPtr)
496 /if defined(LIBXML_HTML_ENABLED)
498 * Actually comes from the HTML parser but launched from the init stuff.
500 d htmlInitAutoClose...
501 d pr extproc('htmlInitAutoClose')
503 d htmlCreateFileParserCtxt...
504 d pr extproc('htmlCreateFileParserCtxt')
505 d like(htmlParserCtxtPtr)
506 d filename * value options(*string) const char *
507 d encoding * value options(*string) const char *
510 * Specific function to keep track of entities references
511 * and used by the XSLT debugger.
513 /if defined(LIBXML_LEGACY_ENABLED)
514 * xmlEntityReferenceFunc:
516 * @firstNode: the fist node in the chunk
517 * @lastNode: the last nod in the chunk
519 * Callback function used when one needs to be able to track back the
520 * provenance of a chunk of nodes inherited from an entity replacement.
522 d xmlEntityReferenceFunc...
523 d s * based(######typedef######)
526 d xmlSetEntityReferenceFunc...
527 d pr extproc('xmlSetEntityReferenceFunc')
528 d func value like(xmlEntityReferenceFunc)
530 d xmlParseQuotedString...
531 d pr * extproc('xmlParseQuotedString') xmlChar *
532 d ctxt value like(xmlParserCtxtPtr)
534 d xmlParseNamespace...
535 d pr extproc('xmlParseNamespace')
536 d ctxt value like(xmlParserCtxtPtr)
538 d xmlNamespaceParseNSDef...
539 d pr * extproc('xmlNamespaceParseNSDef') xmlChar *
540 d ctxt value like(xmlParserCtxtPtr)
542 d xmlScanName pr * extproc('xmlScanName') xmlChar *
543 d ctxt value like(xmlParserCtxtPtr)
545 d xmlNamespaceParseNCName...
546 d pr * extproc('xmlNamespaceParseNCName') xmlChar *
547 d ctxt value like(xmlParserCtxtPtr)
549 d xmlParserHandleReference...
550 d pr extproc('xmlParserHandleReference')
551 d ctxt value like(xmlParserCtxtPtr)
553 d xmlNamespaceParseQName...
554 d pr * extproc('xmlNamespaceParseQName') xmlChar *
555 d ctxt value like(xmlParserCtxtPtr)
556 d prefix * xmlChar *(*)
560 d xmlDecodeEntities...
561 d pr * extproc('xmlDecodeEntities') xmlChar *
562 d ctxt value like(xmlParserCtxtPtr)
565 d end value like(xmlChar)
566 d end2 value like(xmlChar)
567 d end3 value like(xmlChar)
570 d pr extproc('xmlHandleEntity')
571 d ctxt value like(xmlParserCtxtPtr)
572 d entity value like(xmlEntityPtr)
573 /endif LIBXML_LEGACY_ENABLD