Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-25 09:20:36

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