blob: a0b24ac2ac00903636b76ddd72183ace7b50ee3a [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001/*
2 * entities.h : interface for the XML entities handking
3 *
4 * See Copyright for the status of this software.
5 *
6 * $Id$
7 */
8
9#ifndef __XML_ENTITIES_H__
10#define __XML_ENTITIES_H__
11#include "xml_parser.h"
12
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/*
19 * An unit of storage for an entity, contains the string, the value
20 * and the linkind data needed for the linking in the hash table.
21 */
22
23typedef struct xmlEntity {
24 const CHAR *id; /* The entity name */
25 CHAR *value; /* The entity CHAR equivalent */
26} xmlEntity, *xmlEntityPtr;
27
28/*
29 * ALl entities are stored in a table there is one table per DTD
30 * and one extra per document.
31 */
32
33#define XML_MIN_ENTITIES_TABLE 32
34
35typedef struct xmlEntitiesTable {
36 int nb_entities; /* number of elements stored */
37 int max_entities; /* maximum number of elements */
38 xmlEntityPtr table; /* the table of entities */
39} xmlEntitiesTable, *xmlEntitiesTablePtr;
40
41/*
42 * External functions :
43 */
44
45extern void xmlAddDocEntity(xmlDocPtr doc, CHAR *value, const CHAR *id);
46extern void xmlAddDtdEntity(xmlDtdPtr dtd, CHAR *value, const CHAR *id);
47extern CHAR *xmlGetEntity(xmlDocPtr doc, const CHAR *id);
48extern CHAR *xmlSubstituteEntities(xmlDocPtr doc, const CHAR *input);
49extern CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
50extern CHAR *xmlDecodeEntities(xmlDocPtr doc, const CHAR *input, int len);
51extern xmlEntitiesTablePtr xmlCreateEntitiesTable(void);
52extern void xmlFreeEntitiesTable(xmlEntitiesTablePtr table);
53
54#ifdef __cplusplus
55}
56#endif
57
58# endif /* __XML_ENTITIES_H__ */