Annotation of XML/entities.h, revision 1.23
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.8 daniel 33: const CHAR *name; /* Name of the entity */
34: const CHAR *ExternalID; /* External identifier for PUBLIC Entity */
35: const CHAR *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
1.9 daniel 36: CHAR *content; /* The entity content or ndata if unparsed */
1.20 daniel 37: CHAR *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.17 daniel 62: void xmlAddDocEntity(xmlDocPtr doc, const CHAR *name, int type,
1.8 daniel 63: const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
1.17 daniel 64: void xmlAddDtdEntity(xmlDocPtr doc, const CHAR *name, int type,
1.8 daniel 65: const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
1.17 daniel 66: xmlEntityPtr xmlGetPredefinedEntity(const CHAR *name);
67: xmlEntityPtr xmlGetDocEntity(xmlDocPtr doc, const CHAR *name);
68: xmlEntityPtr xmlGetDtdEntity(xmlDocPtr doc, const CHAR *name);
1.23 ! daniel 69: xmlEntityPtr xmlGetParameterEntity(xmlDocPtr doc, const CHAR *name);
1.22 daniel 70: const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
71: CHAR *xmlEncodeEntitiesReentrant(xmlDocPtr doc, const CHAR *input);
1.17 daniel 72: xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
73: xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
74: void xmlFreeEntitiesTable(xmlEntitiesTablePtr table);
1.19 daniel 75: void xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table);
1.17 daniel 76: xmlEntitiesTablePtr xmlCopyEntitiesTable(xmlEntitiesTablePtr table);
1.5 daniel 77:
78: #ifdef __cplusplus
79: }
80: #endif
1.1 httpng 81:
82: # endif /* __XML_ENTITIES_H__ */
Webmaster