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.
6 * Copy: See Copyright for the status of this software.
8 * Author: Daniel Veillard
11 #ifndef __XML_ENTITIES_H__
12 #define __XML_ENTITIES_H__
14 #include <libxml/xmlversion.h>
15 #include <libxml/tree.h>
22 * The different valid entity types.
25 XML_INTERNAL_GENERAL_ENTITY = 1,
26 XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
27 XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
28 XML_INTERNAL_PARAMETER_ENTITY = 4,
29 XML_EXTERNAL_PARAMETER_ENTITY = 5,
30 XML_INTERNAL_PREDEFINED_ENTITY = 6
34 * An unit of storage for an entity, contains the string, the value
35 * and the linkind data needed for the linking in the hash table.
39 void *_private; /* application data */
40 xmlElementType type; /* XML_ENTITY_DECL, must be second ! */
41 const xmlChar *name; /* Entity name */
42 struct _xmlNode *children; /* First child link */
43 struct _xmlNode *last; /* Last child link */
44 struct _xmlDtd *parent; /* -> DTD */
45 struct _xmlNode *next; /* next sibling link */
46 struct _xmlNode *prev; /* previous sibling link */
47 struct _xmlDoc *doc; /* the containing document */
49 xmlChar *orig; /* content without ref substitution */
50 xmlChar *content; /* content or ndata if unparsed */
51 int length; /* the content length */
52 xmlEntityType etype; /* The entity type */
53 const xmlChar *ExternalID; /* External identifier for PUBLIC */
54 const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
56 struct _xmlEntity *nexte; /* unused */
57 const xmlChar *URI; /* the full URI as computed */
58 int owner; /* does the entity own the childrens */
59 int checked; /* was the entity content checked */
60 /* this is also used to count entities
61 * references done from that entity
62 * and if it contains '<' */
66 * All entities are stored in an hash table.
67 * There is 2 separate hash tables for global and parameter entities.
70 typedef struct _xmlHashTable xmlEntitiesTable;
71 typedef xmlEntitiesTable *xmlEntitiesTablePtr;
77 #ifdef LIBXML_LEGACY_ENABLED
78 XMLPUBFUN void XMLCALL
79 xmlInitializePredefinedEntities (void);
80 #endif /* LIBXML_LEGACY_ENABLED */
82 XMLPUBFUN xmlEntityPtr XMLCALL
83 xmlNewEntity (xmlDocPtr doc,
86 const xmlChar *ExternalID,
87 const xmlChar *SystemID,
88 const xmlChar *content);
89 XMLPUBFUN xmlEntityPtr XMLCALL
90 xmlAddDocEntity (xmlDocPtr doc,
93 const xmlChar *ExternalID,
94 const xmlChar *SystemID,
95 const xmlChar *content);
96 XMLPUBFUN xmlEntityPtr XMLCALL
97 xmlAddDtdEntity (xmlDocPtr doc,
100 const xmlChar *ExternalID,
101 const xmlChar *SystemID,
102 const xmlChar *content);
103 XMLPUBFUN xmlEntityPtr XMLCALL
104 xmlGetPredefinedEntity (const xmlChar *name);
105 XMLPUBFUN xmlEntityPtr XMLCALL
106 xmlGetDocEntity (const xmlDoc *doc,
107 const xmlChar *name);
108 XMLPUBFUN xmlEntityPtr XMLCALL
109 xmlGetDtdEntity (xmlDocPtr doc,
110 const xmlChar *name);
111 XMLPUBFUN xmlEntityPtr XMLCALL
112 xmlGetParameterEntity (xmlDocPtr doc,
113 const xmlChar *name);
114 #ifdef LIBXML_LEGACY_ENABLED
115 XMLPUBFUN const xmlChar * XMLCALL
116 xmlEncodeEntities (xmlDocPtr doc,
117 const xmlChar *input);
118 #endif /* LIBXML_LEGACY_ENABLED */
119 XMLPUBFUN xmlChar * XMLCALL
120 xmlEncodeEntitiesReentrant(xmlDocPtr doc,
121 const xmlChar *input);
122 XMLPUBFUN xmlChar * XMLCALL
123 xmlEncodeSpecialChars (const xmlDoc *doc,
124 const xmlChar *input);
125 XMLPUBFUN xmlEntitiesTablePtr XMLCALL
126 xmlCreateEntitiesTable (void);
127 #ifdef LIBXML_TREE_ENABLED
128 XMLPUBFUN xmlEntitiesTablePtr XMLCALL
129 xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
130 #endif /* LIBXML_TREE_ENABLED */
131 XMLPUBFUN void XMLCALL
132 xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
133 #ifdef LIBXML_OUTPUT_ENABLED
134 XMLPUBFUN void XMLCALL
135 xmlDumpEntitiesTable (xmlBufferPtr buf,
136 xmlEntitiesTablePtr table);
137 XMLPUBFUN void XMLCALL
138 xmlDumpEntityDecl (xmlBufferPtr buf,
140 #endif /* LIBXML_OUTPUT_ENABLED */
141 #ifdef LIBXML_LEGACY_ENABLED
142 XMLPUBFUN void XMLCALL
143 xmlCleanupPredefinedEntities(void);
144 #endif /* LIBXML_LEGACY_ENABLED */
151 # endif /* __XML_ENTITIES_H__ */