ReactOS  0.4.13-dev-1165-gd2976ca
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 
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 
34 typedef int (XMLCALL *xmlInputMatchCallback) (char const *filename);
43 typedef void * (XMLCALL *xmlInputOpenCallback) (char const *filename);
54 typedef int (XMLCALL *xmlInputReadCallback) (void * context, char * buffer, int len);
64 
65 #ifdef LIBXML_OUTPUT_ENABLED
66 /*
67  * Those are the functions and datatypes for the library output
68  * I/O structures.
69  */
70 
80 typedef int (XMLCALL *xmlOutputMatchCallback) (char const *filename);
89 typedef void * (XMLCALL *xmlOutputOpenCallback) (char const *filename);
100 typedef int (XMLCALL *xmlOutputWriteCallback) (void * context, const char * buffer,
101  int len);
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
126  void* context;
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
160 
161 XMLPUBFUN int XMLCALL
162  xmlPopInputCallbacks (void);
163 
164 XMLPUBFUN void XMLCALL
168 
170  xmlParserInputBufferCreateFilename (const char *URI,
171  xmlCharEncoding enc);
174  xmlCharEncoding enc);
177  xmlCharEncoding enc);
179  xmlParserInputBufferCreateMem (const char *mem, int size,
180  xmlCharEncoding enc);
182  xmlParserInputBufferCreateStatic (const char *mem, int size,
183  xmlCharEncoding enc);
186  xmlInputCloseCallback ioclose,
187  void *ioctx,
188  xmlCharEncoding enc);
189 XMLPUBFUN int XMLCALL
191  int len);
192 XMLPUBFUN int XMLCALL
194  int len);
195 XMLPUBFUN int XMLCALL
197  int len,
198  const char *buf);
199 XMLPUBFUN void XMLCALL
201 XMLPUBFUN char * XMLCALL
202  xmlParserGetDirectory (const char *filename);
203 
204 XMLPUBFUN int XMLCALL
206  xmlInputOpenCallback openFunc,
207  xmlInputReadCallback readFunc,
208  xmlInputCloseCallback closeFunc);
209 
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 void XMLCALL
221  xmlRegisterDefaultOutputCallbacks(void);
223  xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
224 
226  xmlOutputBufferCreateFilename (const char *URI,
228  int compression);
229 
231  xmlOutputBufferCreateFile (FILE *file,
232  xmlCharEncodingHandlerPtr encoder);
233 
235  xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
236  xmlCharEncodingHandlerPtr encoder);
237 
239  xmlOutputBufferCreateFd (int fd,
240  xmlCharEncodingHandlerPtr encoder);
241 
243  xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
244  xmlOutputCloseCallback ioclose,
245  void *ioctx,
246  xmlCharEncodingHandlerPtr encoder);
247 
248 /* Couple of APIs to get the output without digging into the buffers */
249 XMLPUBFUN const xmlChar * XMLCALL
250  xmlOutputBufferGetContent (xmlOutputBufferPtr out);
251 XMLPUBFUN size_t XMLCALL
252  xmlOutputBufferGetSize (xmlOutputBufferPtr out);
253 
254 XMLPUBFUN int XMLCALL
255  xmlOutputBufferWrite (xmlOutputBufferPtr out,
256  int len,
257  const char *buf);
258 XMLPUBFUN int XMLCALL
259  xmlOutputBufferWriteString (xmlOutputBufferPtr out,
260  const char *str);
261 XMLPUBFUN int XMLCALL
262  xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
263  const xmlChar *str,
264  xmlCharEncodingOutputFunc escaping);
265 
266 XMLPUBFUN int XMLCALL
267  xmlOutputBufferFlush (xmlOutputBufferPtr out);
268 XMLPUBFUN int XMLCALL
269  xmlOutputBufferClose (xmlOutputBufferPtr out);
270 
271 XMLPUBFUN int XMLCALL
272  xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
273  xmlOutputOpenCallback openFunc,
274  xmlOutputWriteCallback writeFunc,
275  xmlOutputCloseCallback closeFunc);
276 
278  __xmlOutputBufferCreateFilename(const char *URI,
280  int compression);
281 
282 #ifdef LIBXML_HTTP_ENABLED
283 /* This function only exists if HTTP support built into the library */
284 XMLPUBFUN void XMLCALL
285  xmlRegisterHTTPPostCallbacks (void );
286 #endif /* LIBXML_HTTP_ENABLED */
287 
288 #endif /* LIBXML_OUTPUT_ENABLED */
289 
293 
294 /*
295  * A predefined entity loader disabling network accesses
296  */
298  xmlNoNetExternalEntityLoader (const char *URL,
299  const char *ID,
300  xmlParserCtxtPtr ctxt);
301 
302 /*
303  * xmlNormalizeWindowsPath is obsolete, don't use it.
304  * Check xmlCanonicPath in uri.h for a better alternative.
305  */
308 
309 XMLPUBFUN int XMLCALL
310  xmlCheckFilename (const char *path);
314 XMLPUBFUN int XMLCALL
315  xmlFileMatch (const char *filename);
316 XMLPUBFUN void * XMLCALL
317  xmlFileOpen (const char *filename);
318 XMLPUBFUN int XMLCALL
319  xmlFileRead (void * context,
320  char * buffer,
321  int len);
322 XMLPUBFUN int XMLCALL
323  xmlFileClose (void * context);
324 
328 #ifdef LIBXML_HTTP_ENABLED
329 XMLPUBFUN int XMLCALL
330  xmlIOHTTPMatch (const char *filename);
331 XMLPUBFUN void * XMLCALL
332  xmlIOHTTPOpen (const char *filename);
333 #ifdef LIBXML_OUTPUT_ENABLED
334 XMLPUBFUN void * XMLCALL
335  xmlIOHTTPOpenW (const char * post_uri,
336  int compression );
337 #endif /* LIBXML_OUTPUT_ENABLED */
338 XMLPUBFUN int XMLCALL
339  xmlIOHTTPRead (void * context,
340  char * buffer,
341  int len);
342 XMLPUBFUN int XMLCALL
343  xmlIOHTTPClose (void * context);
344 #endif /* LIBXML_HTTP_ENABLED */
345 
349 #ifdef LIBXML_FTP_ENABLED
350 XMLPUBFUN int XMLCALL
351  xmlIOFTPMatch (const char *filename);
352 XMLPUBFUN void * XMLCALL
353  xmlIOFTPOpen (const char *filename);
354 XMLPUBFUN int XMLCALL
355  xmlIOFTPRead (void * context,
356  char * buffer,
357  int len);
358 XMLPUBFUN int XMLCALL
359  xmlIOFTPClose (void * context);
360 #endif /* LIBXML_FTP_ENABLED */
361 
362 #ifdef __cplusplus
363 }
364 #endif
365 
366 #endif /* __XML_IO_H__ */
XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlParserInputBufferCreateStatic(const char *mem, int size, xmlCharEncoding enc)
XMLPUBFUN void XMLCALL xmlCleanupInputCallbacks(void)
void *(XMLCALL * xmlInputOpenCallback)(char const *filename)
Definition: xmlIO.h:43
unsigned long rawconsumed
Definition: xmlIO.h:136
#define error(str)
Definition: mkdosfs.c:1605
Definition: http.c:6587
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
XMLPUBFUN int XMLCALL xmlCheckFilename(const char *path)
XMLPUBFUN void XMLCALL xmlRegisterDefaultInputCallbacks(void)
XMLPUBFUN char *XMLCALL xmlParserGetDirectory(const char *filename)
XMLPUBFUN int XMLCALL xmlParserInputBufferPush(xmlParserInputBufferPtr in, int len, const char *buf)
XMLPUBFUN void XMLCALL xmlFreeParserInputBuffer(xmlParserInputBufferPtr in)
GLuint buffer
Definition: glext.h:5915
static int fd
Definition: io.c:51
xmlCharEncoding
Definition: encoding.h:58
#define XMLPUBFUN
Definition: xmlexports.h:30
XMLPUBFUN int XMLCALL xmlFileMatch(const char *filename)
const char * filename
Definition: ioapi.h:135
xmlInputReadCallback readcallback
Definition: xmlIO.h:127
XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlParserInputBufferCreateMem(const char *mem, int size, xmlCharEncoding enc)
Definition: buf.c:43
XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlParserInputBufferCreateIO(xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc)
XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlParserInputBufferCreateFile(FILE *file, xmlCharEncoding enc)
xmlOutputBuffer * xmlOutputBufferPtr
Definition: tree.h:32
int(* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, const unsigned char *in, int *inlen)
Definition: encoding.h:123
XMLPUBFUN int XMLCALL xmlFileClose(void *context)
const WCHAR * str
XMLPUBFUN int XMLCALL xmlPopInputCallbacks(void)
XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlAllocParserInputBuffer(xmlCharEncoding enc)
int(XMLCALL * xmlInputCloseCallback)(void *context)
Definition: xmlIO.h:63
XMLPUBFUN xmlChar *XMLCALL xmlNormalizeWindowsPath(const xmlChar *path)
GLsizeiptr size
Definition: glext.h:5919
xmlBufPtr raw
Definition: xmlIO.h:133
xmlInputCloseCallback closecallback
Definition: xmlIO.h:128
XMLPUBFUN int XMLCALL xmlFileRead(void *context, char *buffer, int len)
xmlBufPtr buffer
Definition: xmlIO.h:132
static FILE * out
Definition: regtests2xml.c:44
int(XMLCALL * xmlInputReadCallback)(void *context, char *buffer, int len)
Definition: xmlIO.h:54
XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc)
int ret
_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:1301
unsigned char xmlChar
Definition: xmlstring.h:28
GLenum GLsizei len
Definition: glext.h:6722
#define ID
Definition: ruserpass.c:36
XMLPUBFUN xmlParserInputPtr XMLCALL xmlCheckHTTPInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr ret)
xmlCharEncodingHandlerPtr encoder
Definition: xmlIO.h:130
XMLPUBFUN xmlParserInputPtr XMLCALL xmlNoNetExternalEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt)
XMLPUBFUN xmlParserInputBufferPtr XMLCALL xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc)
GLuint in
Definition: glext.h:9616
xmlParserInputBufferPtr __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc)
Definition: services.c:325
XMLPUBFUN int XMLCALL xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len)
XMLPUBFUN void *XMLCALL xmlFileOpen(const char *filename)
int(XMLCALL * xmlInputMatchCallback)(char const *filename)
Definition: xmlIO.h:34
#define XMLCALL
Definition: mem.c:156
XMLPUBFUN int XMLCALL xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
Definition: fci.c:126
XMLPUBFUN int XMLCALL xmlRegisterInputCallbacks(xmlInputMatchCallback matchFunc, xmlInputOpenCallback openFunc, xmlInputReadCallback readFunc, xmlInputCloseCallback closeFunc)