File: entities.h

package info (click to toggle)
libxml2 2.15.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,964 kB
  • sloc: ansic: 138,103; python: 6,692; sh: 4,736; xml: 1,476; makefile: 715
file content (167 lines) | stat: -rw-r--r-- 4,379 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/**
 * @file
 * 
 * @brief XML entities
 * 
 * This module provides an API to work with XML entities.
 *
 * @copyright See Copyright for the status of this software.
 *
 * @author Daniel Veillard
 */

#ifndef __XML_ENTITIES_H__
#define __XML_ENTITIES_H__

#include <libxml/xmlversion.h>
#define XML_TREE_INTERNALS
#include <libxml/tree.h>
#undef XML_TREE_INTERNALS

#ifdef __cplusplus
extern "C" {
#endif

/**
 * The different entity types.
 */
typedef enum {
    /** internal general entity */
    XML_INTERNAL_GENERAL_ENTITY = 1,
    /** external general parsed entity */
    XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
    /** external general unparsed entity */
    XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
    /** internal parameter entity */
    XML_INTERNAL_PARAMETER_ENTITY = 4,
    /** external parameter entity */
    XML_EXTERNAL_PARAMETER_ENTITY = 5,
    /** internal predefined entity */
    XML_INTERNAL_PREDEFINED_ENTITY = 6
} xmlEntityType;

/**
 * An entity declaration
 */
struct _xmlEntity {
    /** application data */
    void           *_private;
    /** XML_ENTITY_DECL, must be second ! */
    xmlElementType          type;
    /** Entity name */
    const xmlChar          *name;
    /** First child link */
    struct _xmlNode    *children;
    /** Last child link */
    struct _xmlNode        *last;
    /** -> DTD */
    struct _xmlDtd       *parent;
    /** next sibling link  */
    struct _xmlNode        *next;
    /** previous sibling link  */
    struct _xmlNode        *prev;
    /** the containing document */
    struct _xmlDoc          *doc;

    /** content without ref substitution */
    xmlChar                *orig;
    /** content or ndata if unparsed */
    xmlChar             *content;
    /** the content length */
    int                   length;
    /** The entity type */
    xmlEntityType          etype;
    /** External identifier for PUBLIC */
    const xmlChar    *ExternalID;
    /** URI for a SYSTEM or PUBLIC Entity */
    const xmlChar      *SystemID;

    /** unused */
    struct _xmlEntity     *nexte;
    /** the full URI as computed */
    const xmlChar           *URI;
    /** unused */
    int                    owner;
    /** various flags */
    int                    flags;
    /** expanded size */
    unsigned long   expandedSize;
};

typedef struct _xmlHashTable xmlEntitiesTable;
typedef xmlEntitiesTable *xmlEntitiesTablePtr;

XMLPUBFUN xmlEntity *
			xmlNewEntity		(xmlDoc *doc,
						 const xmlChar *name,
						 int type,
						 const xmlChar *publicId,
						 const xmlChar *systemId,
						 const xmlChar *content);
XMLPUBFUN void
			xmlFreeEntity		(xmlEntity *entity);
XMLPUBFUN int
			xmlAddEntity		(xmlDoc *doc,
						 int extSubset,
						 const xmlChar *name,
						 int type,
						 const xmlChar *publicId,
						 const xmlChar *systemId,
						 const xmlChar *content,
						 xmlEntity **out);
XMLPUBFUN xmlEntity *
			xmlAddDocEntity		(xmlDoc *doc,
						 const xmlChar *name,
						 int type,
						 const xmlChar *publicId,
						 const xmlChar *systemId,
						 const xmlChar *content);
XMLPUBFUN xmlEntity *
			xmlAddDtdEntity		(xmlDoc *doc,
						 const xmlChar *name,
						 int type,
						 const xmlChar *publicId,
						 const xmlChar *systemId,
						 const xmlChar *content);
XMLPUBFUN xmlEntity *
			xmlGetPredefinedEntity	(const xmlChar *name);
XMLPUBFUN xmlEntity *
			xmlGetDocEntity		(const xmlDoc *doc,
						 const xmlChar *name);
XMLPUBFUN xmlEntity *
			xmlGetDtdEntity		(xmlDoc *doc,
						 const xmlChar *name);
XMLPUBFUN xmlEntity *
			xmlGetParameterEntity	(xmlDoc *doc,
						 const xmlChar *name);
XMLPUBFUN xmlChar *
			xmlEncodeEntitiesReentrant(xmlDoc *doc,
						 const xmlChar *input);
XMLPUBFUN xmlChar *
			xmlEncodeSpecialChars	(const xmlDoc *doc,
						 const xmlChar *input);
XML_DEPRECATED
XMLPUBFUN xmlEntitiesTable *
			xmlCreateEntitiesTable	(void);
XML_DEPRECATED
XMLPUBFUN xmlEntitiesTable *
			xmlCopyEntitiesTable	(xmlEntitiesTable *table);
XML_DEPRECATED
XMLPUBFUN void
			xmlFreeEntitiesTable	(xmlEntitiesTable *table);
#ifdef LIBXML_OUTPUT_ENABLED
XML_DEPRECATED
XMLPUBFUN void
			xmlDumpEntitiesTable	(xmlBuffer *buf,
						 xmlEntitiesTable *table);
XML_DEPRECATED
XMLPUBFUN void
			xmlDumpEntityDecl	(xmlBuffer *buf,
						 xmlEntity *ent);
#endif /* LIBXML_OUTPUT_ENABLED */

#ifdef __cplusplus
}
#endif

# endif /* __XML_ENTITIES_H__ */