blob: 14a7228555699e2e0b1ac0bafb698d6ed5909d4c [file] [log] [blame]
Daniel Veillard39a1f9a1999-01-17 19:11:59 +00001/*
2 * valid.h : interface to the DTD handling and the validity checking
3 *
4 * See Copyright for the status of this software.
5 *
6 * Daniel.Veillard@w3.org
7 */
8
9
10#ifndef __XML_VALID_H__
11#define __XML_VALID_H__
12#include "tree.h"
13
Daniel Veillard3b9def11999-01-31 22:15:06 +000014/*
Daniel Veillard1e346af1999-02-22 10:33:01 +000015 * ALl notation declarations are stored in a table
16 * there is one table per DTD
17 */
18
19#define XML_MIN_NOTATION_TABLE 32
20
21typedef struct xmlNotationTable {
22 int nb_notations; /* number of notations stored */
23 int max_notations; /* maximum number of notations */
24 xmlNotationPtr table; /* the table of attributes */
25} xmlNotationTable;
26typedef xmlNotationTable *xmlNotationTablePtr;
27
28/*
Daniel Veillard3b9def11999-01-31 22:15:06 +000029 * ALl element declarations are stored in a table
30 * there is one table per DTD
31 */
32
33#define XML_MIN_ELEMENT_TABLE 32
34
35typedef struct xmlElementTable {
36 int nb_elements; /* number of elements stored */
37 int max_elements; /* maximum number of elements */
Daniel Veillard1e346af1999-02-22 10:33:01 +000038 xmlElementPtr table; /* the table of elements */
39} xmlElementTable;
40typedef xmlElementTable *xmlElementTablePtr;
Daniel Veillard3b9def11999-01-31 22:15:06 +000041
Daniel Veillard1e346af1999-02-22 10:33:01 +000042/*
43 * ALl attribute declarations are stored in a table
44 * there is one table per DTD
45 */
46
47#define XML_MIN_ATTRIBUTE_TABLE 32
48
49typedef struct xmlAttributeTable {
50 int nb_attributes; /* number of attributes stored */
51 int max_attributes; /* maximum number of attributes */
52 xmlAttributePtr table; /* the table of attributes */
53} xmlAttributeTable;
54typedef xmlAttributeTable *xmlAttributeTablePtr;
55
56/* Notation */
57xmlNotationPtr xmlAddNotationDecl(xmlDtdPtr dtd, CHAR *name,
58 CHAR *PublicID, CHAR *SystemID);
59xmlNotationTablePtr xmlCopyNotationTable(xmlNotationTablePtr table);
60void xmlFreeNotationTable(xmlNotationTablePtr table);
61void xmlDumpNotationTable(xmlNotationTablePtr table);
62
63/* Element Content */
64xmlElementContentPtr xmlNewElementContent(CHAR *name, int type);
65xmlElementContentPtr xmlCopyElementContent(xmlElementContentPtr content);
66void xmlFreeElementContent(xmlElementContentPtr cur);
67
68/* Element */
69xmlElementPtr xmlAddElementDecl(xmlDtdPtr dtd, CHAR *name, int type,
Daniel Veillard39a1f9a1999-01-17 19:11:59 +000070 xmlElementContentPtr content);
Daniel Veillard1e346af1999-02-22 10:33:01 +000071xmlElementTablePtr xmlCopyElementTable(xmlElementTablePtr table);
72void xmlFreeElementTable(xmlElementTablePtr table);
73void xmlDumpElementTable(xmlElementTablePtr table);
Daniel Veillard3b9def11999-01-31 22:15:06 +000074
Daniel Veillard1e346af1999-02-22 10:33:01 +000075/* Enumeration */
76xmlEnumerationPtr xmlCreateEnumeration(CHAR *name);
77void xmlFreeEnumeration(xmlEnumerationPtr cur);
78xmlEnumerationPtr xmlCopyEnumeration(xmlEnumerationPtr cur);
79
80/* Attribute */
81xmlAttributePtr xmlAddAttributeDecl(xmlDtdPtr dtd, CHAR *elem,
82 CHAR *name, int type, int def,
83 CHAR *defaultValue, xmlEnumerationPtr tree);
84xmlAttributeTablePtr xmlCopyAttributeTable(xmlAttributeTablePtr table);
85void xmlFreeAttributeTable(xmlAttributeTablePtr table);
86void xmlDumpAttributeTable(xmlAttributeTablePtr table);
87
Daniel Veillard39a1f9a1999-01-17 19:11:59 +000088#endif /* __XML_VALID_H__ */