Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:41:48

0001 /*
0002  * Summary: interface for the XML entities handling
0003  * Description: this module provides some of the entity API needed
0004  *              for the parser and applications.
0005  *
0006  * Copy: See Copyright for the status of this software.
0007  *
0008  * Author: Daniel Veillard
0009  */
0010 
0011 #ifndef __XML_ENTITIES_H__
0012 #define __XML_ENTITIES_H__
0013 
0014 /** DOC_DISABLE */
0015 #include <libxml/xmlversion.h>
0016 #define XML_TREE_INTERNALS
0017 #include <libxml/tree.h>
0018 #undef XML_TREE_INTERNALS
0019 /** DOC_ENABLE */
0020 
0021 #ifdef __cplusplus
0022 extern "C" {
0023 #endif
0024 
0025 /*
0026  * The different valid entity types.
0027  */
0028 typedef enum {
0029     XML_INTERNAL_GENERAL_ENTITY = 1,
0030     XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
0031     XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
0032     XML_INTERNAL_PARAMETER_ENTITY = 4,
0033     XML_EXTERNAL_PARAMETER_ENTITY = 5,
0034     XML_INTERNAL_PREDEFINED_ENTITY = 6
0035 } xmlEntityType;
0036 
0037 /*
0038  * An unit of storage for an entity, contains the string, the value
0039  * and the linkind data needed for the linking in the hash table.
0040  */
0041 
0042 struct _xmlEntity {
0043     void           *_private;           /* application data */
0044     xmlElementType          type;       /* XML_ENTITY_DECL, must be second ! */
0045     const xmlChar          *name;   /* Entity name */
0046     struct _xmlNode    *children;   /* First child link */
0047     struct _xmlNode        *last;   /* Last child link */
0048     struct _xmlDtd       *parent;   /* -> DTD */
0049     struct _xmlNode        *next;   /* next sibling link  */
0050     struct _xmlNode        *prev;   /* previous sibling link  */
0051     struct _xmlDoc          *doc;       /* the containing document */
0052 
0053     xmlChar                *orig;   /* content without ref substitution */
0054     xmlChar             *content;   /* content or ndata if unparsed */
0055     int                   length;   /* the content length */
0056     xmlEntityType          etype;   /* The entity type */
0057     const xmlChar    *ExternalID;   /* External identifier for PUBLIC */
0058     const xmlChar      *SystemID;   /* URI for a SYSTEM or PUBLIC Entity */
0059 
0060     struct _xmlEntity     *nexte;   /* unused */
0061     const xmlChar           *URI;   /* the full URI as computed */
0062     int                    owner;   /* unused */
0063     int                    flags;       /* various flags */
0064     unsigned long   expandedSize;       /* expanded size */
0065 };
0066 
0067 /*
0068  * All entities are stored in an hash table.
0069  * There is 2 separate hash tables for global and parameter entities.
0070  */
0071 
0072 typedef struct _xmlHashTable xmlEntitiesTable;
0073 typedef xmlEntitiesTable *xmlEntitiesTablePtr;
0074 
0075 /*
0076  * External functions:
0077  */
0078 
0079 #ifdef LIBXML_LEGACY_ENABLED
0080 XML_DEPRECATED
0081 XMLPUBFUN void
0082         xmlInitializePredefinedEntities (void);
0083 #endif /* LIBXML_LEGACY_ENABLED */
0084 
0085 XMLPUBFUN xmlEntityPtr
0086             xmlNewEntity        (xmlDocPtr doc,
0087                          const xmlChar *name,
0088                          int type,
0089                          const xmlChar *ExternalID,
0090                          const xmlChar *SystemID,
0091                          const xmlChar *content);
0092 XMLPUBFUN void
0093             xmlFreeEntity       (xmlEntityPtr entity);
0094 XMLPUBFUN int
0095             xmlAddEntity        (xmlDocPtr doc,
0096                          int extSubset,
0097                          const xmlChar *name,
0098                          int type,
0099                          const xmlChar *ExternalID,
0100                          const xmlChar *SystemID,
0101                          const xmlChar *content,
0102                          xmlEntityPtr *out);
0103 XMLPUBFUN xmlEntityPtr
0104             xmlAddDocEntity     (xmlDocPtr doc,
0105                          const xmlChar *name,
0106                          int type,
0107                          const xmlChar *ExternalID,
0108                          const xmlChar *SystemID,
0109                          const xmlChar *content);
0110 XMLPUBFUN xmlEntityPtr
0111             xmlAddDtdEntity     (xmlDocPtr doc,
0112                          const xmlChar *name,
0113                          int type,
0114                          const xmlChar *ExternalID,
0115                          const xmlChar *SystemID,
0116                          const xmlChar *content);
0117 XMLPUBFUN xmlEntityPtr
0118             xmlGetPredefinedEntity  (const xmlChar *name);
0119 XMLPUBFUN xmlEntityPtr
0120             xmlGetDocEntity     (const xmlDoc *doc,
0121                          const xmlChar *name);
0122 XMLPUBFUN xmlEntityPtr
0123             xmlGetDtdEntity     (xmlDocPtr doc,
0124                          const xmlChar *name);
0125 XMLPUBFUN xmlEntityPtr
0126             xmlGetParameterEntity   (xmlDocPtr doc,
0127                          const xmlChar *name);
0128 #ifdef LIBXML_LEGACY_ENABLED
0129 XML_DEPRECATED
0130 XMLPUBFUN const xmlChar *
0131             xmlEncodeEntities   (xmlDocPtr doc,
0132                          const xmlChar *input);
0133 #endif /* LIBXML_LEGACY_ENABLED */
0134 XMLPUBFUN xmlChar *
0135             xmlEncodeEntitiesReentrant(xmlDocPtr doc,
0136                          const xmlChar *input);
0137 XMLPUBFUN xmlChar *
0138             xmlEncodeSpecialChars   (const xmlDoc *doc,
0139                          const xmlChar *input);
0140 XMLPUBFUN xmlEntitiesTablePtr
0141             xmlCreateEntitiesTable  (void);
0142 #ifdef LIBXML_TREE_ENABLED
0143 XMLPUBFUN xmlEntitiesTablePtr
0144             xmlCopyEntitiesTable    (xmlEntitiesTablePtr table);
0145 #endif /* LIBXML_TREE_ENABLED */
0146 XMLPUBFUN void
0147             xmlFreeEntitiesTable    (xmlEntitiesTablePtr table);
0148 #ifdef LIBXML_OUTPUT_ENABLED
0149 XMLPUBFUN void
0150             xmlDumpEntitiesTable    (xmlBufferPtr buf,
0151                          xmlEntitiesTablePtr table);
0152 XMLPUBFUN void
0153             xmlDumpEntityDecl   (xmlBufferPtr buf,
0154                          xmlEntityPtr ent);
0155 #endif /* LIBXML_OUTPUT_ENABLED */
0156 #ifdef LIBXML_LEGACY_ENABLED
0157 XMLPUBFUN void
0158             xmlCleanupPredefinedEntities(void);
0159 #endif /* LIBXML_LEGACY_ENABLED */
0160 
0161 
0162 #ifdef __cplusplus
0163 }
0164 #endif
0165 
0166 # endif /* __XML_ENTITIES_H__ */