Annotation of XML/entities.h, revision 1.32

1.1       httpng      1: /*
                      2:  * entities.h : interface for the XML entities handking
1.4       veillard    3:  *
                      4:  * See Copyright for the status of this software.
                      5:  *
1.16      daniel      6:  * Daniel.Veillard@w3.org
1.1       httpng      7:  */
                      8: 
                      9: #ifndef __XML_ENTITIES_H__
                     10: #define __XML_ENTITIES_H__
1.12      daniel     11: 
1.18      daniel     12: #include "tree.h"
1.1       httpng     13: 
1.5       daniel     14: #ifdef __cplusplus
                     15: extern "C" {
                     16: #endif
                     17: 
1.6       daniel     18: #define XML_INTERNAL_GENERAL_ENTITY            1
                     19: #define XML_EXTERNAL_GENERAL_PARSED_ENTITY     2
                     20: #define XML_EXTERNAL_GENERAL_UNPARSED_ENTITY   3
                     21: #define XML_INTERNAL_PARAMETER_ENTITY          4
                     22: #define XML_EXTERNAL_PARAMETER_ENTITY          5
1.13      daniel     23: #define XML_INTERNAL_PREDEFINED_ENTITY         6
1.6       daniel     24: 
1.1       httpng     25: /*
1.2       httpng     26:  * An unit of storage for an entity, contains the string, the value
                     27:  * and the linkind data needed for the linking in the hash table.
                     28:  */
                     29: 
1.30      daniel     30: typedef struct _xmlEntity xmlEntity;
                     31: typedef xmlEntity *xmlEntityPtr;
                     32: struct _xmlEntity {
1.31      daniel     33: #ifndef XML_WITHOUT_CORBA
                     34:     void           *_private;          /* for Corba, must be first ! */
                     35: #endif
                     36:     xmlElementType          type;       /* XML_ENTITY_DECL, must be second ! */
                     37:     const xmlChar          *name;      /* Attribute name */
                     38:     struct _xmlNode    *children;      /* NULL */
                     39:     struct _xmlNode        *last;      /* NULL */
                     40:     struct _xmlDtd       *parent;      /* -> DTD */
                     41:     struct _xmlNode        *next;      /* next sibling link  */
                     42:     struct _xmlNode        *prev;      /* previous sibling link  */
                     43:     struct _xmlDoc          *doc;       /* the containing document */
                     44: 
                     45:     xmlChar                *orig;      /* content without ref substitution */
                     46:     xmlChar             *content;      /* content or ndata if unparsed */
                     47:     int                   length;      /* the content length */
                     48:     int                    etype;      /* The entity type */
                     49:     const xmlChar    *ExternalID;      /* External identifier for PUBLIC */
                     50:     const xmlChar      *SystemID;      /* URI for a SYSTEM or PUBLIC Entity */
1.30      daniel     51: };
1.2       httpng     52: 
                     53: /*
                     54:  * ALl entities are stored in a table there is one table per DTD
                     55:  * and one extra per document.
                     56:  */
                     57: 
                     58: #define XML_MIN_ENTITIES_TABLE 32
                     59: 
1.30      daniel     60: typedef struct _xmlEntitiesTable xmlEntitiesTable;
                     61: typedef xmlEntitiesTable *xmlEntitiesTablePtr;
                     62: struct _xmlEntitiesTable {
1.2       httpng     63:     int nb_entities;           /* number of elements stored */
                     64:     int max_entities;          /* maximum number of elements */
1.32    ! daniel     65:     xmlEntityPtr *table;       /* the table of entities */
1.30      daniel     66: };
1.2       httpng     67: 
1.12      daniel     68: 
1.2       httpng     69: /*
1.1       httpng     70:  * External functions :
                     71:  */
1.18      daniel     72: 
1.32    ! daniel     73: xmlEntityPtr           xmlAddDocEntity         (xmlDocPtr doc,
1.25      daniel     74:                                                 const xmlChar *name,
1.24      daniel     75:                                                 int type,
1.25      daniel     76:                                                 const xmlChar *ExternalID,
                     77:                                                 const xmlChar *SystemID,
                     78:                                                 const xmlChar *content);
1.32    ! daniel     79: xmlEntityPtr           xmlAddDtdEntity         (xmlDocPtr doc,
1.25      daniel     80:                                                 const xmlChar *name,
1.24      daniel     81:                                                 int type,
1.25      daniel     82:                                                 const xmlChar *ExternalID,
                     83:                                                 const xmlChar *SystemID,
                     84:                                                 const xmlChar *content);
                     85: xmlEntityPtr           xmlGetPredefinedEntity  (const xmlChar *name);
1.24      daniel     86: xmlEntityPtr           xmlGetDocEntity         (xmlDocPtr doc,
1.25      daniel     87:                                                 const xmlChar *name);
1.24      daniel     88: xmlEntityPtr           xmlGetDtdEntity         (xmlDocPtr doc,
1.25      daniel     89:                                                 const xmlChar *name);
1.24      daniel     90: xmlEntityPtr           xmlGetParameterEntity   (xmlDocPtr doc,
1.25      daniel     91:                                                 const xmlChar *name);
                     92: const xmlChar *                xmlEncodeEntities       (xmlDocPtr doc,
                     93:                                                 const xmlChar *input);
1.26      daniel     94: xmlChar *              xmlEncodeEntitiesReentrant(xmlDocPtr doc,
1.25      daniel     95:                                                 const xmlChar *input);
1.24      daniel     96: xmlEntitiesTablePtr    xmlCreateEntitiesTable  (void);
                     97: xmlEntitiesTablePtr    xmlCopyEntitiesTable    (xmlEntitiesTablePtr table);
                     98: void                   xmlFreeEntitiesTable    (xmlEntitiesTablePtr table);
                     99: void                   xmlDumpEntitiesTable    (xmlBufferPtr buf,
                    100:                                                 xmlEntitiesTablePtr table);
                    101: xmlEntitiesTablePtr    xmlCopyEntitiesTable    (xmlEntitiesTablePtr table);
1.27      daniel    102: void                   xmlCleanupPredefinedEntities(void);
1.5       daniel    103: 
                    104: #ifdef __cplusplus
                    105: }
                    106: #endif
1.1       httpng    107: 
                    108: # endif /* __XML_ENTITIES_H__ */

Webmaster