Annotation of XML/entities.h, revision 1.10
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.10 ! daniel 6: * $Id: entities.h,v 1.9 1998/08/07 05:15:39 daniel Exp $
1.1 httpng 7: */
8:
9: #ifndef __XML_ENTITIES_H__
10: #define __XML_ENTITIES_H__
11: #include "parser.h"
12:
1.5 daniel 13:
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
23:
1.1 httpng 24: /*
1.2 httpng 25: * An unit of storage for an entity, contains the string, the value
26: * and the linkind data needed for the linking in the hash table.
27: */
28:
29: typedef struct xmlEntity {
1.6 daniel 30: int type; /* The entity type */
1.9 daniel 31: int len; /* The lenght of the name */
1.8 daniel 32: const CHAR *name; /* Name of the entity */
33: const CHAR *ExternalID; /* External identifier for PUBLIC Entity */
34: const CHAR *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
1.9 daniel 35: CHAR *content; /* The entity content or ndata if unparsed */
1.2 httpng 36: } xmlEntity, *xmlEntityPtr;
37:
38: /*
39: * ALl entities are stored in a table there is one table per DTD
40: * and one extra per document.
41: */
42:
43: #define XML_MIN_ENTITIES_TABLE 32
44:
45: typedef struct xmlEntitiesTable {
46: int nb_entities; /* number of elements stored */
47: int max_entities; /* maximum number of elements */
48: xmlEntityPtr table; /* the table of entities */
49: } xmlEntitiesTable, *xmlEntitiesTablePtr;
50:
51: /*
1.1 httpng 52: * External functions :
53: */
54:
1.8 daniel 55: extern void xmlAddDocEntity(xmlDocPtr doc, const CHAR *name, int type,
56: const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
57: extern void xmlAddDtdEntity(xmlDtdPtr dtd, const CHAR *name, int type,
58: const CHAR *ExternalID, const CHAR *SystemID, CHAR *content);
1.10 ! daniel 59: extern xmlEntityPtr xmlGetEntity(xmlDocPtr doc, const CHAR *name);
1.1 httpng 60: extern CHAR *xmlSubstituteEntities(xmlDocPtr doc, const CHAR *input);
1.2 httpng 61: extern CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
1.3 veillard 62: extern CHAR *xmlDecodeEntities(xmlDocPtr doc, const CHAR *input, int len);
1.2 httpng 63: extern xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
64: extern void xmlFreeEntitiesTable(xmlEntitiesTablePtr table);
1.8 daniel 65: extern void xmlDumpEntitiesTable(xmlEntitiesTablePtr table);
1.5 daniel 66:
67: #ifdef __cplusplus
68: }
69: #endif
1.1 httpng 70:
71: # endif /* __XML_ENTITIES_H__ */
Webmaster