Annotation of XML/entities.h, revision 1.26

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: 
                     30: typedef struct xmlEntity {
1.6       daniel     31:     int type;                  /* The entity type */
1.9       daniel     32:     int len;                   /* The lenght of the name */
1.26    ! daniel     33:     const xmlChar  *name;      /* Name of the entity */
        !            34:     const xmlChar  *ExternalID;        /* External identifier for PUBLIC Entity */
        !            35:     const xmlChar  *SystemID;  /* URI for a SYSTEM or PUBLIC Entity */
1.25      daniel     36:     xmlChar *content;          /* The entity content or ndata if unparsed */
1.26    ! daniel     37:     xmlChar *orig;             /* The entity cont without ref substitution */
1.17      daniel     38: } xmlEntity;
                     39: typedef xmlEntity *xmlEntityPtr;
1.2       httpng     40: 
                     41: /*
                     42:  * ALl entities are stored in a table there is one table per DTD
                     43:  * and one extra per document.
                     44:  */
                     45: 
                     46: #define XML_MIN_ENTITIES_TABLE 32
                     47: 
                     48: typedef struct xmlEntitiesTable {
                     49:     int nb_entities;           /* number of elements stored */
                     50:     int max_entities;          /* maximum number of elements */
1.15      daniel     51:     xmlEntityPtr table;                /* the table of entities */
1.17      daniel     52: } xmlEntitiesTable;
                     53: typedef xmlEntitiesTable *xmlEntitiesTablePtr;
1.2       httpng     54: 
1.12      daniel     55: 
1.2       httpng     56: /*
1.1       httpng     57:  * External functions :
                     58:  */
1.18      daniel     59: 
                     60: #include "parser.h"
1.1       httpng     61: 
1.24      daniel     62: void                   xmlAddDocEntity         (xmlDocPtr doc,
1.25      daniel     63:                                                 const xmlChar *name,
1.24      daniel     64:                                                 int type,
1.25      daniel     65:                                                 const xmlChar *ExternalID,
                     66:                                                 const xmlChar *SystemID,
                     67:                                                 const xmlChar *content);
1.24      daniel     68: void                   xmlAddDtdEntity         (xmlDocPtr doc,
1.25      daniel     69:                                                 const xmlChar *name,
1.24      daniel     70:                                                 int type,
1.25      daniel     71:                                                 const xmlChar *ExternalID,
                     72:                                                 const xmlChar *SystemID,
                     73:                                                 const xmlChar *content);
                     74: xmlEntityPtr           xmlGetPredefinedEntity  (const xmlChar *name);
1.24      daniel     75: xmlEntityPtr           xmlGetDocEntity         (xmlDocPtr doc,
1.25      daniel     76:                                                 const xmlChar *name);
1.24      daniel     77: xmlEntityPtr           xmlGetDtdEntity         (xmlDocPtr doc,
1.25      daniel     78:                                                 const xmlChar *name);
1.24      daniel     79: xmlEntityPtr           xmlGetParameterEntity   (xmlDocPtr doc,
1.25      daniel     80:                                                 const xmlChar *name);
                     81: const xmlChar *                xmlEncodeEntities       (xmlDocPtr doc,
                     82:                                                 const xmlChar *input);
1.26    ! daniel     83: xmlChar *              xmlEncodeEntitiesReentrant(xmlDocPtr doc,
1.25      daniel     84:                                                 const xmlChar *input);
1.24      daniel     85: xmlEntitiesTablePtr    xmlCreateEntitiesTable  (void);
                     86: xmlEntitiesTablePtr    xmlCopyEntitiesTable    (xmlEntitiesTablePtr table);
                     87: void                   xmlFreeEntitiesTable    (xmlEntitiesTablePtr table);
                     88: void                   xmlDumpEntitiesTable    (xmlBufferPtr buf,
                     89:                                                 xmlEntitiesTablePtr table);
                     90: xmlEntitiesTablePtr    xmlCopyEntitiesTable    (xmlEntitiesTablePtr table);
1.5       daniel     91: 
                     92: #ifdef __cplusplus
                     93: }
                     94: #endif
1.1       httpng     95: 
                     96: # endif /* __XML_ENTITIES_H__ */

Webmaster