ReactOS 0.4.16-dev-2208-g6350669
xmlIO.h
Go to the documentation of this file.
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#include <libxml/encoding.h>
16#define XML_TREE_INTERNALS
17#include <libxml/tree.h>
18#undef XML_TREE_INTERNALS
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/*
25 * Those are the functions and datatypes for the parser input
26 * I/O structures.
27 */
28
38typedef int (*xmlInputMatchCallback) (char const *filename);
47typedef void * (*xmlInputOpenCallback) (char const *filename);
58typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
67typedef int (*xmlInputCloseCallback) (void * context);
68
69#ifdef LIBXML_OUTPUT_ENABLED
70/*
71 * Those are the functions and datatypes for the library output
72 * I/O structures.
73 */
74
84typedef int (*xmlOutputMatchCallback) (char const *filename);
93typedef void * (*xmlOutputOpenCallback) (char const *filename);
104typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
105 int len);
114typedef int (*xmlOutputCloseCallback) (void * context);
115#endif /* LIBXML_OUTPUT_ENABLED */
116
128typedef xmlParserInputBufferPtr
130
142typedef xmlOutputBufferPtr
143(*xmlOutputBufferCreateFilenameFunc)(const char *URI,
145
147 void* context;
150
151 xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
152
153 xmlBufPtr buffer; /* Local buffer encoded in UTF-8 */
154 xmlBufPtr raw; /* if encoder != NULL buffer for raw input */
155 int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
156 int error;
157 unsigned long rawconsumed;/* amount consumed from raw */
158};
159
160
161#ifdef LIBXML_OUTPUT_ENABLED
162struct _xmlOutputBuffer {
163 void* context;
164 xmlOutputWriteCallback writecallback;
165 xmlOutputCloseCallback closecallback;
166
167 xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
168
169 xmlBufPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
170 xmlBufPtr conv; /* if encoder != NULL buffer for output */
171 int written; /* total number of byte written */
172 int error;
173};
174#endif /* LIBXML_OUTPUT_ENABLED */
175
177#define XML_GLOBALS_IO \
178 XML_OP(xmlParserInputBufferCreateFilenameValue, \
179 xmlParserInputBufferCreateFilenameFunc, XML_DEPRECATED) \
180 XML_OP(xmlOutputBufferCreateFilenameValue, \
181 xmlOutputBufferCreateFilenameFunc, XML_DEPRECATED)
182
183#define XML_OP XML_DECLARE_GLOBAL
185#undef XML_OP
186
187#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
188 #define xmlParserInputBufferCreateFilenameValue \
189 XML_GLOBAL_MACRO(xmlParserInputBufferCreateFilenameValue)
190 #define xmlOutputBufferCreateFilenameValue \
191 XML_GLOBAL_MACRO(xmlOutputBufferCreateFilenameValue)
192#endif
195/*
196 * Interfaces for input
197 */
198XMLPUBFUN void
200
201XMLPUBFUN int
203
204XMLPUBFUN void
206XMLPUBFUN xmlParserInputBufferPtr
208
209XMLPUBFUN xmlParserInputBufferPtr
211 xmlCharEncoding enc);
212XMLPUBFUN xmlParserInputBufferPtr
214 xmlCharEncoding enc);
215XMLPUBFUN xmlParserInputBufferPtr
217 xmlCharEncoding enc);
218XMLPUBFUN xmlParserInputBufferPtr
220 xmlCharEncoding enc);
221XMLPUBFUN xmlParserInputBufferPtr
223 xmlCharEncoding enc);
224XMLPUBFUN xmlParserInputBufferPtr
226 xmlInputCloseCallback ioclose,
227 void *ioctx,
228 xmlCharEncoding enc);
229XMLPUBFUN int
230 xmlParserInputBufferRead (xmlParserInputBufferPtr in,
231 int len);
232XMLPUBFUN int
233 xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
234 int len);
235XMLPUBFUN int
236 xmlParserInputBufferPush (xmlParserInputBufferPtr in,
237 int len,
238 const char *buf);
239XMLPUBFUN void
240 xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
241XMLPUBFUN char *
243
244XMLPUBFUN int
246 xmlInputOpenCallback openFunc,
247 xmlInputReadCallback readFunc,
248 xmlInputCloseCallback closeFunc);
249
250xmlParserInputBufferPtr
252 xmlCharEncoding enc);
253
254#ifdef LIBXML_OUTPUT_ENABLED
255/*
256 * Interfaces for output
257 */
258XMLPUBFUN void
259 xmlCleanupOutputCallbacks (void);
260XMLPUBFUN int
261 xmlPopOutputCallbacks (void);
262XMLPUBFUN void
263 xmlRegisterDefaultOutputCallbacks(void);
264XMLPUBFUN xmlOutputBufferPtr
265 xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
266
267XMLPUBFUN xmlOutputBufferPtr
268 xmlOutputBufferCreateFilename (const char *URI,
270 int compression);
271
272XMLPUBFUN xmlOutputBufferPtr
273 xmlOutputBufferCreateFile (FILE *file,
275
276XMLPUBFUN xmlOutputBufferPtr
277 xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
279
280XMLPUBFUN xmlOutputBufferPtr
281 xmlOutputBufferCreateFd (int fd,
283
284XMLPUBFUN xmlOutputBufferPtr
285 xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
286 xmlOutputCloseCallback ioclose,
287 void *ioctx,
289
290/* Couple of APIs to get the output without digging into the buffers */
291XMLPUBFUN const xmlChar *
292 xmlOutputBufferGetContent (xmlOutputBufferPtr out);
293XMLPUBFUN size_t
294 xmlOutputBufferGetSize (xmlOutputBufferPtr out);
295
296XMLPUBFUN int
297 xmlOutputBufferWrite (xmlOutputBufferPtr out,
298 int len,
299 const char *buf);
300XMLPUBFUN int
301 xmlOutputBufferWriteString (xmlOutputBufferPtr out,
302 const char *str);
303XMLPUBFUN int
304 xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
305 const xmlChar *str,
307
308XMLPUBFUN int
309 xmlOutputBufferFlush (xmlOutputBufferPtr out);
310XMLPUBFUN int
311 xmlOutputBufferClose (xmlOutputBufferPtr out);
312
313XMLPUBFUN int
314 xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
315 xmlOutputOpenCallback openFunc,
316 xmlOutputWriteCallback writeFunc,
317 xmlOutputCloseCallback closeFunc);
318
319xmlOutputBufferPtr
320 __xmlOutputBufferCreateFilename(const char *URI,
322 int compression);
323
324#ifdef LIBXML_HTTP_ENABLED
325/* This function only exists if HTTP support built into the library */
326XMLPUBFUN void
327 xmlRegisterHTTPPostCallbacks (void );
328#endif /* LIBXML_HTTP_ENABLED */
329
330#endif /* LIBXML_OUTPUT_ENABLED */
331
332XMLPUBFUN xmlParserInputPtr
333 xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
334 xmlParserInputPtr ret);
335
336/*
337 * A predefined entity loader disabling network accesses
338 */
339XMLPUBFUN xmlParserInputPtr
341 const char *ID,
342 xmlParserCtxtPtr ctxt);
343
344/*
345 * xmlNormalizeWindowsPath is obsolete, don't use it.
346 * Check xmlCanonicPath in uri.h for a better alternative.
347 */
350
351XMLPUBFUN int
352 xmlCheckFilename (const char *path);
356XMLPUBFUN int
357 xmlFileMatch (const char *filename);
358XMLPUBFUN void *
359 xmlFileOpen (const char *filename);
360XMLPUBFUN int
362 char * buffer,
363 int len);
364XMLPUBFUN int
366
370#ifdef LIBXML_HTTP_ENABLED
371XMLPUBFUN int
372 xmlIOHTTPMatch (const char *filename);
373XMLPUBFUN void *
374 xmlIOHTTPOpen (const char *filename);
375#ifdef LIBXML_OUTPUT_ENABLED
376XMLPUBFUN void *
377 xmlIOHTTPOpenW (const char * post_uri,
378 int compression );
379#endif /* LIBXML_OUTPUT_ENABLED */
380XMLPUBFUN int
381 xmlIOHTTPRead (void * context,
382 char * buffer,
383 int len);
384XMLPUBFUN int
385 xmlIOHTTPClose (void * context);
386#endif /* LIBXML_HTTP_ENABLED */
387
391#if defined(LIBXML_FTP_ENABLED)
392XMLPUBFUN int
393 xmlIOFTPMatch (const char *filename);
394XMLPUBFUN void *
395 xmlIOFTPOpen (const char *filename);
396XMLPUBFUN int
397 xmlIOFTPRead (void * context,
398 char * buffer,
399 int len);
400XMLPUBFUN int
401 xmlIOFTPClose (void * context);
402#endif /* defined(LIBXML_FTP_ENABLED) */
403
416
417#ifdef __cplusplus
418}
419#endif
420
421#endif /* __XML_IO_H__ */
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
Definition: btrfs_drv.h:1365
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
return ret
Definition: mutex.c:146
int(* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
Definition: encoding.h:130
xmlCharEncoding
Definition: encoding.h:65
GLenum func
Definition: glext.h:6028
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint in
Definition: glext.h:9616
GLenum GLsizei len
Definition: glext.h:6722
const char * filename
Definition: ioapi.h:137
#define error(str)
Definition: mkdosfs.c:1605
const WCHAR * str
#define ID
Definition: ruserpass.c:36
static int fd
Definition: io.c:51
xmlBufPtr buffer
Definition: xmlIO.h:153
unsigned long rawconsumed
Definition: xmlIO.h:157
xmlInputCloseCallback closecallback
Definition: xmlIO.h:149
xmlInputReadCallback readcallback
Definition: xmlIO.h:148
xmlCharEncodingHandlerPtr encoder
Definition: xmlIO.h:151
xmlBufPtr raw
Definition: xmlIO.h:154
Definition: http.c:7252
Definition: fci.c:127
Definition: mem.c:349
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
XMLPUBFUN xmlParserInputBufferPtr xmlParserInputBufferCreateMem(const char *mem, int size, xmlCharEncoding enc)
XMLPUBFUN xmlChar * xmlNormalizeWindowsPath(const xmlChar *path)
XMLPUBFUN xmlParserInputBufferPtr xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc)
xmlParserInputBufferPtr(* xmlParserInputBufferCreateFilenameFunc)(const char *URI, xmlCharEncoding enc)
Definition: xmlIO.h:129
XMLPUBFUN xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)
XMLPUBFUN int xmlPopInputCallbacks(void)
XMLPUBFUN void xmlFreeParserInputBuffer(xmlParserInputBufferPtr in)
XMLPUBFUN void xmlRegisterDefaultInputCallbacks(void)
#define XML_GLOBALS_IO
Definition: xmlIO.h:177
XMLPUBFUN xmlParserInputBufferPtr xmlAllocParserInputBuffer(xmlCharEncoding enc)
XMLPUBFUN char * xmlParserGetDirectory(const char *filename)
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
Definition: globals.c:1176
XMLPUBFUN int xmlFileClose(void *context)
XML_GLOBALS_IO XMLPUBFUN void xmlCleanupInputCallbacks(void)
xmlOutputBufferPtr(* xmlOutputBufferCreateFilenameFunc)(const char *URI, xmlCharEncodingHandlerPtr encoder, int compression)
Definition: xmlIO.h:143
xmlParserInputBufferPtr __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc)
XMLPUBFUN xmlParserInputBufferPtr xmlParserInputBufferCreateStatic(const char *mem, int size, xmlCharEncoding enc)
int(* xmlInputMatchCallback)(char const *filename)
Definition: xmlIO.h:38
XMLPUBFUN xmlOutputBufferCreateFilenameFunc xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func)
Definition: globals.c:1193
void *(* xmlInputOpenCallback)(char const *filename)
Definition: xmlIO.h:47
XMLPUBFUN xmlParserInputPtr xmlCheckHTTPInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr ret)
XMLPUBFUN int xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len)
int(* xmlInputReadCallback)(void *context, char *buffer, int len)
Definition: xmlIO.h:58
XMLPUBFUN xmlParserInputBufferPtr xmlParserInputBufferCreateFile(FILE *file, xmlCharEncoding enc)
int(* xmlInputCloseCallback)(void *context)
Definition: xmlIO.h:67
XMLPUBFUN xmlParserInputBufferPtr xmlParserInputBufferCreateIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc)
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func)
XMLPUBFUN void * xmlFileOpen(const char *filename)
XMLPUBFUN xmlParserInputPtr xmlNoNetExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt)
XMLPUBFUN xmlParserInputBufferPtr xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc)
XMLPUBFUN int xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len)
XMLPUBFUN int xmlParserInputBufferPush(xmlParserInputBufferPtr in, int len, const char *buf)
XMLPUBFUN int xmlCheckFilename(const char *path)
XMLPUBFUN int xmlFileRead(void *context, char *buffer, int len)
XMLPUBFUN int xmlRegisterInputCallbacks(xmlInputMatchCallback matchFunc, xmlInputOpenCallback openFunc, xmlInputReadCallback readFunc, xmlInputCloseCallback closeFunc)
XMLPUBFUN int xmlFileMatch(const char *filename)
#define XMLPUBFUN
Definition: xmlexports.h:30
unsigned char xmlChar
Definition: xmlstring.h:28