entities.h

00001 /*
00002 
00003  * Summary: interface for the XML entities handling
00004 
00005  * Description: this module provides some of the entity API needed
00006 
00007  *              for the parser and applications.
00008 
00009  *
00010 
00011  * Copy: See Copyright for the status of this software.
00012 
00013  *
00014 
00015  * Author: Daniel Veillard
00016 
00017  */
00018 
00019 
00020 
00021 #ifndef __XML_ENTITIES_H__
00022 
00023 #define __XML_ENTITIES_H__
00024 
00025 
00026 
00027 #include <libxml/xmlversion.h>
00028 
00029 #include <libxml/tree.h>
00030 
00031 
00032 
00033 #ifdef __cplusplus
00034 
00035 extern "C" {
00036 
00037 #endif
00038 
00039 
00040 
00041 /*
00042 
00043  * The different valid entity types.
00044 
00045  */
00046 
00047 typedef enum {
00048 
00049     XML_INTERNAL_GENERAL_ENTITY = 1,
00050 
00051     XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
00052 
00053     XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
00054 
00055     XML_INTERNAL_PARAMETER_ENTITY = 4,
00056 
00057     XML_EXTERNAL_PARAMETER_ENTITY = 5,
00058 
00059     XML_INTERNAL_PREDEFINED_ENTITY = 6
00060 
00061 } xmlEntityType;
00062 
00063 
00064 
00065 /*
00066 
00067  * An unit of storage for an entity, contains the string, the value
00068 
00069  * and the linkind data needed for the linking in the hash table.
00070 
00071  */
00072 
00073 
00074 
00075 struct _xmlEntity {
00076 
00077     void           *_private;           /* application data */
00078 
00079     xmlElementType          type;       /* XML_ENTITY_DECL, must be second ! */
00080 
00081     const xmlChar          *name;       /* Entity name */
00082 
00083     struct _xmlNode    *children;       /* First child link */
00084 
00085     struct _xmlNode        *last;       /* Last child link */
00086 
00087     struct _xmlDtd       *parent;       /* -> DTD */
00088 
00089     struct _xmlNode        *next;       /* next sibling link  */
00090 
00091     struct _xmlNode        *prev;       /* previous sibling link  */
00092 
00093     struct _xmlDoc          *doc;       /* the containing document */
00094 
00095 
00096 
00097     xmlChar                *orig;       /* content without ref substitution */
00098 
00099     xmlChar             *content;       /* content or ndata if unparsed */
00100 
00101     int                   length;       /* the content length */
00102 
00103     xmlEntityType          etype;       /* The entity type */
00104 
00105     const xmlChar    *ExternalID;       /* External identifier for PUBLIC */
00106 
00107     const xmlChar      *SystemID;       /* URI for a SYSTEM or PUBLIC Entity */
00108 
00109 
00110 
00111     struct _xmlEntity     *nexte;       /* unused */
00112 
00113     const xmlChar           *URI;       /* the full URI as computed */
00114 
00115     int                    owner;       /* does the entity own the childrens */
00116 
00117 };
00118 
00119 
00120 
00121 /*
00122 
00123  * All entities are stored in an hash table.
00124 
00125  * There is 2 separate hash tables for global and parameter entities.
00126 
00127  */
00128 
00129 
00130 
00131 typedef struct _xmlHashTable xmlEntitiesTable;
00132 
00133 typedef xmlEntitiesTable *xmlEntitiesTablePtr;
00134 
00135 
00136 
00137 /*
00138 
00139  * External functions:
00140 
00141  */
00142 
00143 
00144 
00145 #ifdef LIBXML_LEGACY_ENABLED
00146 
00147 XMLPUBFUN void XMLCALL          
00148 
00149                 xmlInitializePredefinedEntities (void);
00150 
00151 #endif /* LIBXML_LEGACY_ENABLED */
00152 
00153 XMLPUBFUN xmlEntityPtr XMLCALL
00154 
00155                         xmlAddDocEntity         (xmlDocPtr doc,
00156 
00157                                                  const xmlChar *name,
00158 
00159                                                  int type,
00160 
00161                                                  const xmlChar *ExternalID,
00162 
00163                                                  const xmlChar *SystemID,
00164 
00165                                                  const xmlChar *content);
00166 
00167 XMLPUBFUN xmlEntityPtr XMLCALL          
00168 
00169                         xmlAddDtdEntity         (xmlDocPtr doc,
00170 
00171                                                  const xmlChar *name,
00172 
00173                                                  int type,
00174 
00175                                                  const xmlChar *ExternalID,
00176 
00177                                                  const xmlChar *SystemID,
00178 
00179                                                  const xmlChar *content);
00180 
00181 XMLPUBFUN xmlEntityPtr XMLCALL          
00182 
00183                         xmlGetPredefinedEntity  (const xmlChar *name);
00184 
00185 XMLPUBFUN xmlEntityPtr XMLCALL          
00186 
00187                         xmlGetDocEntity         (xmlDocPtr doc,
00188 
00189                                                  const xmlChar *name);
00190 
00191 XMLPUBFUN xmlEntityPtr XMLCALL          
00192 
00193                         xmlGetDtdEntity         (xmlDocPtr doc,
00194 
00195                                                  const xmlChar *name);
00196 
00197 XMLPUBFUN xmlEntityPtr XMLCALL          
00198 
00199                         xmlGetParameterEntity   (xmlDocPtr doc,
00200 
00201                                                  const xmlChar *name);
00202 
00203 #ifdef LIBXML_LEGACY_ENABLED
00204 
00205 XMLPUBFUN const xmlChar * XMLCALL               
00206 
00207                         xmlEncodeEntities       (xmlDocPtr doc,
00208 
00209                                                  const xmlChar *input);
00210 
00211 #endif /* LIBXML_LEGACY_ENABLED */
00212 
00213 XMLPUBFUN xmlChar * XMLCALL             
00214 
00215                         xmlEncodeEntitiesReentrant(xmlDocPtr doc,
00216 
00217                                                  const xmlChar *input);
00218 
00219 XMLPUBFUN xmlChar * XMLCALL             
00220 
00221                         xmlEncodeSpecialChars   (xmlDocPtr doc,
00222 
00223                                                  const xmlChar *input);
00224 
00225 XMLPUBFUN xmlEntitiesTablePtr XMLCALL   
00226 
00227                         xmlCreateEntitiesTable  (void);
00228 
00229 #ifdef LIBXML_TREE_ENABLED
00230 
00231 XMLPUBFUN xmlEntitiesTablePtr XMLCALL   
00232 
00233                         xmlCopyEntitiesTable    (xmlEntitiesTablePtr table);
00234 
00235 #endif /* LIBXML_TREE_ENABLED */
00236 
00237 XMLPUBFUN void XMLCALL                  
00238 
00239                         xmlFreeEntitiesTable    (xmlEntitiesTablePtr table);
00240 
00241 #ifdef LIBXML_OUTPUT_ENABLED
00242 
00243 XMLPUBFUN void XMLCALL                  
00244 
00245                         xmlDumpEntitiesTable    (xmlBufferPtr buf,
00246 
00247                                                  xmlEntitiesTablePtr table);
00248 
00249 XMLPUBFUN void XMLCALL                  
00250 
00251                         xmlDumpEntityDecl       (xmlBufferPtr buf,
00252 
00253                                                  xmlEntityPtr ent);
00254 
00255 #endif /* LIBXML_OUTPUT_ENABLED */
00256 
00257 #ifdef LIBXML_LEGACY_ENABLED
00258 
00259 XMLPUBFUN void XMLCALL                  
00260 
00261                         xmlCleanupPredefinedEntities(void);
00262 
00263 #endif /* LIBXML_LEGACY_ENABLED */
00264 
00265 
00266 
00267 
00268 
00269 #ifdef __cplusplus
00270 
00271 }
00272 
00273 #endif
00274 
00275 
00276 
00277 # endif /* __XML_ENTITIES_H__ */
00278 

Generated on Wed Jul 26 13:30:46 2006 for XSB by  doxygen 1.4.5