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
9 * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
17 #ifndef XML_ENTITIES_H
18 #define XML_ENTITIES_H
20 #include <stdapis/libxml2/libxml2_tree.h>
27 * The different valid entity types.
30 XML_INTERNAL_GENERAL_ENTITY = 1,
31 XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
32 XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
33 XML_INTERNAL_PARAMETER_ENTITY = 4,
34 XML_EXTERNAL_PARAMETER_ENTITY = 5,
35 XML_INTERNAL_PREDEFINED_ENTITY = 6
39 * An unit of storage for an entity, contains the string, the value
40 * and the linkind data needed for the linking in the hash table.
44 void *_private; /* application data */
45 xmlElementType type; /* XML_ENTITY_DECL, must be second ! */
46 const xmlChar *name; /* Entity name */
47 struct _xmlNode *children; /* First child link */
48 struct _xmlNode *last; /* Last child link */
49 struct _xmlDtd *parent; /* -> DTD */
50 struct _xmlNode *next; /* next sibling link */
51 struct _xmlNode *prev; /* previous sibling link */
52 struct _xmlDoc *doc; /* the containing document */
53 /* end of common part */
54 xmlChar *orig; /* content without ref substitution */
55 xmlChar *content; /* content or ndata if unparsed */
56 int length; /* the content length */
57 xmlEntityType etype; /* The entity type */
58 const xmlChar *ExternalID; /* External identifier for PUBLIC */
59 const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
61 struct _xmlEntity *nexte; /* unused */
62 const xmlChar *URI; /* the full URI as computed */
63 int owner; /* does the entity own the childrens */
67 * All entities are stored in an hash table.
68 * There is 2 separate hash tables for global and parameter entities.
71 typedef struct _xmlHashTable xmlEntitiesTable;
72 typedef xmlEntitiesTable *xmlEntitiesTablePtr;
78 XMLPUBFUN void XMLCALL
79 xmlInitializePredefinedEntities (void);
80 XMLPUBFUN xmlEntityPtr XMLCALL
81 xmlAddDocEntity (xmlDocPtr doc,
84 const xmlChar *ExternalID,
85 const xmlChar *SystemID,
86 const xmlChar *content);
87 XMLPUBFUN xmlEntityPtr XMLCALL
88 xmlAddDtdEntity (xmlDocPtr doc,
91 const xmlChar *ExternalID,
92 const xmlChar *SystemID,
93 const xmlChar *content);
94 XMLPUBFUN xmlEntityPtr XMLCALL
95 xmlGetPredefinedEntity (const xmlChar *name);
96 XMLPUBFUN xmlEntityPtr XMLCALL
97 xmlGetDocEntity (xmlDocPtr doc, const xmlChar *name);
99 #ifndef XMLENGINE_EXCLUDE_UNUSED
100 XMLPUBFUN xmlEntityPtr XMLCALL
101 xmlGetDtdEntity (xmlDocPtr doc, const xmlChar *name);
102 #endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
104 XMLPUBFUN xmlEntityPtr XMLCALL
105 xmlGetParameterEntity (xmlDocPtr doc, const xmlChar *name);
108 // (it is in _excluded-forever code group)
109 #ifdef LIBXML_LEGACY_ENABLED
110 XMLPUBFUN const xmlChar * XMLCALL
111 xmlEncodeEntities (xmlDocPtr doc,
112 const xmlChar *input);
113 #endif /* LIBXML_LEGACY_ENABLED */
115 XMLPUBFUN xmlChar * XMLCALL
116 xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input);
117 XMLPUBFUN xmlChar * XMLCALL
118 xmlEncodeSpecialChars (xmlDocPtr doc, const xmlChar *input);
120 #ifndef XMLENGINE_EXCLUDE_UNUSED
121 XMLPUBFUN xmlEntitiesTablePtr XMLCALL xmlCreateEntitiesTable (void);
122 #endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
124 XMLPUBFUN xmlEntitiesTablePtr XMLCALL
125 xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
126 XMLPUBFUN void XMLCALL
127 xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
128 XMLPUBFUN void XMLCALL
129 xmlCleanupPredefinedEntities(void);
131 #ifdef LIBXML_OUTPUT_ENABLED
132 XMLPUBFUN void XMLCALL
133 xmlDumpEntitiesTable (xmlBufferPtr buf, xmlEntitiesTablePtr table);
134 XMLPUBFUN void XMLCALL
135 xmlDumpEntityDecl (xmlBufferPtr buf, xmlEntityPtr ent);
136 #endif /* LIBXML_OUTPUT_ENABLED */
142 # endif /* XML_ENTITIES_H */