blob: a7c19e48f8550b3a8e4a58fd62584f5cee5e58cc (
plain)
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
|
(*
* Summary: interface for the I/O interfaces used by the parser
* Description: interface for the I/O interfaces used by the parser
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*)
(*
* Those are the functions and datatypes for the parser input
* I/O structures.
*)
{$IFDEF POINTER}
xmlParserInputBufferPtr = ^xmlParserInputBuffer;
xmlOutputBufferPtr = ^xmlOutputBuffer;
{$ENDIF}
{$IFDEF TYPE}
(**
* xmlInputMatchCallback:
* @filename: the filename or URI
*
* Callback used in the I/O Input API to detect if the current handler
* can provide input fonctionnalities for this resource.
*
* Returns 1 if yes and 0 if another Input module should be used
*)
xmlInputMatchCallback = function(filename: pchar): cint; EXTDECL;
(**
* xmlInputOpenCallback:
* @filename: the filename or URI
*
* Callback used in the I/O Input API to open the resource
*
* Returns an Input context or NULL in case or error
*)
xmlInputOpenCallback = function(filename: pchar): pointer; EXTDECL;
(**
* xmlInputReadCallback:
* @context: an Input context
* @buffer: the buffer to store data read
* @len: the length of the buffer in bytes
*
* Callback used in the I/O Input API to read the resource
*
* Returns the number of bytes read or -1 in case of error
*)
xmlInputReadCallback = function(context: pointer; buffer: pchar; len: cint): cint; EXTDECL;
(**
* xmlInputCloseCallback:
* @context: an Input context
*
* Callback used in the I/O Input API to close the resource
*
* Returns 0 or -1 in case of error
*)
xmlInputCloseCallback = function(context: pointer): cint; EXTDECL;
{$IFDEF LIBXML_OUTPUT_ENABLED}
(*
* Those are the functions and datatypes for the library output
* I/O structures.
*)
(**
* xmlOutputMatchCallback:
* @filename: the filename or URI
*
* Callback used in the I/O Output API to detect if the current handler
* can provide output fonctionnalities for this resource.
*
* Returns 1 if yes and 0 if another Output module should be used
*)
xmlOutputMatchCallback = function(filename: pchar): cint; EXTDECL;
(**
* xmlOutputOpenCallback:
* @filename: the filename or URI
*
* Callback used in the I/O Output API to open the resource
*
* Returns an Output context or NULL in case or error
*)
xmlOutputOpenCallback = function(filename: pchar): pointer; EXTDECL;
(**
* xmlOutputWriteCallback:
* @context: an Output context
* @buffer: the buffer of data to write
* @len: the length of the buffer in bytes
*
* Callback used in the I/O Output API to write to the resource
*
* Returns the number of bytes written or -1 in case of error
*)
xmlOutputWriteCallback = function(context: pointer; buffer: pchar; len: cint): cint; EXTDECL;
(**
* xmlOutputCloseCallback:
* @context: an Output context
*
* Callback used in the I/O Output API to close the resource
*
* Returns 0 or -1 in case of error
*)
xmlOutputCloseCallback = function(context: pointer): cint; EXTDECL;
{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
xmlParserInputBuffer = record
context : pointer;
readcallback : xmlInputReadCallback;
closecallback : xmlInputCloseCallback;
encoder : xmlCharEncodingHandlerPtr; (* I18N conversions to UTF-8 *)
buffer : xmlBufferPtr; (* Local buffer encoded in UTF-8 *)
raw : xmlBufferPtr; (* if encoder != NULL buffer for raw input *)
compressed : cint; (* -1=unknown, 0=not compressed, 1=compressed *)
error : cint;
rawconsumed : culong; (* amount consumed from raw *)
end;
{$IFDEF LIBXML_OUTPUT_ENABLED}
xmlOutputBuffer = record
context : pointer;
writecallback : xmlOutputWriteCallback;
closecallback : xmlOutputCloseCallback;
encoder : xmlCharEncodingHandlerPtr; (* I18N conversions to UTF-8 *)
buffer : xmlBufferPtr; (* Local buffer encoded in UTF-8 or ISOLatin *)
conv : xmlBufferPtr; (* if encoder != NULL buffer for output *)
written : cint; (* total number of byte written *)
error : cint;
end;
{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
{$ENDIF}
{$IFDEF FUNCTION}
(*
* Interfaces for input
*)
procedure xmlCleanupInputCallbacks; EXTDECL; external xml2lib;
function xmlPopInputCallbacks: cint; EXTDECL; external xml2lib;
procedure xmlRegisterDefaultInputCallbacks; EXTDECL; external xml2lib;
function xmlAllocParserInputBuffer(enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL; external xml2lib;
function xmlParserInputBufferCreateFilename(URI: pchar; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL; external xml2lib;
function xmlParserInputBufferCreateFile(fp: PFILE; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL; external xml2lib;
function xmlParserInputBufferCreateFd(fd: cint; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL; external xml2lib;
function xmlParserInputBufferCreateMem(mem: pchar; size: cint; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL; external xml2lib;
function xmlParserInputBufferCreateStatic(mem: pchar; size: cint; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL; external xml2lib;
function xmlParserInputBufferCreateIO(ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pointer; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL; external xml2lib;
function xmlParserInputBufferRead(_in: xmlParserInputBufferPtr; len: cint): cint; EXTDECL; external xml2lib;
function xmlParserInputBufferGrow(_in: xmlParserInputBufferPtr; len: cint): cint; EXTDECL; external xml2lib;
function xmlParserInputBufferPush(_in: xmlParserInputBufferPtr; len: cint; buf: pchar): cint; EXTDECL; external xml2lib;
procedure xmlFreeParserInputBuffer(_in: xmlParserInputBufferPtr); EXTDECL; external xml2lib;
function xmlParserGetDirectory(filename: pchar): pchar; EXTDECL; external xml2lib;
function xmlRegisterInputCallbacks(matchFunc: xmlInputMatchCallback; openFunc: xmlInputOpenCallback; readFunc: xmlInputReadCallback; closeFunc: xmlInputCloseCallback): cint; EXTDECL; external xml2lib;
function __xmlParserInputBufferCreateFilename(URI: pchar; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL; external xml2lib;
{$IFDEF LIBXML_OUTPUT_ENABLED}
(*
* Interfaces for output
*)
procedure xmlCleanupOutputCallbacks; EXTDECL; external xml2lib;
procedure xmlRegisterDefaultOutputCallbacks; EXTDECL; external xml2lib;
function xmlAllocOutputBuffer(encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL; external xml2lib;
function xmlOutputBufferCreateFilename(URI: pchar; encoder: xmlCharEncodingHandlerPtr; compression: cint): xmlOutputBufferPtr; EXTDECL; external xml2lib;
function xmlOutputBufferCreateFile(fp: PFILE; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL; external xml2lib;
function xmlOutputBufferCreateBuffer(buffer: xmlBufferPtr; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL; external xml2lib;
function xmlOutputBufferCreateFd(fd: cint; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL; external xml2lib;
function xmlOutputBufferCreateIO(iowrite: xmlOutputWriteCallback; ioclose: xmlOutputCloseCallback; ioctx: pointer; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL; external xml2lib;
function xmlOutputBufferWrite(_out: xmlOutputBufferPtr; len: cint; buf: pchar): cint; EXTDECL; external xml2lib;
function xmlOutputBufferWriteString(_out: xmlOutputBufferPtr; str: pchar): cint; EXTDECL; external xml2lib;
function xmlOutputBufferWriteEscape(_out: xmlOutputBufferPtr; str: xmlCharPtr; escaping: xmlCharEncodingOutputFunc): cint; EXTDECL; external xml2lib;
function xmlOutputBufferFlush(_out: xmlOutputBufferPtr): cint; EXTDECL; external xml2lib;
function xmlOutputBufferClose(_out: xmlOutputBufferPtr): cint; EXTDECL; external xml2lib;
function xmlRegisterOutputCallbacks(matchFunc: xmlOutputMatchCallback; openFunc: xmlOutputOpenCallback; writeFunc: xmlOutputWriteCallback; closeFunc: xmlOutputCloseCallback): cint; EXTDECL; external xml2lib;
function __xmlOutputBufferCreateFilename(URI: pchar; encoder: xmlCharEncodingHandlerPtr; compression: cint): xmlOutputBufferPtr; EXTDECL; external xml2lib;
{$IFDEF LIBXML_HTTP_ENABLED}
(* This function only exists if HTTP support built into the library *)
procedure xmlRegisterHTTPPostCallbacks; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_HTTP_ENABLED *)
{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
function xmlCheckHTTPInput(ctxt: xmlParserCtxtPtr; ret: xmlParserInputPtr): xmlParserInputPtr; EXTDECL; external xml2lib;
(*
* A predefined entity loader disabling network accesses
*)
function xmlNoNetExternalEntityLoader(URL: pchar; ID: pchar; ctxt: xmlParserCtxtPtr): xmlParserInputPtr; EXTDECL; external xml2lib;
(*
* Check xmlCanonicPath in uri.h for a better alternative.
*)
function xmlCheckFilename(path: pchar): cint; EXTDECL; external xml2lib;
(**
* Default 'file://' protocol callbacks
*)
function xmlFileMatch(filename: pchar): cint; EXTDECL; external xml2lib;
function xmlFileOpen(filename: pchar): pointer; EXTDECL; external xml2lib;
function xmlFileRead(context: pointer; buffer: pchar; len: cint): cint; EXTDECL; external xml2lib;
function xmlFileClose(context: pointer): cint; EXTDECL; external xml2lib;
(**
* Default 'http://' protocol callbacks
*)
{$IFDEF LIBXML_HTTP_ENABLED}
function xmlIOHTTPMatch(filename: pchar): cint; EXTDECL; external xml2lib;
function xmlIOHTTPOpen(filename: pchar): pointer; EXTDECL; external xml2lib;
{$IFDEF LIBXML_OUTPUT_ENABLED}
function xmlIOHTTPOpenW(post_uri: pchar; compression: cint): pointer; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
function xmlIOHTTPRead(context: pointer; buffer: pchar; len: cint): cint; EXTDECL; external xml2lib;
function xmlIOHTTPClose(context: pointer): cint; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_HTTP_ENABLED *)
(**
* Default 'ftp://' protocol callbacks
*)
{$IFDEF LIBXML_FTP_ENABLED}
function xmlIOFTPMatch(filename: pchar): cint; EXTDECL; external xml2lib;
function xmlIOFTPOpen(filename: pchar): pointer; EXTDECL; external xml2lib;
function xmlIOFTPRead(context: pointer; buffer: pchar; len: cint): cint; EXTDECL; external xml2lib;
function xmlIOFTPClose(context: pointer): cint; EXTDECL; external xml2lib;
{$ENDIF} (* LIBXML_FTP_ENABLED *)
{$ENDIF}
|