entities.inc 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. (*
  2. * Summary: interface for the XML entities handling
  3. * Description: this module provides some of the entity API needed
  4. * for the parser and applications.
  5. *
  6. * Copy: See Copyright for the status of this software.
  7. *
  8. * Author: Daniel Veillard
  9. *)
  10. {$IFDEF POINTER}
  11. xmlEntityPtr = ^xmlEntity;
  12. xmlEntitiesTablePtr = ^xmlEntitiesTable;
  13. {$ENDIF}
  14. {$IFDEF TYPE}
  15. (*
  16. * The different valid entity types.
  17. *)
  18. xmlEntityType = (
  19. XML_INTERNAL_GENERAL_ENTITY = 1,
  20. XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
  21. XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
  22. XML_INTERNAL_PARAMETER_ENTITY = 4,
  23. XML_EXTERNAL_PARAMETER_ENTITY = 5,
  24. XML_INTERNAL_PREDEFINED_ENTITY = 6
  25. );
  26. (*
  27. * An unit of storage for an entity, contains the string, the value
  28. * and the linkind data needed for the linking in the hash table.
  29. *)
  30. xmlEntity = record
  31. _private : pointer; (* application data *)
  32. _type : xmlElementType; (* XML_ENTITY_DECL, must be second ! *)
  33. name : xmlCharPtr; (* Entity name *)
  34. children : xmlNodePtr; (* First child link *)
  35. last : xmlNodePtr; (* Last child link *)
  36. parent : xmlDtdPtr; (* -> DTD *)
  37. next : xmlNodePtr; (* next sibling link *)
  38. prev : xmlNodePtr; (* previous sibling link *)
  39. doc : xmlDocPtr; (* the containing document *)
  40. orig : xmlCharPtr; (* content without ref substitution *)
  41. content : xmlCharPtr; (* content or ndata if unparsed *)
  42. length : cint; (* the content length *)
  43. etype : xmlEntityType; (* The entity type *)
  44. ExternalID : xmlCharPtr; (* External identifier for PUBLIC *)
  45. SystemID : xmlCharPtr; (* URI for a SYSTEM or PUBLIC Entity *)
  46. nexte : xmlEntityPtr; (* unused *)
  47. URI : xmlCharPtr; (* the full URI as computed *)
  48. owner : cint; (* does the entity own the childrens *)
  49. checked : cint; (* was the entity content checked *)
  50. end;
  51. (*
  52. * All entities are stored in an hash table.
  53. * There is 2 separate hash tables for global and parameter entities.
  54. *)
  55. xmlEntitiesTable = record end;
  56. {$ENDIF}
  57. {$IFDEF FUNCTION}
  58. (*
  59. * External functions:
  60. *)
  61. {$IFDEF LIBXML_LEGACY_ENABLED}
  62. procedure xmlInitializePredefinedEntities; EXTDECL; external xml2lib;
  63. {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
  64. function xmlAddDocEntity(doc: xmlDocPtr; name: xmlCharPtr; _type: cint; ExternalID, SystemID, content: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
  65. function xmlAddDtdEntity(doc: xmlDocPtr; name: xmlCharPtr; _type: cint; ExternalID, SystemID, content: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
  66. function xmlGetPredefinedEntity(name: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
  67. function xmlGetDocEntity(doc: xmlDocPtr; name: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
  68. function xmlGetDtdEntity(doc: xmlDocPtr; name: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
  69. function xmlGetParameterEntity(doc: xmlDocPtr; name: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
  70. {$IFDEF LIBXML_LEGACY_ENABLED}
  71. function xmlEncodeEntities(doc: xmlDocPtr; input: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
  72. {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
  73. function xmlEncodeEntitiesReentrant(doc: xmlDocPtr; input: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
  74. function xmlEncodeSpecialChars(doc: xmlDocPtr; input: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
  75. function xmlCreateEntitiesTable: xmlEntitiesTablePtr; EXTDECL; external xml2lib;
  76. {$IFDEF LIBXML_TREE_ENABLED}
  77. function xmlCopyEntitiesTable(table: xmlEntitiesTablePtr): xmlEntitiesTablePtr; EXTDECL; external xml2lib;
  78. {$ENDIF} (* LIBXML_TREE_ENABLED *)
  79. procedure xmlFreeEntitiesTable(table: xmlEntitiesTablePtr); EXTDECL; external xml2lib;
  80. {$IFDEF LIBXML_OUTPUT_ENABLED}
  81. procedure xmlDumpEntitiesTable(buf: xmlBufferPtr; table: xmlEntitiesTablePtr); EXTDECL; external xml2lib;
  82. procedure xmlDumpEntityDecl(buf: xmlBufferPtr; ent: xmlEntityPtr); EXTDECL; external xml2lib;
  83. {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
  84. {$IFDEF LIBXML_LEGACY_ENABLED}
  85. procedure xmlCleanupPredefinedEntities; EXTDECL; external xml2lib;
  86. {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
  87. {$ENDIF}