pocxxeci 0.30.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pocxxeci might be problematic. Click here for more details.
- package/LICENSE +19 -0
- package/Makefile +18 -0
- package/README.md +52 -0
- package/binding.gyp +81 -0
- package/index.d.ts +273 -0
- package/index.js +45 -0
- package/lib/bindings.js +1 -0
- package/lib/document.js +122 -0
- package/lib/element.js +82 -0
- package/lib/sax_parser.js +38 -0
- package/package.json +70 -0
- package/src/html_document.cc +7 -0
- package/src/html_document.h +18 -0
- package/src/libxmljs.cc +252 -0
- package/src/libxmljs.h +53 -0
- package/src/xml_attribute.cc +173 -0
- package/src/xml_attribute.h +40 -0
- package/src/xml_comment.cc +117 -0
- package/src/xml_comment.h +30 -0
- package/src/xml_document.cc +810 -0
- package/src/xml_document.h +67 -0
- package/src/xml_element.cc +565 -0
- package/src/xml_element.h +61 -0
- package/src/xml_namespace.cc +158 -0
- package/src/xml_namespace.h +39 -0
- package/src/xml_node.cc +761 -0
- package/src/xml_node.h +73 -0
- package/src/xml_pi.cc +161 -0
- package/src/xml_pi.h +34 -0
- package/src/xml_sax_parser.cc +424 -0
- package/src/xml_sax_parser.h +73 -0
- package/src/xml_syntax_error.cc +66 -0
- package/src/xml_syntax_error.h +25 -0
- package/src/xml_text.cc +320 -0
- package/src/xml_text.h +48 -0
- package/src/xml_textwriter.cc +315 -0
- package/src/xml_textwriter.h +62 -0
- package/src/xml_xpath_context.cc +70 -0
- package/src/xml_xpath_context.h +23 -0
- package/vendor/libxml/Copyright +23 -0
- package/vendor/libxml/DOCBparser.c +305 -0
- package/vendor/libxml/HTMLparser.c +7287 -0
- package/vendor/libxml/HTMLtree.c +1200 -0
- package/vendor/libxml/Makefile +2983 -0
- package/vendor/libxml/SAX.c +180 -0
- package/vendor/libxml/SAX2.c +3036 -0
- package/vendor/libxml/buf.c +1351 -0
- package/vendor/libxml/buf.h +72 -0
- package/vendor/libxml/c14n.c +2234 -0
- package/vendor/libxml/catalog.c +3828 -0
- package/vendor/libxml/chvalid.c +336 -0
- package/vendor/libxml/config.h +294 -0
- package/vendor/libxml/config.h.gch +0 -0
- package/vendor/libxml/debugXML.c +3423 -0
- package/vendor/libxml/dict.c +1298 -0
- package/vendor/libxml/elfgcchack.h +17818 -0
- package/vendor/libxml/enc.h +32 -0
- package/vendor/libxml/encoding.c +3975 -0
- package/vendor/libxml/entities.c +1163 -0
- package/vendor/libxml/error.c +998 -0
- package/vendor/libxml/globals.c +1126 -0
- package/vendor/libxml/hash.c +1146 -0
- package/vendor/libxml/include/libxml/DOCBparser.h +96 -0
- package/vendor/libxml/include/libxml/HTMLparser.h +306 -0
- package/vendor/libxml/include/libxml/HTMLtree.h +147 -0
- package/vendor/libxml/include/libxml/Makefile +725 -0
- package/vendor/libxml/include/libxml/Makefile.am +54 -0
- package/vendor/libxml/include/libxml/Makefile.in +725 -0
- package/vendor/libxml/include/libxml/SAX.h +173 -0
- package/vendor/libxml/include/libxml/SAX2.h +178 -0
- package/vendor/libxml/include/libxml/c14n.h +128 -0
- package/vendor/libxml/include/libxml/catalog.h +182 -0
- package/vendor/libxml/include/libxml/chvalid.h +230 -0
- package/vendor/libxml/include/libxml/debugXML.h +217 -0
- package/vendor/libxml/include/libxml/dict.h +79 -0
- package/vendor/libxml/include/libxml/encoding.h +245 -0
- package/vendor/libxml/include/libxml/entities.h +151 -0
- package/vendor/libxml/include/libxml/globals.h +508 -0
- package/vendor/libxml/include/libxml/hash.h +236 -0
- package/vendor/libxml/include/libxml/list.h +137 -0
- package/vendor/libxml/include/libxml/nanoftp.h +163 -0
- package/vendor/libxml/include/libxml/nanohttp.h +81 -0
- package/vendor/libxml/include/libxml/parser.h +1243 -0
- package/vendor/libxml/include/libxml/parserInternals.h +644 -0
- package/vendor/libxml/include/libxml/pattern.h +100 -0
- package/vendor/libxml/include/libxml/relaxng.h +217 -0
- package/vendor/libxml/include/libxml/schemasInternals.h +958 -0
- package/vendor/libxml/include/libxml/schematron.h +142 -0
- package/vendor/libxml/include/libxml/threads.h +89 -0
- package/vendor/libxml/include/libxml/tree.h +1311 -0
- package/vendor/libxml/include/libxml/uri.h +94 -0
- package/vendor/libxml/include/libxml/valid.h +458 -0
- package/vendor/libxml/include/libxml/xinclude.h +129 -0
- package/vendor/libxml/include/libxml/xlink.h +189 -0
- package/vendor/libxml/include/libxml/xmlIO.h +368 -0
- package/vendor/libxml/include/libxml/xmlautomata.h +146 -0
- package/vendor/libxml/include/libxml/xmlerror.h +945 -0
- package/vendor/libxml/include/libxml/xmlexports.h +77 -0
- package/vendor/libxml/include/libxml/xmlmemory.h +224 -0
- package/vendor/libxml/include/libxml/xmlmodule.h +57 -0
- package/vendor/libxml/include/libxml/xmlreader.h +428 -0
- package/vendor/libxml/include/libxml/xmlregexp.h +222 -0
- package/vendor/libxml/include/libxml/xmlsave.h +88 -0
- package/vendor/libxml/include/libxml/xmlschemas.h +246 -0
- package/vendor/libxml/include/libxml/xmlschemastypes.h +151 -0
- package/vendor/libxml/include/libxml/xmlstring.h +140 -0
- package/vendor/libxml/include/libxml/xmlunicode.h +202 -0
- package/vendor/libxml/include/libxml/xmlversion.h +484 -0
- package/vendor/libxml/include/libxml/xmlwin32version.h +239 -0
- package/vendor/libxml/include/libxml/xmlwriter.h +488 -0
- package/vendor/libxml/include/libxml/xpath.h +564 -0
- package/vendor/libxml/include/libxml/xpathInternals.h +632 -0
- package/vendor/libxml/include/libxml/xpointer.h +114 -0
- package/vendor/libxml/include/win32config.h +122 -0
- package/vendor/libxml/include/wsockcompat.h +54 -0
- package/vendor/libxml/legacy.c +1343 -0
- package/vendor/libxml/libxml.h +134 -0
- package/vendor/libxml/list.c +779 -0
- package/vendor/libxml/nanoftp.c +2118 -0
- package/vendor/libxml/nanohttp.c +1899 -0
- package/vendor/libxml/parser.c +15553 -0
- package/vendor/libxml/parserInternals.c +2164 -0
- package/vendor/libxml/pattern.c +2621 -0
- package/vendor/libxml/relaxng.c +11101 -0
- package/vendor/libxml/rngparser.c +1595 -0
- package/vendor/libxml/runsuite.c +1157 -0
- package/vendor/libxml/save.h +36 -0
- package/vendor/libxml/schematron.c +1787 -0
- package/vendor/libxml/threads.c +1049 -0
- package/vendor/libxml/timsort.h +601 -0
- package/vendor/libxml/tree.c +10183 -0
- package/vendor/libxml/trio.c +6895 -0
- package/vendor/libxml/trio.h +230 -0
- package/vendor/libxml/triodef.h +228 -0
- package/vendor/libxml/trionan.c +914 -0
- package/vendor/libxml/trionan.h +84 -0
- package/vendor/libxml/triop.h +150 -0
- package/vendor/libxml/triostr.c +2112 -0
- package/vendor/libxml/triostr.h +144 -0
- package/vendor/libxml/uri.c +2561 -0
- package/vendor/libxml/valid.c +7138 -0
- package/vendor/libxml/xinclude.c +2657 -0
- package/vendor/libxml/xlink.c +183 -0
- package/vendor/libxml/xmlIO.c +4135 -0
- package/vendor/libxml/xmlcatalog.c +624 -0
- package/vendor/libxml/xmllint.c +3796 -0
- package/vendor/libxml/xmlmemory.c +1163 -0
- package/vendor/libxml/xmlmodule.c +468 -0
- package/vendor/libxml/xmlreader.c +6033 -0
- package/vendor/libxml/xmlregexp.c +8271 -0
- package/vendor/libxml/xmlsave.c +2735 -0
- package/vendor/libxml/xmlschemas.c +29173 -0
- package/vendor/libxml/xmlschemastypes.c +6276 -0
- package/vendor/libxml/xmlstring.c +1050 -0
- package/vendor/libxml/xmlunicode.c +3179 -0
- package/vendor/libxml/xmlwriter.c +4738 -0
- package/vendor/libxml/xpath.c +14734 -0
- package/vendor/libxml/xpointer.c +2969 -0
- package/vendor/libxml/xzlib.c +815 -0
- package/vendor/libxml/xzlib.h +19 -0
@@ -0,0 +1,189 @@
|
|
1
|
+
/*
|
2
|
+
* Summary: unfinished XLink detection module
|
3
|
+
* Description: unfinished XLink detection module
|
4
|
+
*
|
5
|
+
* Copy: See Copyright for the status of this software.
|
6
|
+
*
|
7
|
+
* Author: Daniel Veillard
|
8
|
+
*/
|
9
|
+
|
10
|
+
#ifndef __XML_XLINK_H__
|
11
|
+
#define __XML_XLINK_H__
|
12
|
+
|
13
|
+
#include <libxml/xmlversion.h>
|
14
|
+
#include <libxml/tree.h>
|
15
|
+
|
16
|
+
#ifdef LIBXML_XPTR_ENABLED
|
17
|
+
|
18
|
+
#ifdef __cplusplus
|
19
|
+
extern "C" {
|
20
|
+
#endif
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Various defines for the various Link properties.
|
24
|
+
*
|
25
|
+
* NOTE: the link detection layer will try to resolve QName expansion
|
26
|
+
* of namespaces. If "foo" is the prefix for "http://foo.com/"
|
27
|
+
* then the link detection layer will expand role="foo:myrole"
|
28
|
+
* to "http://foo.com/:myrole".
|
29
|
+
* NOTE: the link detection layer will expand URI-References found on
|
30
|
+
* href attributes by using the base mechanism if found.
|
31
|
+
*/
|
32
|
+
typedef xmlChar *xlinkHRef;
|
33
|
+
typedef xmlChar *xlinkRole;
|
34
|
+
typedef xmlChar *xlinkTitle;
|
35
|
+
|
36
|
+
typedef enum {
|
37
|
+
XLINK_TYPE_NONE = 0,
|
38
|
+
XLINK_TYPE_SIMPLE,
|
39
|
+
XLINK_TYPE_EXTENDED,
|
40
|
+
XLINK_TYPE_EXTENDED_SET
|
41
|
+
} xlinkType;
|
42
|
+
|
43
|
+
typedef enum {
|
44
|
+
XLINK_SHOW_NONE = 0,
|
45
|
+
XLINK_SHOW_NEW,
|
46
|
+
XLINK_SHOW_EMBED,
|
47
|
+
XLINK_SHOW_REPLACE
|
48
|
+
} xlinkShow;
|
49
|
+
|
50
|
+
typedef enum {
|
51
|
+
XLINK_ACTUATE_NONE = 0,
|
52
|
+
XLINK_ACTUATE_AUTO,
|
53
|
+
XLINK_ACTUATE_ONREQUEST
|
54
|
+
} xlinkActuate;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* xlinkNodeDetectFunc:
|
58
|
+
* @ctx: user data pointer
|
59
|
+
* @node: the node to check
|
60
|
+
*
|
61
|
+
* This is the prototype for the link detection routine.
|
62
|
+
* It calls the default link detection callbacks upon link detection.
|
63
|
+
*/
|
64
|
+
typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
|
65
|
+
|
66
|
+
/*
|
67
|
+
* The link detection module interact with the upper layers using
|
68
|
+
* a set of callback registered at parsing time.
|
69
|
+
*/
|
70
|
+
|
71
|
+
/**
|
72
|
+
* xlinkSimpleLinkFunk:
|
73
|
+
* @ctx: user data pointer
|
74
|
+
* @node: the node carrying the link
|
75
|
+
* @href: the target of the link
|
76
|
+
* @role: the role string
|
77
|
+
* @title: the link title
|
78
|
+
*
|
79
|
+
* This is the prototype for a simple link detection callback.
|
80
|
+
*/
|
81
|
+
typedef void
|
82
|
+
(*xlinkSimpleLinkFunk) (void *ctx,
|
83
|
+
xmlNodePtr node,
|
84
|
+
const xlinkHRef href,
|
85
|
+
const xlinkRole role,
|
86
|
+
const xlinkTitle title);
|
87
|
+
|
88
|
+
/**
|
89
|
+
* xlinkExtendedLinkFunk:
|
90
|
+
* @ctx: user data pointer
|
91
|
+
* @node: the node carrying the link
|
92
|
+
* @nbLocators: the number of locators detected on the link
|
93
|
+
* @hrefs: pointer to the array of locator hrefs
|
94
|
+
* @roles: pointer to the array of locator roles
|
95
|
+
* @nbArcs: the number of arcs detected on the link
|
96
|
+
* @from: pointer to the array of source roles found on the arcs
|
97
|
+
* @to: pointer to the array of target roles found on the arcs
|
98
|
+
* @show: array of values for the show attributes found on the arcs
|
99
|
+
* @actuate: array of values for the actuate attributes found on the arcs
|
100
|
+
* @nbTitles: the number of titles detected on the link
|
101
|
+
* @title: array of titles detected on the link
|
102
|
+
* @langs: array of xml:lang values for the titles
|
103
|
+
*
|
104
|
+
* This is the prototype for a extended link detection callback.
|
105
|
+
*/
|
106
|
+
typedef void
|
107
|
+
(*xlinkExtendedLinkFunk)(void *ctx,
|
108
|
+
xmlNodePtr node,
|
109
|
+
int nbLocators,
|
110
|
+
const xlinkHRef *hrefs,
|
111
|
+
const xlinkRole *roles,
|
112
|
+
int nbArcs,
|
113
|
+
const xlinkRole *from,
|
114
|
+
const xlinkRole *to,
|
115
|
+
xlinkShow *show,
|
116
|
+
xlinkActuate *actuate,
|
117
|
+
int nbTitles,
|
118
|
+
const xlinkTitle *titles,
|
119
|
+
const xmlChar **langs);
|
120
|
+
|
121
|
+
/**
|
122
|
+
* xlinkExtendedLinkSetFunk:
|
123
|
+
* @ctx: user data pointer
|
124
|
+
* @node: the node carrying the link
|
125
|
+
* @nbLocators: the number of locators detected on the link
|
126
|
+
* @hrefs: pointer to the array of locator hrefs
|
127
|
+
* @roles: pointer to the array of locator roles
|
128
|
+
* @nbTitles: the number of titles detected on the link
|
129
|
+
* @title: array of titles detected on the link
|
130
|
+
* @langs: array of xml:lang values for the titles
|
131
|
+
*
|
132
|
+
* This is the prototype for a extended link set detection callback.
|
133
|
+
*/
|
134
|
+
typedef void
|
135
|
+
(*xlinkExtendedLinkSetFunk) (void *ctx,
|
136
|
+
xmlNodePtr node,
|
137
|
+
int nbLocators,
|
138
|
+
const xlinkHRef *hrefs,
|
139
|
+
const xlinkRole *roles,
|
140
|
+
int nbTitles,
|
141
|
+
const xlinkTitle *titles,
|
142
|
+
const xmlChar **langs);
|
143
|
+
|
144
|
+
/**
|
145
|
+
* This is the structure containing a set of Links detection callbacks.
|
146
|
+
*
|
147
|
+
* There is no default xlink callbacks, if one want to get link
|
148
|
+
* recognition activated, those call backs must be provided before parsing.
|
149
|
+
*/
|
150
|
+
typedef struct _xlinkHandler xlinkHandler;
|
151
|
+
typedef xlinkHandler *xlinkHandlerPtr;
|
152
|
+
struct _xlinkHandler {
|
153
|
+
xlinkSimpleLinkFunk simple;
|
154
|
+
xlinkExtendedLinkFunk extended;
|
155
|
+
xlinkExtendedLinkSetFunk set;
|
156
|
+
};
|
157
|
+
|
158
|
+
/*
|
159
|
+
* The default detection routine, can be overridden, they call the default
|
160
|
+
* detection callbacks.
|
161
|
+
*/
|
162
|
+
|
163
|
+
XMLPUBFUN xlinkNodeDetectFunc XMLCALL
|
164
|
+
xlinkGetDefaultDetect (void);
|
165
|
+
XMLPUBFUN void XMLCALL
|
166
|
+
xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
|
167
|
+
|
168
|
+
/*
|
169
|
+
* Routines to set/get the default handlers.
|
170
|
+
*/
|
171
|
+
XMLPUBFUN xlinkHandlerPtr XMLCALL
|
172
|
+
xlinkGetDefaultHandler (void);
|
173
|
+
XMLPUBFUN void XMLCALL
|
174
|
+
xlinkSetDefaultHandler (xlinkHandlerPtr handler);
|
175
|
+
|
176
|
+
/*
|
177
|
+
* Link detection module itself.
|
178
|
+
*/
|
179
|
+
XMLPUBFUN xlinkType XMLCALL
|
180
|
+
xlinkIsLink (xmlDocPtr doc,
|
181
|
+
xmlNodePtr node);
|
182
|
+
|
183
|
+
#ifdef __cplusplus
|
184
|
+
}
|
185
|
+
#endif
|
186
|
+
|
187
|
+
#endif /* LIBXML_XPTR_ENABLED */
|
188
|
+
|
189
|
+
#endif /* __XML_XLINK_H__ */
|
@@ -0,0 +1,368 @@
|
|
1
|
+
/*
|
2
|
+
* Summary: interface for the I/O interfaces used by the parser
|
3
|
+
* Description: interface for the I/O interfaces used by the parser
|
4
|
+
*
|
5
|
+
* Copy: See Copyright for the status of this software.
|
6
|
+
*
|
7
|
+
* Author: Daniel Veillard
|
8
|
+
*/
|
9
|
+
|
10
|
+
#ifndef __XML_IO_H__
|
11
|
+
#define __XML_IO_H__
|
12
|
+
|
13
|
+
#include <stdio.h>
|
14
|
+
#include <libxml/xmlversion.h>
|
15
|
+
|
16
|
+
#ifdef __cplusplus
|
17
|
+
extern "C" {
|
18
|
+
#endif
|
19
|
+
|
20
|
+
/*
|
21
|
+
* Those are the functions and datatypes for the parser input
|
22
|
+
* I/O structures.
|
23
|
+
*/
|
24
|
+
|
25
|
+
/**
|
26
|
+
* xmlInputMatchCallback:
|
27
|
+
* @filename: the filename or URI
|
28
|
+
*
|
29
|
+
* Callback used in the I/O Input API to detect if the current handler
|
30
|
+
* can provide input functionality for this resource.
|
31
|
+
*
|
32
|
+
* Returns 1 if yes and 0 if another Input module should be used
|
33
|
+
*/
|
34
|
+
typedef int (XMLCALL *xmlInputMatchCallback) (char const *filename);
|
35
|
+
/**
|
36
|
+
* xmlInputOpenCallback:
|
37
|
+
* @filename: the filename or URI
|
38
|
+
*
|
39
|
+
* Callback used in the I/O Input API to open the resource
|
40
|
+
*
|
41
|
+
* Returns an Input context or NULL in case or error
|
42
|
+
*/
|
43
|
+
typedef void * (XMLCALL *xmlInputOpenCallback) (char const *filename);
|
44
|
+
/**
|
45
|
+
* xmlInputReadCallback:
|
46
|
+
* @context: an Input context
|
47
|
+
* @buffer: the buffer to store data read
|
48
|
+
* @len: the length of the buffer in bytes
|
49
|
+
*
|
50
|
+
* Callback used in the I/O Input API to read the resource
|
51
|
+
*
|
52
|
+
* Returns the number of bytes read or -1 in case of error
|
53
|
+
*/
|
54
|
+
typedef int (XMLCALL *xmlInputReadCallback) (void * context, char * buffer, int len);
|
55
|
+
/**
|
56
|
+
* xmlInputCloseCallback:
|
57
|
+
* @context: an Input context
|
58
|
+
*
|
59
|
+
* Callback used in the I/O Input API to close the resource
|
60
|
+
*
|
61
|
+
* Returns 0 or -1 in case of error
|
62
|
+
*/
|
63
|
+
typedef int (XMLCALL *xmlInputCloseCallback) (void * context);
|
64
|
+
|
65
|
+
#ifdef LIBXML_OUTPUT_ENABLED
|
66
|
+
/*
|
67
|
+
* Those are the functions and datatypes for the library output
|
68
|
+
* I/O structures.
|
69
|
+
*/
|
70
|
+
|
71
|
+
/**
|
72
|
+
* xmlOutputMatchCallback:
|
73
|
+
* @filename: the filename or URI
|
74
|
+
*
|
75
|
+
* Callback used in the I/O Output API to detect if the current handler
|
76
|
+
* can provide output functionality for this resource.
|
77
|
+
*
|
78
|
+
* Returns 1 if yes and 0 if another Output module should be used
|
79
|
+
*/
|
80
|
+
typedef int (XMLCALL *xmlOutputMatchCallback) (char const *filename);
|
81
|
+
/**
|
82
|
+
* xmlOutputOpenCallback:
|
83
|
+
* @filename: the filename or URI
|
84
|
+
*
|
85
|
+
* Callback used in the I/O Output API to open the resource
|
86
|
+
*
|
87
|
+
* Returns an Output context or NULL in case or error
|
88
|
+
*/
|
89
|
+
typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename);
|
90
|
+
/**
|
91
|
+
* xmlOutputWriteCallback:
|
92
|
+
* @context: an Output context
|
93
|
+
* @buffer: the buffer of data to write
|
94
|
+
* @len: the length of the buffer in bytes
|
95
|
+
*
|
96
|
+
* Callback used in the I/O Output API to write to the resource
|
97
|
+
*
|
98
|
+
* Returns the number of bytes written or -1 in case of error
|
99
|
+
*/
|
100
|
+
typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer,
|
101
|
+
int len);
|
102
|
+
/**
|
103
|
+
* xmlOutputCloseCallback:
|
104
|
+
* @context: an Output context
|
105
|
+
*
|
106
|
+
* Callback used in the I/O Output API to close the resource
|
107
|
+
*
|
108
|
+
* Returns 0 or -1 in case of error
|
109
|
+
*/
|
110
|
+
typedef int (XMLCALL *xmlOutputCloseCallback) (void * context);
|
111
|
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
112
|
+
|
113
|
+
#ifdef __cplusplus
|
114
|
+
}
|
115
|
+
#endif
|
116
|
+
|
117
|
+
#include <libxml/globals.h>
|
118
|
+
#include <libxml/tree.h>
|
119
|
+
#include <libxml/parser.h>
|
120
|
+
#include <libxml/encoding.h>
|
121
|
+
|
122
|
+
#ifdef __cplusplus
|
123
|
+
extern "C" {
|
124
|
+
#endif
|
125
|
+
struct _xmlParserInputBuffer {
|
126
|
+
void* context;
|
127
|
+
xmlInputReadCallback readcallback;
|
128
|
+
xmlInputCloseCallback closecallback;
|
129
|
+
|
130
|
+
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
131
|
+
|
132
|
+
xmlBufPtr buffer; /* Local buffer encoded in UTF-8 */
|
133
|
+
xmlBufPtr raw; /* if encoder != NULL buffer for raw input */
|
134
|
+
int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
|
135
|
+
int error;
|
136
|
+
unsigned long rawconsumed;/* amount consumed from raw */
|
137
|
+
};
|
138
|
+
|
139
|
+
|
140
|
+
#ifdef LIBXML_OUTPUT_ENABLED
|
141
|
+
struct _xmlOutputBuffer {
|
142
|
+
void* context;
|
143
|
+
xmlOutputWriteCallback writecallback;
|
144
|
+
xmlOutputCloseCallback closecallback;
|
145
|
+
|
146
|
+
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
147
|
+
|
148
|
+
xmlBufPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
|
149
|
+
xmlBufPtr conv; /* if encoder != NULL buffer for output */
|
150
|
+
int written; /* total number of byte written */
|
151
|
+
int error;
|
152
|
+
};
|
153
|
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
154
|
+
|
155
|
+
/*
|
156
|
+
* Interfaces for input
|
157
|
+
*/
|
158
|
+
XMLPUBFUN void XMLCALL
|
159
|
+
xmlCleanupInputCallbacks (void);
|
160
|
+
|
161
|
+
XMLPUBFUN int XMLCALL
|
162
|
+
xmlPopInputCallbacks (void);
|
163
|
+
|
164
|
+
XMLPUBFUN void XMLCALL
|
165
|
+
xmlRegisterDefaultInputCallbacks (void);
|
166
|
+
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
167
|
+
xmlAllocParserInputBuffer (xmlCharEncoding enc);
|
168
|
+
|
169
|
+
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
170
|
+
xmlParserInputBufferCreateFilename (const char *URI,
|
171
|
+
xmlCharEncoding enc);
|
172
|
+
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
173
|
+
xmlParserInputBufferCreateFile (FILE *file,
|
174
|
+
xmlCharEncoding enc);
|
175
|
+
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
176
|
+
xmlParserInputBufferCreateFd (int fd,
|
177
|
+
xmlCharEncoding enc);
|
178
|
+
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
179
|
+
xmlParserInputBufferCreateMem (const char *mem, int size,
|
180
|
+
xmlCharEncoding enc);
|
181
|
+
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
182
|
+
xmlParserInputBufferCreateStatic (const char *mem, int size,
|
183
|
+
xmlCharEncoding enc);
|
184
|
+
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
185
|
+
xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
|
186
|
+
xmlInputCloseCallback ioclose,
|
187
|
+
void *ioctx,
|
188
|
+
xmlCharEncoding enc);
|
189
|
+
XMLPUBFUN int XMLCALL
|
190
|
+
xmlParserInputBufferRead (xmlParserInputBufferPtr in,
|
191
|
+
int len);
|
192
|
+
XMLPUBFUN int XMLCALL
|
193
|
+
xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
|
194
|
+
int len);
|
195
|
+
XMLPUBFUN int XMLCALL
|
196
|
+
xmlParserInputBufferPush (xmlParserInputBufferPtr in,
|
197
|
+
int len,
|
198
|
+
const char *buf);
|
199
|
+
XMLPUBFUN void XMLCALL
|
200
|
+
xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
|
201
|
+
XMLPUBFUN char * XMLCALL
|
202
|
+
xmlParserGetDirectory (const char *filename);
|
203
|
+
|
204
|
+
XMLPUBFUN int XMLCALL
|
205
|
+
xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
|
206
|
+
xmlInputOpenCallback openFunc,
|
207
|
+
xmlInputReadCallback readFunc,
|
208
|
+
xmlInputCloseCallback closeFunc);
|
209
|
+
|
210
|
+
xmlParserInputBufferPtr
|
211
|
+
__xmlParserInputBufferCreateFilename(const char *URI,
|
212
|
+
xmlCharEncoding enc);
|
213
|
+
|
214
|
+
#ifdef LIBXML_OUTPUT_ENABLED
|
215
|
+
/*
|
216
|
+
* Interfaces for output
|
217
|
+
*/
|
218
|
+
XMLPUBFUN void XMLCALL
|
219
|
+
xmlCleanupOutputCallbacks (void);
|
220
|
+
XMLPUBFUN int XMLCALL
|
221
|
+
xmlPopOutputCallbacks (void);
|
222
|
+
XMLPUBFUN void XMLCALL
|
223
|
+
xmlRegisterDefaultOutputCallbacks(void);
|
224
|
+
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
225
|
+
xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
|
226
|
+
|
227
|
+
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
228
|
+
xmlOutputBufferCreateFilename (const char *URI,
|
229
|
+
xmlCharEncodingHandlerPtr encoder,
|
230
|
+
int compression);
|
231
|
+
|
232
|
+
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
233
|
+
xmlOutputBufferCreateFile (FILE *file,
|
234
|
+
xmlCharEncodingHandlerPtr encoder);
|
235
|
+
|
236
|
+
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
237
|
+
xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
|
238
|
+
xmlCharEncodingHandlerPtr encoder);
|
239
|
+
|
240
|
+
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
241
|
+
xmlOutputBufferCreateFd (int fd,
|
242
|
+
xmlCharEncodingHandlerPtr encoder);
|
243
|
+
|
244
|
+
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
245
|
+
xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
|
246
|
+
xmlOutputCloseCallback ioclose,
|
247
|
+
void *ioctx,
|
248
|
+
xmlCharEncodingHandlerPtr encoder);
|
249
|
+
|
250
|
+
/* Couple of APIs to get the output without digging into the buffers */
|
251
|
+
XMLPUBFUN const xmlChar * XMLCALL
|
252
|
+
xmlOutputBufferGetContent (xmlOutputBufferPtr out);
|
253
|
+
XMLPUBFUN size_t XMLCALL
|
254
|
+
xmlOutputBufferGetSize (xmlOutputBufferPtr out);
|
255
|
+
|
256
|
+
XMLPUBFUN int XMLCALL
|
257
|
+
xmlOutputBufferWrite (xmlOutputBufferPtr out,
|
258
|
+
int len,
|
259
|
+
const char *buf);
|
260
|
+
XMLPUBFUN int XMLCALL
|
261
|
+
xmlOutputBufferWriteString (xmlOutputBufferPtr out,
|
262
|
+
const char *str);
|
263
|
+
XMLPUBFUN int XMLCALL
|
264
|
+
xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
|
265
|
+
const xmlChar *str,
|
266
|
+
xmlCharEncodingOutputFunc escaping);
|
267
|
+
|
268
|
+
XMLPUBFUN int XMLCALL
|
269
|
+
xmlOutputBufferFlush (xmlOutputBufferPtr out);
|
270
|
+
XMLPUBFUN int XMLCALL
|
271
|
+
xmlOutputBufferClose (xmlOutputBufferPtr out);
|
272
|
+
|
273
|
+
XMLPUBFUN int XMLCALL
|
274
|
+
xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
|
275
|
+
xmlOutputOpenCallback openFunc,
|
276
|
+
xmlOutputWriteCallback writeFunc,
|
277
|
+
xmlOutputCloseCallback closeFunc);
|
278
|
+
|
279
|
+
xmlOutputBufferPtr
|
280
|
+
__xmlOutputBufferCreateFilename(const char *URI,
|
281
|
+
xmlCharEncodingHandlerPtr encoder,
|
282
|
+
int compression);
|
283
|
+
|
284
|
+
#ifdef LIBXML_HTTP_ENABLED
|
285
|
+
/* This function only exists if HTTP support built into the library */
|
286
|
+
XMLPUBFUN void XMLCALL
|
287
|
+
xmlRegisterHTTPPostCallbacks (void );
|
288
|
+
#endif /* LIBXML_HTTP_ENABLED */
|
289
|
+
|
290
|
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
291
|
+
|
292
|
+
XMLPUBFUN xmlParserInputPtr XMLCALL
|
293
|
+
xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
|
294
|
+
xmlParserInputPtr ret);
|
295
|
+
|
296
|
+
/*
|
297
|
+
* A predefined entity loader disabling network accesses
|
298
|
+
*/
|
299
|
+
XMLPUBFUN xmlParserInputPtr XMLCALL
|
300
|
+
xmlNoNetExternalEntityLoader (const char *URL,
|
301
|
+
const char *ID,
|
302
|
+
xmlParserCtxtPtr ctxt);
|
303
|
+
|
304
|
+
/*
|
305
|
+
* xmlNormalizeWindowsPath is obsolete, don't use it.
|
306
|
+
* Check xmlCanonicPath in uri.h for a better alternative.
|
307
|
+
*/
|
308
|
+
XMLPUBFUN xmlChar * XMLCALL
|
309
|
+
xmlNormalizeWindowsPath (const xmlChar *path);
|
310
|
+
|
311
|
+
XMLPUBFUN int XMLCALL
|
312
|
+
xmlCheckFilename (const char *path);
|
313
|
+
/**
|
314
|
+
* Default 'file://' protocol callbacks
|
315
|
+
*/
|
316
|
+
XMLPUBFUN int XMLCALL
|
317
|
+
xmlFileMatch (const char *filename);
|
318
|
+
XMLPUBFUN void * XMLCALL
|
319
|
+
xmlFileOpen (const char *filename);
|
320
|
+
XMLPUBFUN int XMLCALL
|
321
|
+
xmlFileRead (void * context,
|
322
|
+
char * buffer,
|
323
|
+
int len);
|
324
|
+
XMLPUBFUN int XMLCALL
|
325
|
+
xmlFileClose (void * context);
|
326
|
+
|
327
|
+
/**
|
328
|
+
* Default 'http://' protocol callbacks
|
329
|
+
*/
|
330
|
+
#ifdef LIBXML_HTTP_ENABLED
|
331
|
+
XMLPUBFUN int XMLCALL
|
332
|
+
xmlIOHTTPMatch (const char *filename);
|
333
|
+
XMLPUBFUN void * XMLCALL
|
334
|
+
xmlIOHTTPOpen (const char *filename);
|
335
|
+
#ifdef LIBXML_OUTPUT_ENABLED
|
336
|
+
XMLPUBFUN void * XMLCALL
|
337
|
+
xmlIOHTTPOpenW (const char * post_uri,
|
338
|
+
int compression );
|
339
|
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
340
|
+
XMLPUBFUN int XMLCALL
|
341
|
+
xmlIOHTTPRead (void * context,
|
342
|
+
char * buffer,
|
343
|
+
int len);
|
344
|
+
XMLPUBFUN int XMLCALL
|
345
|
+
xmlIOHTTPClose (void * context);
|
346
|
+
#endif /* LIBXML_HTTP_ENABLED */
|
347
|
+
|
348
|
+
/**
|
349
|
+
* Default 'ftp://' protocol callbacks
|
350
|
+
*/
|
351
|
+
#ifdef LIBXML_FTP_ENABLED
|
352
|
+
XMLPUBFUN int XMLCALL
|
353
|
+
xmlIOFTPMatch (const char *filename);
|
354
|
+
XMLPUBFUN void * XMLCALL
|
355
|
+
xmlIOFTPOpen (const char *filename);
|
356
|
+
XMLPUBFUN int XMLCALL
|
357
|
+
xmlIOFTPRead (void * context,
|
358
|
+
char * buffer,
|
359
|
+
int len);
|
360
|
+
XMLPUBFUN int XMLCALL
|
361
|
+
xmlIOFTPClose (void * context);
|
362
|
+
#endif /* LIBXML_FTP_ENABLED */
|
363
|
+
|
364
|
+
#ifdef __cplusplus
|
365
|
+
}
|
366
|
+
#endif
|
367
|
+
|
368
|
+
#endif /* __XML_IO_H__ */
|
@@ -0,0 +1,146 @@
|
|
1
|
+
/*
|
2
|
+
* Summary: API to build regexp automata
|
3
|
+
* Description: the API to build regexp automata
|
4
|
+
*
|
5
|
+
* Copy: See Copyright for the status of this software.
|
6
|
+
*
|
7
|
+
* Author: Daniel Veillard
|
8
|
+
*/
|
9
|
+
|
10
|
+
#ifndef __XML_AUTOMATA_H__
|
11
|
+
#define __XML_AUTOMATA_H__
|
12
|
+
|
13
|
+
#include <libxml/xmlversion.h>
|
14
|
+
#include <libxml/tree.h>
|
15
|
+
|
16
|
+
#ifdef LIBXML_REGEXP_ENABLED
|
17
|
+
#ifdef LIBXML_AUTOMATA_ENABLED
|
18
|
+
#include <libxml/xmlregexp.h>
|
19
|
+
|
20
|
+
#ifdef __cplusplus
|
21
|
+
extern "C" {
|
22
|
+
#endif
|
23
|
+
|
24
|
+
/**
|
25
|
+
* xmlAutomataPtr:
|
26
|
+
*
|
27
|
+
* A libxml automata description, It can be compiled into a regexp
|
28
|
+
*/
|
29
|
+
typedef struct _xmlAutomata xmlAutomata;
|
30
|
+
typedef xmlAutomata *xmlAutomataPtr;
|
31
|
+
|
32
|
+
/**
|
33
|
+
* xmlAutomataStatePtr:
|
34
|
+
*
|
35
|
+
* A state int the automata description,
|
36
|
+
*/
|
37
|
+
typedef struct _xmlAutomataState xmlAutomataState;
|
38
|
+
typedef xmlAutomataState *xmlAutomataStatePtr;
|
39
|
+
|
40
|
+
/*
|
41
|
+
* Building API
|
42
|
+
*/
|
43
|
+
XMLPUBFUN xmlAutomataPtr XMLCALL
|
44
|
+
xmlNewAutomata (void);
|
45
|
+
XMLPUBFUN void XMLCALL
|
46
|
+
xmlFreeAutomata (xmlAutomataPtr am);
|
47
|
+
|
48
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
49
|
+
xmlAutomataGetInitState (xmlAutomataPtr am);
|
50
|
+
XMLPUBFUN int XMLCALL
|
51
|
+
xmlAutomataSetFinalState (xmlAutomataPtr am,
|
52
|
+
xmlAutomataStatePtr state);
|
53
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
54
|
+
xmlAutomataNewState (xmlAutomataPtr am);
|
55
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
56
|
+
xmlAutomataNewTransition (xmlAutomataPtr am,
|
57
|
+
xmlAutomataStatePtr from,
|
58
|
+
xmlAutomataStatePtr to,
|
59
|
+
const xmlChar *token,
|
60
|
+
void *data);
|
61
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
62
|
+
xmlAutomataNewTransition2 (xmlAutomataPtr am,
|
63
|
+
xmlAutomataStatePtr from,
|
64
|
+
xmlAutomataStatePtr to,
|
65
|
+
const xmlChar *token,
|
66
|
+
const xmlChar *token2,
|
67
|
+
void *data);
|
68
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
69
|
+
xmlAutomataNewNegTrans (xmlAutomataPtr am,
|
70
|
+
xmlAutomataStatePtr from,
|
71
|
+
xmlAutomataStatePtr to,
|
72
|
+
const xmlChar *token,
|
73
|
+
const xmlChar *token2,
|
74
|
+
void *data);
|
75
|
+
|
76
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
77
|
+
xmlAutomataNewCountTrans (xmlAutomataPtr am,
|
78
|
+
xmlAutomataStatePtr from,
|
79
|
+
xmlAutomataStatePtr to,
|
80
|
+
const xmlChar *token,
|
81
|
+
int min,
|
82
|
+
int max,
|
83
|
+
void *data);
|
84
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
85
|
+
xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
|
86
|
+
xmlAutomataStatePtr from,
|
87
|
+
xmlAutomataStatePtr to,
|
88
|
+
const xmlChar *token,
|
89
|
+
const xmlChar *token2,
|
90
|
+
int min,
|
91
|
+
int max,
|
92
|
+
void *data);
|
93
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
94
|
+
xmlAutomataNewOnceTrans (xmlAutomataPtr am,
|
95
|
+
xmlAutomataStatePtr from,
|
96
|
+
xmlAutomataStatePtr to,
|
97
|
+
const xmlChar *token,
|
98
|
+
int min,
|
99
|
+
int max,
|
100
|
+
void *data);
|
101
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
102
|
+
xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
|
103
|
+
xmlAutomataStatePtr from,
|
104
|
+
xmlAutomataStatePtr to,
|
105
|
+
const xmlChar *token,
|
106
|
+
const xmlChar *token2,
|
107
|
+
int min,
|
108
|
+
int max,
|
109
|
+
void *data);
|
110
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
111
|
+
xmlAutomataNewAllTrans (xmlAutomataPtr am,
|
112
|
+
xmlAutomataStatePtr from,
|
113
|
+
xmlAutomataStatePtr to,
|
114
|
+
int lax);
|
115
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
116
|
+
xmlAutomataNewEpsilon (xmlAutomataPtr am,
|
117
|
+
xmlAutomataStatePtr from,
|
118
|
+
xmlAutomataStatePtr to);
|
119
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
120
|
+
xmlAutomataNewCountedTrans (xmlAutomataPtr am,
|
121
|
+
xmlAutomataStatePtr from,
|
122
|
+
xmlAutomataStatePtr to,
|
123
|
+
int counter);
|
124
|
+
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
125
|
+
xmlAutomataNewCounterTrans (xmlAutomataPtr am,
|
126
|
+
xmlAutomataStatePtr from,
|
127
|
+
xmlAutomataStatePtr to,
|
128
|
+
int counter);
|
129
|
+
XMLPUBFUN int XMLCALL
|
130
|
+
xmlAutomataNewCounter (xmlAutomataPtr am,
|
131
|
+
int min,
|
132
|
+
int max);
|
133
|
+
|
134
|
+
XMLPUBFUN xmlRegexpPtr XMLCALL
|
135
|
+
xmlAutomataCompile (xmlAutomataPtr am);
|
136
|
+
XMLPUBFUN int XMLCALL
|
137
|
+
xmlAutomataIsDeterminist (xmlAutomataPtr am);
|
138
|
+
|
139
|
+
#ifdef __cplusplus
|
140
|
+
}
|
141
|
+
#endif
|
142
|
+
|
143
|
+
#endif /* LIBXML_AUTOMATA_ENABLED */
|
144
|
+
#endif /* LIBXML_REGEXP_ENABLED */
|
145
|
+
|
146
|
+
#endif /* __XML_AUTOMATA_H__ */
|